Skip to content

Commit 7ee4271

Browse files
docs(skills): switch entrance examples to gsap.fromTo()
transitions/overview.md rule #2 and gsap-easing-and-stagger.md stagger examples used gsap.from({opacity: 0}), which contradicts the "prefer fromTo() for entrances" guidance in gsap-timeline-and-labels.md, motion-principles.md, and sub-compositions.md. The inconsistency teaches agents the from() pattern, which becomes a 0→0 noop (all-black render) when paired with CSS opacity: 0 — exactly the case PR #1001 adds an error-level lint rule for. Aligning all 5 skill files on fromTo().
1 parent d595b82 commit 7ee4271

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

skills/hyperframes-animation/adapters/gsap-easing-and-stagger.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,30 @@ Setting defaults at timeline scope is preferred — it documents the motion lang
3838
## Stagger
3939

4040
```javascript
41-
gsap.from(".item", { y: 24, opacity: 0, duration: 0.5, stagger: 0.08 });
41+
gsap.fromTo(".item", { y: 24, opacity: 0 }, { y: 0, opacity: 1, duration: 0.5, stagger: 0.08 });
4242
```
4343

4444
Object form:
4545

4646
```javascript
47-
gsap.from(".item", {
48-
y: 24,
49-
opacity: 0,
50-
stagger: {
51-
each: 0.08, // delay between each
52-
from: "center", // "start" | "end" | "center" | "edges" | "random" | index
53-
amount: 0.6, // total stagger time (overrides each if both set)
54-
grid: "auto", // for 2D stagger
55-
axis: "x" | "y",
47+
gsap.fromTo(
48+
".item",
49+
{ y: 24, opacity: 0 },
50+
{
51+
y: 0,
52+
opacity: 1,
53+
stagger: {
54+
each: 0.08, // delay between each
55+
from: "center", // "start" | "end" | "center" | "edges" | "random" | index
56+
amount: 0.6, // total stagger time (overrides each if both set)
57+
grid: "auto", // for 2D stagger
58+
axis: "x" | "y",
59+
},
5660
},
57-
});
61+
);
5862
```
5963

60-
Prefer `stagger` over N separate tweens with manual delays — it stays correct when the target count or order changes.
64+
Prefer `stagger` over N separate tweens with manual delays — it stays correct when the target count or order changes. Use `fromTo()` rather than `from()` so the start state is explicit (see `gsap-timeline-and-labels.md` → sub-composition entrances).
6165

6266
## Function-Based Values
6367

skills/hyperframes-animation/transitions/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ A transition tells the viewer how two scenes relate. A crossfade says "this cont
1919
These are non-negotiable for every multi-scene composition:
2020

2121
1. **Every composition uses transitions.** No exceptions. Scenes without transitions feel like jump cuts.
22-
2. **Every scene uses entrance animations.** Elements animate IN via `gsap.from()` — opacity, position, scale, etc. No scene should pop fully-formed onto screen.
22+
2. **Every scene uses entrance animations.** Elements animate IN — opacity, position, scale, etc. No scene should pop fully-formed onto screen. Use `gsap.fromTo()` (not `gsap.from()`) so the start state is explicit: `from()` animates _to_ current CSS, so pairing it with CSS `opacity: 0` is a 0→0 noop and the element never appears (see `/hyperframes-core` → sub-compositions).
2323
3. **Exit animations are BANNED** except on the final scene. Do NOT use `gsap.to()` to animate elements out before a transition fires. The transition IS the exit. Outgoing scene content must be fully visible when the transition starts — the transition handles the visual handoff.
2424
4. **Final scene exception:** The last scene MAY fade elements out (e.g., fade to black at the end of the composition). This is the only scene where exit animations are allowed.
2525

0 commit comments

Comments
 (0)