Skip to content

Commit dc8cac4

Browse files
committed
refactor(registry): tidy gooey-split pose code and document sharp 0 limits
1 parent 5c1ba35 commit dc8cac4

3 files changed

Lines changed: 21 additions & 19 deletions

File tree

‎registry/blocks/gooey-split/gooey-split.html‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -801,13 +801,14 @@
801801
var spinOut = span(t, SPIN_OUT, swift);
802802
var angle = p.from + p.spinIn * spinIn + p.spinOut * spinOut;
803803
var radius = p.menuR * spread(t) + (ORBIT - p.menuR) * (spinIn - spinOut);
804+
var swollen = swell(t);
804805
return {
805806
x: radius * Math.cos(rad(angle)),
806807
y: radius * Math.sin(rad(angle)),
807808
turn: angle - (p.from + p.spinIn),
808809
rotation: angle,
809-
scaleX: 1 + SWELL_ACROSS * swell(t),
810-
scaleY: 1 + SWELL_ALONG * swell(t),
810+
scaleX: 1 + SWELL_ACROSS * swollen,
811+
scaleY: 1 + SWELL_ALONG * swollen,
811812
};
812813
}
813814

@@ -864,20 +865,17 @@
864865
tl.fromTo(el, from, to, 0);
865866
}
866867

868+
var MOVES = ["x", "y", "rotation", "scaleX", "scaleY"];
867869
PIECES.forEach(function (p, i) {
868-
drive(
869-
document.getElementById("gs-dot-" + i),
870-
["x", "y", "rotation", "scaleX", "scaleY"],
871-
function (t) {
872-
return piece(p, t);
873-
},
874-
);
870+
drive(document.getElementById("gs-dot-" + i), MOVES, function (t) {
871+
return piece(p, t);
872+
});
875873
var el = document.getElementById("gs-blade-" + i);
876874
var restAngle = p.from + p.spinIn;
877875
var rest = { x: ORBIT * Math.cos(rad(restAngle)), y: ORBIT * Math.sin(rad(restAngle)) };
878876
el.querySelector("path").setAttribute("d", bladePath(restAngle));
879877
el.style.transformOrigin = R_OUT + rest.x + "px " + (R_OUT + rest.y) + "px";
880-
drive(el, ["x", "y", "rotation", "scaleX", "scaleY"], function (t) {
878+
drive(el, MOVES, function (t) {
881879
return blade(p, rest, t);
882880
});
883881
});

‎registry/components/motion-blur/motion-blur.html‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
No single copy ever exceeds 1/N, so a moving edge resolves as a
3434
staircase of ghosts behind a solid frame-time instance. The group
3535
carries the element's own opacity, so a beat that moves and fades at
36-
once fades its smear with it.
36+
once fades its smear with it. With `sharp: 0` the element is hidden
37+
while it moves instead, leaving only the shutter average.
3738
4. When every sampled transform collapses to the current one (element at
3839
rest), the group is hidden so the element renders sharp.
3940
@@ -113,7 +114,10 @@
113114
(`hyperframes render --fps`).
114115
sharp — 1 (default) paints the element itself, crisp, over its
115116
smear; 0 hides it while it moves, leaving only the
116-
shutter average: a soft blur with no frame-time edge
117+
shutter average: a soft blur with no frame-time edge.
118+
At rest it restores the visibility the element had
119+
when blurred, so do not animate visibility (autoAlpha)
120+
on a sharp 0 target
117121
118122
A key that is none of the five, or a value that is not a finite number, is
119123
refused by name rather than read as defaults. Both halves matter: a

‎skills/hyperframes-animation/references/motion-blur.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ that is already in the document, use the attribute.
6161

6262
## Options
6363

64-
| Option | Default | Meaning |
65-
| ----------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
66-
| `shutterAngle` | 720 | Degrees of the frame interval the shutter is open. 720 is two frames, measured off a real After Effects export. 360 is one frame. 0 disables the smear |
67-
| `shutterPhase` | -360 | Degrees the window start sits from the frame time. -360 centres the window on the frame |
68-
| `samplesPerFrame` | 16 | Sub-intervals of the window, so this many plus one copies, each at 1 over this many opacity. Max 64 |
69-
| `fps` | the `data-fps` of the target's own composition root, else 30 | Composition frame rate. Pass it explicitly when rendering with an fps override |
70-
| `sharp` | 1 | 1 paints the element itself, crisp, over its smear. 0 hides it while it moves, leaving only the shutter average: a soft blur with no frame-time edge |
64+
| Option | Default | Meaning |
65+
| ----------------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
66+
| `shutterAngle` | 720 | Degrees of the frame interval the shutter is open. 720 is two frames, measured off a real After Effects export. 360 is one frame. 0 disables the smear |
67+
| `shutterPhase` | -360 | Degrees the window start sits from the frame time. -360 centres the window on the frame |
68+
| `samplesPerFrame` | 16 | Sub-intervals of the window, so this many plus one copies, each at 1 over this many opacity. Max 64 |
69+
| `fps` | the `data-fps` of the target's own composition root, else 30 | Composition frame rate. Pass it explicitly when rendering with an fps override |
70+
| `sharp` | 1 | 1 paints the element itself, crisp, over its smear. 0 hides it while it moves, leaving only the shutter average: a soft blur with no frame-time edge. Do not animate visibility (autoAlpha) on a sharp 0 target: at rest it restores the visibility it had when blurred |
7171

7272
A key that is none of these five, and a value that is not a finite number, are
7373
both refused by name rather than read as defaults. `{"shutterAngle": "720deg"}`

0 commit comments

Comments
 (0)