What to build
Extend the Timeline class in @termuijs/motion with three new capabilities. sync(subTimeline, offsetMs) locks a sub-timeline at a given millisecond offset. call(fn, atMs) fires a callback at an exact millisecond mark. alternate: true in loop options plays the timeline forward then backward in a ping-pong pattern. The timeline auto-requests live mode when playing and drops it on completion.
Acceptance criteria
- Synced timelines start at the correct offset
call(fn, 500) fires at 500ms
- Alternate loop reverses direction after the first pass
- Live mode is auto-managed
- Tests use
createVirtualClock from the testing package
Implementation notes
- Edit
packages/motion/src/timeline.ts
- Edit
packages/motion/src/timeline.test.ts
- Look at
packages/motion/src/ for patterns
Example usage
import { Timeline } from '@termuijs/motion';
const tl = new Timeline({ loop: true, alternate: true });
tl.add(box, { x: [0, 100] }, { duration: 500 });
tl.call(() => console.log('halfway'), 250);
const sub = new Timeline();
sub.add(label, { opacity: [0, 1] }, { duration: 200 });
tl.sync(sub, 100); // sub starts at 100ms into tl
tl.play();
GSSoC 2026
This is an intermediate-level issue. Comment "I would like to work on this" to get assigned. You have 7 days to open a PR after assignment.
Read CONTRIBUTING.md before starting.
What to build
Extend the
Timelineclass in@termuijs/motionwith three new capabilities.sync(subTimeline, offsetMs)locks a sub-timeline at a given millisecond offset.call(fn, atMs)fires a callback at an exact millisecond mark.alternate: truein loop options plays the timeline forward then backward in a ping-pong pattern. The timeline auto-requests live mode when playing and drops it on completion.Acceptance criteria
call(fn, 500)fires at 500mscreateVirtualClockfrom the testing packageImplementation notes
packages/motion/src/timeline.tspackages/motion/src/timeline.test.tspackages/motion/src/for patternsExample usage
GSSoC 2026
This is an intermediate-level issue. Comment "I would like to work on this" to get assigned. You have 7 days to open a PR after assignment.
Read CONTRIBUTING.md before starting.