FIG-001/ HOOK

one timeline, many motions.

useTime() returns a motion value of ms since the hook mounted. Derive position, rotation, scale, and colour from the same source — they all stay in lockstep because they share one clock.

  • useTime() ticks every frame from mount. Reading $time in a derived store re-runs the deriver on every update, so the orb's transform and colour update at display refresh rate.
  • Five independent derived stores feed one element — different periods (t / 1000 vs t / 1200) give Lissajous-style motion, but they're guaranteed in phase because they share the same clock.
  • Prefer useTransform over derived when you want motion's interpolation machinery (clamping, output ranges). For plain math, the svelte/store helper is more familiar and equally fast.
↩ all examples
pattern · time → derived mode · live running source
0s
category · hook
sheet · sheet 01 / 01
⟳ to re-run