@@ -54,6 +54,7 @@ Read individual rule files for detailed explanations, GOOD/BAD examples, and con
5454- [ rules/prefer-presets.md] ( rules/prefer-presets.md ) - Prefer presets over manual keyframes (31 built-in presets)
5555- [ rules/hex-colors.md] ( rules/hex-colors.md ) - Colors in hex format only (#RRGGBB or #RRGGBBAA)
5656- [ rules/easing-guidelines.md] ( rules/easing-guidelines.md ) - Easing guidelines for motion design
57+ - [ rules/text-background.md] ( rules/text-background.md ) - text-background renders a colored rectangle behind text
5758
5859---
5960
@@ -80,7 +81,7 @@ Read individual rule files for detailed explanations, GOOD/BAD examples, and con
8081 "angle" : 135
8182 },
8283 "border-radius" : 32 ,
83- "animation" : { "name" : " scale_in" , "duration" : 0.6 }
84+ "animation" : [ { "name" : " scale_in" , "duration" : 0.6 }]
8485 }
8586 },
8687 {
@@ -89,7 +90,7 @@ Read individual rule files for detailed explanations, GOOD/BAD examples, and con
8990 "size" : { "width" : 80 , "height" : 80 },
9091 "style" : {
9192 "color" : " #FFFFFF" ,
92- "animation" : { "name" : " fade_in_up" , "delay" : 0.3 , "duration" : 0.6 }
93+ "animation" : [ { "name" : " fade_in_up" , "delay" : 0.3 , "duration" : 0.6 }]
9394 }
9495 },
9596 {
@@ -100,7 +101,7 @@ Read individual rule files for detailed explanations, GOOD/BAD examples, and con
100101 "color" : " #FFFFFF" ,
101102 "font-weight" : " bold" ,
102103 "text-align" : " center" ,
103- "animation" : { "name" : " fade_in_up" , "delay" : 0.5 , "duration" : 0.6 }
104+ "animation" : [ { "name" : " fade_in_up" , "delay" : 0.5 , "duration" : 0.6 }]
104105 }
105106 },
106107 {
@@ -112,7 +113,7 @@ Read individual rule files for detailed explanations, GOOD/BAD examples, and con
112113 "color" : " #CBD5E1" ,
113114 "text-align" : " center" ,
114115 "line-height" : 1.5 ,
115- "animation" : { "name" : " fade_in_up" , "delay" : 0.7 , "duration" : 0.6 }
116+ "animation" : [ { "name" : " fade_in_up" , "delay" : 0.7 , "duration" : 0.6 }]
116117 }
117118 }
118119 ]
@@ -139,7 +140,7 @@ Read individual rule files for detailed explanations, GOOD/BAD examples, and con
139140 "color" : " #7AA2F7" ,
140141 "font-weight" : " bold" ,
141142 "text-align" : " center" ,
142- "animation" : { "name" : " fade_in" , "duration" : 0.5 }
143+ "animation" : [ { "name" : " fade_in" , "duration" : 0.5 }]
143144 }
144145 },
145146 {
@@ -169,7 +170,7 @@ Read individual rule files for detailed explanations, GOOD/BAD examples, and con
169170 "font-size" : 28 ,
170171 "color" : " #9ECE6A" ,
171172 "text-align" : " center" ,
172- "animation" : { "name" : " fade_in_up" , "delay" : 0.0 , "duration" : 0.6 }
173+ "animation" : [ { "name" : " fade_in_up" , "delay" : 0.0 , "duration" : 0.6 }]
173174 }
174175 }
175176 ]
@@ -191,12 +192,12 @@ Read individual rule files for detailed explanations, GOOD/BAD examples, and con
191192 {
192193 "type" : " text" ,
193194 "content" : " 2024 Results" ,
194- "style" : { "font-size" : 72 , "color" : " #FFFFFF" , "font-weight" : " bold" , "text-align" : " center" , "animation" : { "name" : " fade_in_up" } }
195+ "style" : { "font-size" : 72 , "color" : " #FFFFFF" , "font-weight" : " bold" , "text-align" : " center" , "animation" : [ { "name" : " fade_in_up" }] }
195196 },
196197 {
197198 "type" : " text" ,
198199 "content" : " Year in Review" ,
199- "style" : { "font-size" : 36 , "color" : " #94A3B8" , "text-align" : " center" , "animation" : { "name" : " fade_in_up" , "delay" : 0.3 , "duration" : 0.6 } }
200+ "style" : { "font-size" : 36 , "color" : " #94A3B8" , "text-align" : " center" , "animation" : [ { "name" : " fade_in_up" , "delay" : 0.3 , "duration" : 0.6 }] }
200201 }
201202 ]
202203 },
@@ -217,7 +218,7 @@ Read individual rule files for detailed explanations, GOOD/BAD examples, and con
217218 {
218219 "type" : " text" ,
219220 "content" : " Users Reached" ,
220- "style" : { "font-size" : 36 , "color" : " #CBD5E1" , "text-align" : " center" , "animation" : { "name" : " fade_in_up" , "delay" : 0.5 , "duration" : 0.6 } }
221+ "style" : { "font-size" : 36 , "color" : " #CBD5E1" , "text-align" : " center" , "animation" : [ { "name" : " fade_in_up" , "delay" : 0.5 , "duration" : 0.6 }] }
221222 },
222223 {
223224 "type" : " card" ,
@@ -228,7 +229,7 @@ Read individual rule files for detailed explanations, GOOD/BAD examples, and con
228229 "padding" : 24 ,
229230 "background" : " #1E293B" ,
230231 "border-radius" : 20 ,
231- "animation" : { "name" : " fade_in_up" , "delay" : 0.8 , "duration" : 0.6 }
232+ "animation" : [ { "name" : " fade_in_up" , "delay" : 0.8 , "duration" : 0.6 }]
232233 },
233234 "children" : [
234235 {
@@ -255,13 +256,10 @@ Read individual rule files for detailed explanations, GOOD/BAD examples, and con
255256 "content" : " Thank You" ,
256257 "style" : {
257258 "font-size" : 80 , "color" : " #FFFFFF" , "font-weight" : " bold" , "text-align" : " center" ,
258- "animation" : {
259- "name" : " scale_in" ,
260- "duration" : 0.8 ,
261- "wiggle" : [
262- { "property" : " translate_y" , "amplitude" : 4 , "frequency" : 1.5 , "seed" : 7 }
263- ]
264- }
259+ "animation" : [
260+ { "name" : " scale_in" , "duration" : 0.8 },
261+ { "name" : " wiggle" , "property" : " translate_y" , "amplitude" : 4 , "frequency" : 1.5 , "seed" : 7 }
262+ ]
265263 }
266264 },
267265 {
@@ -270,13 +268,10 @@ Read individual rule files for detailed explanations, GOOD/BAD examples, and con
270268 "size" : { "width" : 64 , "height" : 64 },
271269 "style" : {
272270 "color" : " #F43F5E" ,
273- "animation" : {
274- "name" : " fade_in" ,
275- "delay" : 0.5 ,
276- "wiggle" : [
277- { "property" : " scale" , "amplitude" : 0.1 , "frequency" : 2 , "seed" : 42 }
278- ]
279- }
271+ "animation" : [
272+ { "name" : " fade_in" , "delay" : 0.5 },
273+ { "name" : " wiggle" , "property" : " scale" , "amplitude" : 0.1 , "frequency" : 2 , "seed" : 42 }
274+ ]
280275 }
281276 }
282277 ]
@@ -390,52 +385,43 @@ All components are discriminated by `"type"`. Rendered in array order (first = b
390385| ` opacity ` | f32 | ` 1.0 ` | 0.0 to 1.0 |
391386| ` padding ` | f32 or {top,right,bottom,left} | ` null ` | Inner spacing |
392387| ` margin ` | f32 or {top,right,bottom,left} | ` null ` | Outer spacing |
393- | ` glow ` | object | ` null ` | Luminous halo effect |
394- | ` animation ` | object | ` null ` | Animation config (see Animation section) |
388+ | ` animation ` | array or object | ` [] ` | Animation effects array (see below) |
395389
396390#### Animation Style (inside ` "style" ` )
397391
398- All animation configuration lives under ` style.animation ` :
392+ ` style.animation ` is a ** typed array ** of animation effects, each discriminated by ` "name" ` . A single effect (without array) is also accepted.
399393
400394``` json
401395{
402396 "style" : {
403- "animation" : {
404- "name" : " fade_in_up" ,
405- "delay" : 0.2 ,
406- "duration" : 0.8 ,
407- "loop" : false ,
408- "keyframes" : [],
409- "wiggle" : [],
410- "motion_blur" : null
411- }
397+ "animation" : [
398+ { "name" : " fade_in_up" , "delay" : 0.2 , "duration" : 0.8 },
399+ { "name" : " glow" , "color" : " #6366F1" , "radius" : 20 , "intensity" : 2.0 },
400+ { "name" : " wiggle" , "property" : " translate_y" , "amplitude" : 5 , "frequency" : 0.8 , "seed" : 42 }
401+ ]
412402 }
413403}
414404```
415405
406+ ** Effect types:**
407+
408+ | Effect name | Fields | Description |
409+ | --- | --- | --- |
410+ | * preset name* | ` delay ` , ` duration ` , ` loop ` | Any of the 31 presets (e.g. ` fade_in_up ` , ` scale_in ` ) |
411+ | ` glow ` | ` color ` , ` radius ` , ` intensity ` | Luminous halo effect |
412+ | ` wiggle ` | ` property ` , ` amplitude ` , ` frequency ` , ` mode ` , ` seed ` , ... | Procedural noise animation |
413+ | ` keyframes ` | ` keyframes ` , ` delay ` , ` duration ` | Custom keyframe animations |
414+ | ` motion_blur ` | ` intensity ` | Motion blur effect |
415+
416+ ** Preset fields:**
417+
416418| Field | Type | Default | Description |
417419| --- | --- | --- | --- |
418- | ` name ` | string | ` null ` | Animation preset name (e.g. ` "fade_in_up" ` ) |
419420| ` delay ` | f64 | ` 0 ` | Delay before animation starts (seconds) |
420421| ` duration ` | f64 | ` 0.8 ` | Animation duration (seconds) |
421422| ` loop ` | bool | ` false ` | Loop the animation continuously |
422- | ` keyframes ` | array | ` [] ` | Custom keyframe animations |
423- | ` wiggle ` | array | ` null ` | Procedural noise-based animation |
424- | ` motion_blur ` | f32 | ` null ` | Motion blur intensity |
425423
426- #### Glow Effect
427-
428- ``` json
429- {
430- "style" : {
431- "glow" : {
432- "color" : " #5C39EE" ,
433- "radius" : 20 ,
434- "intensity" : 2.0
435- }
436- }
437- }
438- ```
424+ ** Glow fields:**
439425
440426| Field | Type | Default | Description |
441427| --- | --- | --- | --- |
@@ -819,18 +805,21 @@ Code block with syntax highlighting, chrome, reveal animations, and animated dif
819805``` json
820806{
821807 "style" : {
822- "animation" : {
823- "keyframes" : [
824- {
825- "property" : " opacity" ,
826- "keyframes" : [
827- { "time" : 0.0 , "value" : 0.0 },
828- { "time" : 0.5 , "value" : 1.0 }
829- ],
830- "easing" : " ease_out"
831- }
832- ]
833- }
808+ "animation" : [
809+ {
810+ "name" : " keyframes" ,
811+ "keyframes" : [
812+ {
813+ "property" : " opacity" ,
814+ "keyframes" : [
815+ { "time" : 0.0 , "value" : 0.0 },
816+ { "time" : 0.5 , "value" : 1.0 }
817+ ],
818+ "easing" : " ease_out"
819+ }
820+ ]
821+ }
822+ ]
834823 }
835824}
836825```
@@ -854,7 +843,7 @@ See Rule 13 for usage guidance.
854843``` json
855844{
856845 "style" : {
857- "animation" : { "name" : " fade_in_up" , "delay" : 0.2 , "duration" : 0.8 , "loop" : false }
846+ "animation" : [ { "name" : " fade_in_up" , "delay" : 0.2 , "duration" : 0.8 , "loop" : false }]
858847 }
859848}
860849```
@@ -870,28 +859,27 @@ See Rule 13 for usage guidance.
870859
871860#### Wiggle (Procedural Noise)
872861
873- See Rule 12 for combining with presets.
862+ See Rule 12 for combining with presets. Wiggle is an animation effect with ` "name": "wiggle" ` in the ` style.animation ` array.
874863
875864``` json
876865{
877866 "style" : {
878- "animation" : {
879- "wiggle" : [
880- { "property" : " translate_x" , "amplitude" : 5 , "frequency" : 3 , "seed" : 42 },
881- { "property" : " rotation" , "amplitude" : 8 , "frequency" : 4 , "seed" : 13 , "decay" : 0.6 }
882- ]
883- }
867+ "animation" : [
868+ { "name" : " wiggle" , "property" : " translate_x" , "amplitude" : 5 , "frequency" : 3 , "seed" : 42 },
869+ { "name" : " wiggle" , "property" : " rotation" , "amplitude" : 8 , "frequency" : 4 , "seed" : 13 , "decay" : 0.6 }
870+ ]
884871 }
885872}
886873```
887874
888875| Field | Type | Default | Description |
889876| --- | --- | --- | --- |
890877| ` property ` | string | required | Property to wiggle (same as animatable properties) |
891- | ` amplitude ` | f64 | required | Maximum deviation |
892- | ` frequency ` | f64 | required | Oscillations per second |
893- | ` seed ` | u64 | ` 0 ` | Random seed for reproducible results |
894- | ` octaves ` | u32 | ` 3 ` | Noise complexity |
878+ | ` amplitude ` | f64 | required | Maximum deviation (pixels for translate, degrees for rotation) |
879+ | ` frequency ` | f64 | required | Cycles per second (Hz). 0.8 = gentle float, 3 = wobble, 90 = vibration |
880+ | ` mode ` | string | ` "noise" ` | ` "noise" ` (layered simplex) or ` "sine" ` (pure sine wave) |
881+ | ` seed ` | u64 | ` 0 ` | Random seed for reproducible results (noise mode only) |
882+ | ` octaves ` | u32 | ` 3 ` | Noise complexity (noise mode only) |
895883| ` phase ` | f64 | ` 0.0 ` | Phase offset |
896884| ` decay ` | f64 | ` null ` | Exponential decay rate |
897885| ` easing ` | string | ` null ` | Remap noise through an easing curve |
0 commit comments