Skip to content

Commit dac2606

Browse files
committed
feat: move to animation
1 parent 3ba59a9 commit dac2606

38 files changed

Lines changed: 2537 additions & 5359 deletions

.claude/skills/rustmotion/SKILL.md

Lines changed: 105 additions & 96 deletions
Large diffs are not rendered by default.

.claude/skills/rustmotion/rules/card-flex-layout.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,12 @@ Key patterns:
3333
- **Auto-height:** `"size": { "width": 800, "height": "auto" }`
3434
- **Grid:** `"display": "grid"` + `"grid-template-columns"`
3535

36-
Children WITHOUT a `position` field participate in flex flow. Children WITH a `position` field become absolutely positioned within the card.
36+
Children flow in the flexbox. Use `positioned` container for absolute positioning.
3737

3838
**GOOD** (icon + text row):
3939
```json
4040
{
4141
"type": "card",
42-
"position": { "x": 140, "y": 800 },
4342
"size": { "width": 800, "height": "auto" },
4443
"style": {
4544
"flex-direction": "row",

.claude/skills/rustmotion/rules/counter-standalone.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"type": "counter",
1919
"from": 0,
2020
"to": 100,
21-
"position": { "x": 540, "y": 960 },
2221
"start_at": 0.5,
2322
"end_at": 2.5,
2423
"easing": "ease_out",

.claude/skills/rustmotion/rules/stagger-animations.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Rule: Stagger Animations with preset_config.delay
1+
# Rule: Stagger Animations with style.animation.delay
22

3-
To create sequential entrance effects (items appearing one by one), use `preset_config.delay` with increasing values. Use 0.15–0.3s increments for smooth staggering.
3+
To create sequential entrance effects (items appearing one by one), use `style.animation.delay` with increasing values. Use 0.15–0.3s increments for smooth staggering.
44

55
**GOOD:**
66
```json
77
[
8-
{ "type": "text", "content": "First", "position": { "x": 540, "y": 400 }, "preset": "fade_in_up", "preset_config": { "delay": 0.0, "duration": 0.6 }, "style": { "font-size": 48, "color": "#FFFFFF" } },
9-
{ "type": "text", "content": "Second", "position": { "x": 540, "y": 500 }, "preset": "fade_in_up", "preset_config": { "delay": 0.2, "duration": 0.6 }, "style": { "font-size": 48, "color": "#FFFFFF" } },
10-
{ "type": "text", "content": "Third", "position": { "x": 540, "y": 600 }, "preset": "fade_in_up", "preset_config": { "delay": 0.4, "duration": 0.6 }, "style": { "font-size": 48, "color": "#FFFFFF" } }
8+
{ "type": "text", "content": "First", "style": { "font-size": 48, "color": "#FFFFFF", "animation": { "name": "fade_in_up", "delay": 0.0, "duration": 0.6 } } },
9+
{ "type": "text", "content": "Second", "style": { "font-size": 48, "color": "#FFFFFF", "animation": { "name": "fade_in_up", "delay": 0.2, "duration": 0.6 } } },
10+
{ "type": "text", "content": "Third", "style": { "font-size": 48, "color": "#FFFFFF", "animation": { "name": "fade_in_up", "delay": 0.4, "duration": 0.6 } } }
1111
]
1212
```
1313

.claude/skills/rustmotion/rules/wiggle-additive.md

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
# Rule: Wiggle Is Additive
22

3-
Wiggle offsets apply additively on top of keyframe animations and presets. Combine a preset entrance with wiggle for ongoing procedural motion.
3+
Wiggle offsets apply additively on top of keyframe animations and presets. Combine a preset entrance with wiggle for ongoing procedural motion. Both are configured inside `style.animation`.
44

55
**GOOD** (fade in, then gently float):
66
```json
77
{
88
"type": "text",
99
"content": "Floating text",
10-
"position": { "x": 540, "y": 960 },
11-
"preset": "fade_in_up",
12-
"preset_config": { "delay": 0.2, "duration": 0.8 },
13-
"wiggle": [
14-
{ "property": "translate_y", "amplitude": 5, "frequency": 2, "seed": 42 }
15-
],
16-
"style": { "font-size": 48, "color": "#FFFFFF" }
10+
"style": {
11+
"font-size": 48, "color": "#FFFFFF",
12+
"animation": {
13+
"name": "fade_in_up",
14+
"delay": 0.2,
15+
"duration": 0.8,
16+
"wiggle": [
17+
{ "property": "translate_y", "amplitude": 5, "frequency": 2, "seed": 42 }
18+
]
19+
}
20+
}
1721
}
1822
```
1923

@@ -22,13 +26,16 @@ Wiggle offsets apply additively on top of keyframe animations and presets. Combi
2226
{
2327
"type": "icon",
2428
"icon": "lucide:phone-off",
25-
"position": { "x": 540, "y": 960 },
26-
"preset": "scale_in",
27-
"wiggle": [
28-
{ "property": "translate_x", "amplitude": 12, "frequency": 90, "mode": "sine" },
29-
{ "property": "rotation", "amplitude": 8, "frequency": 75, "mode": "sine" }
30-
],
31-
"style": { "size": 64, "color": "#FFFFFF" }
29+
"style": {
30+
"size": 64, "color": "#FFFFFF",
31+
"animation": {
32+
"name": "scale_in",
33+
"wiggle": [
34+
{ "property": "translate_x", "amplitude": 12, "frequency": 90, "mode": "sine" },
35+
{ "property": "rotation", "amplitude": 8, "frequency": 75, "mode": "sine" }
36+
]
37+
}
38+
}
3239
}
3340
```
3441

examples/codeblock.json

Lines changed: 0 additions & 113 deletions
This file was deleted.

0 commit comments

Comments
 (0)