Skip to content

Commit 8d7a577

Browse files
committed
fix(choreography): preserve spotlight fade easing
1 parent 11a986d commit 8d7a577

2 files changed

Lines changed: 27 additions & 8 deletions

File tree

lib/choreography/descriptors/spotlight.ts

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,28 @@ export const spotlightV1: AnimationDescriptor = {
147147
staticProps: { x: 0, y: 0, width: 100, height: 100, fill: 'rgba(0,0,0,{dimness})' },
148148
// The whole effect is wrapped in a motion.div that fades opacity 0→1 on
149149
// enter and →0 on exit. The source sets no explicit transition, so Motion
150-
// applies its default tween (300ms) — pinned here explicitly so a
151-
// non-Motion consumer (the exporter) reproduces the fade instead of
152-
// popping the spotlight on/off. This layer carries the canonical wrapper
153-
// fade; the border layer inherits its opacity so both fade out together.
150+
// applies its default 300ms tween with [0.25, 0.1, 0.35, 1] easing. Both
151+
// values are pinned here so consumers reproduce that implicit source
152+
// transition instead of selecting a different engine default. This layer
153+
// carries the canonical wrapper fade; the border layer inherits its
154+
// opacity so both fade out together.
154155
tracks: [
155-
{ property: 'opacity', from: 0, to: 1, durationMs: 300, phase: 'enter' },
156-
{ property: 'opacity', from: 1, to: 0, durationMs: 300, phase: 'exit' },
156+
{
157+
property: 'opacity',
158+
from: 0,
159+
to: 1,
160+
durationMs: 300,
161+
easing: { type: 'cubicBezier', points: [0.25, 0.1, 0.35, 1] },
162+
phase: 'enter',
163+
},
164+
{
165+
property: 'opacity',
166+
from: 1,
167+
to: 0,
168+
durationMs: 300,
169+
easing: { type: 'cubicBezier', points: [0.25, 0.1, 0.35, 1] },
170+
phase: 'exit',
171+
},
157172
],
158173
},
159174
],

tests/components/slide-renderer/motion-descriptor-adapter.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@ describe('resolveMotionLayer', () => {
3333
animate: { opacity: 1 },
3434
exit: {
3535
opacity: 0,
36-
transition: { opacity: { duration: 0.3 } },
36+
transition: {
37+
opacity: { duration: 0.3, ease: [0.25, 0.1, 0.35, 1] },
38+
},
39+
},
40+
transition: {
41+
opacity: { duration: 0.3, ease: [0.25, 0.1, 0.35, 1] },
3742
},
38-
transition: { opacity: { duration: 0.3 } },
3943
staticProps: { x: 0, y: 0, width: 100, height: 100, fill: 'rgba(0,0,0,0)' },
4044
});
4145
});

0 commit comments

Comments
 (0)