PlaygroundZero dependencies, coming to npm

Sochen Motion

Anime speed lines, impact frames, title slams, dithered skies and film grain. Each frame depends only on time, options and a seed, so what you scrub on a page is exactly what renders in video.

frame 1 / 144 · 24 fps

Showreel

  • Seekable

    Any frame renders on its own: scrub, jump, play backwards.

  • Deterministic

    A pure function of time, options and a seed. Same input, same frame.

  • Zero dependencies

    Plain TypeScript, ESM, no animation engine underneath.

  • Playground

    Try every effect and its options right here, free.

The effects

Drag a scrub bar back and forth: every frame comes back exactly the same, because no effect reads the clock. Type your own headline or add your logo (it stays in your browser), turn the knobs, then copy the code or a link to what you made.

Made for video: pause any card and step it one frame at a time with ‹ ›. Those are the exact frames a video renderer captures.

frame 1 / 58 · 24 fps

Speed lines

Ink streaks in a band behind the card's trailing edge, only while it slides in. Three seeded drawings swap 8 times a second.

See the code
import { speedLines, timeline } from "@sochen/motion";

const stage = document.querySelector("#stage");
// A layer under the card; the lines stay in a band behind its trailing edge.
const lines = speedLines.mount(stage.querySelector(".under-card"), {
  count: 22,
  wedge: 1.1,
  opacity: 0.6,
  boilFps: 8,
  angle: 0,
  region: { x: 0.12, y: 0.55, w: 0.33, h: 0.26 },
  seed: 7,
});
const tl = timeline({ duration: 2.4 }).add(lines);

// Any frame, in any order: tl.seek(0.5). Or play it:
tl.player().play();
frame 1 / 58 · 24 fps

Impact frame

The build flips to passing: one inverted frame on the CI panel alone, held a frame, then a 6 px shake that dies in five frames.

See the code
import { impactFrame, timeline } from "@sochen/motion";

const stage = document.querySelector("#stage");
// The inverted frame and the shake land on the CI panel, not the stage.
const hit = impactFrame.mount(stage, {
  invertTarget: ".ci-panel",
  invertFrames: 1,
  whiteFrames: 0,
  holdFrames: 1,
  shake: 6,
  shakeFrames: 5,
  decay: 0.6,
  seed: 3,
});
const tl = timeline({ duration: 2.4 }).add(hit, 1);

// Any frame, in any order: tl.seek(0.5). Or play it:
tl.player().play();
frame 1 / 58 · 24 fps

Snap zoom

The chip lands from 1.25× in two held frames and kicks 3 px. Then a gold line draws on under it and boils.

See the code
import { snapZoom, timeline } from "@sochen/motion";

const stage = document.querySelector("#stage");
const chip = stage.querySelector(".version-chip");
// Lands in held frames and kicks; no fringe, no flash.
const snap = snapZoom.mount(chip, { from: 1.25, frames: 2, kick: 3, ease: "ease-out" });
const tl = timeline({ duration: 2.4 }).add(snap, 0.4);

// Any frame, in any order: tl.seek(0.5). Or play it:
tl.player().play();
frame 1 / 77 · 24 fps

Flash cut + light leak

A cut under a single frame of paper-white brings a close crop of one line over the page. Then a gold leak crosses the page, and only the page.

See the code
import { flashCut, lightLeak, timeline } from "@sochen/motion";

const stage = document.querySelector("#stage");
// Style the shots with [data-shot="a"] and [data-shot="b"] on the stage.
const cut = flashCut.mount(stage, { frames: 1, fadeFrames: 2, color: "#fbf7f0" });
// The leak crosses the page's box only.
const leak = lightLeak.mount(stage, {
  duration: 0.9,
  color: "#e8a33d",
  width: 0.24,
  opacity: 0.5,
  blend: "multiply",
  region: { x: 0.47, y: 0.07, w: 0.4, h: 0.93 },
});
const tl = timeline({ duration: 3.2 }).add(cut, 1.2).add(leak, 1.75);

// Any frame, in any order: tl.seek(0.5). Or play it:
tl.player().play();
frame 1 / 96 · 24 fps

Dithered sky

A night ramp dithered with an 8 × 8 Bayer matrix, a crescent moon and a few stars, drawn on a monitor's screen under its scanlines.

See the code
import { ditherSky, timeline } from "@sochen/motion";

const stage = document.querySelector("#stage");
// The sky fills the monitor's screen element, at a fixed art size scaled up in whole pixels.
const sky = ditherSky.mount(stage.querySelector(".screen"), {
  timeOfDay: "night",
  matrix: 8,
  width: 56,
  height: 42,
  sunX: 0.74,
  sunY: 0.3,
  sunRadius: 4,
  halo: 0,
  stars: 0.0075,
  seed: 5,
});
const tl = timeline({ duration: 4 }).add(sky);

// Any frame, in any order: tl.seek(0.5). Or play it:
tl.player().play();
frame 1 / 72 · 24 fps

Grain

Dark specks on the printed photo only, swapped 8 times a second, so the print has tooth and the page stays flat.

See the code
import { grain, timeline } from "@sochen/motion";

const stage = document.querySelector("#stage");
// On the printed photo itself: the texture belongs to the print, not the frame.
const print = grain.mount(stage.querySelector(".receipt-photo"), { amount: 0.14, size: 1, stepFps: 8, tone: "dark", seed: 2 });
const tl = timeline({ duration: 3 }).add(print);

// Any frame, in any order: tl.seek(0.5). Or play it:
tl.player().play();
frame 1 / 144 · 24 fps

Drifters

Paper scraps fall above the stack of notes and disappear into it. The loop has no seam.

See the code
import { drifters, timeline } from "@sochen/motion";

const stage = document.querySelector("#stage");
// Only above the notes, down to the front card's top edge.
const scraps = drifters.mount(stage, {
  shape: "scrap",
  count: 12,
  size: 1.2,
  windX: 6,
  windY: 60,
  sway: 10,
  spin: 30,
  colors: { 0: "#ffffff" },
  stroke: "#645d54",
  strokeWidth: 1.6,
  region: { x: 0.45, y: 0, w: 0.48, h: 0.31 },
  loop: 6,
  seed: 4,
});
const tl = timeline({ duration: 6 }).add(scraps);

// Any frame, in any order: tl.seek(0.5). Or play it:
tl.player().play();
frame 1 / 86 · 24 fps

Kinetic type

The reminder types on behind a caret, two characters a step, then an underline wipes in under the three words that matter.

See the code
import { kineticType, timeline } from "@sochen/motion";

const stage = document.querySelector("#stage");
const line = stage.querySelector(".outbox-line");
const words = kineticType.mount(line, {
  text: "Reminder sent to Okafor & Daughters — invoice 0417, 9 days late.",
  mode: "type",
  charsPerStep: 2,
  stepFps: 24,
  underline: "#8a5a1c",
  underlineThickness: 0.12,
  mark: "9 days late",
});
const tl = timeline({ duration: 3.6 }).add(words, 0.3);

// Any frame, in any order: tl.seek(0.5). Or play it:
tl.player().play();

Made for video

Most web effects run on the wall clock: they look right live and come out wrong when a renderer captures a page one frame at a time. These don’t. Each effect has a pure frame(t, options) that returns SVG, pixels or style values, and a mount(el, options) that gives you seek(t).

Drawings hold “on twos”, the way hand-drawn animation does: speed lines boil between three seeded drawings, grain swaps plates, type steps on. One seeded random source drives all of it, and the package has a test that fails if anything reads the time or an unseeded random number.

A tiny timeline() puts effects at times and seeks them together, with a play/pause player for the page and a window.__timelines hook for frame-capture renderers.

A timeline, for the page or a frame-capture renderer
import { impactFrame, registerTimeline, speedLines, timeline } from "@sochen/motion";

const stage = document.querySelector("#stage");
const tl = timeline({ duration: 3 })
  // Streaks in a band behind the card, and the hit on the card alone.
  .add(speedLines.mount(stage, { region: { x: 0.12, y: 0.55, w: 0.33, h: 0.26 }, seed: 7 }))
  .add(impactFrame.mount(stage, { invertTarget: ".card" }), 0.5); // lands at 0.5 s

// Frame-capture renderers such as HyperFrames seek window.__timelines.main once per frame.
registerTimeline(tl, "main");
Remotion
import { AbsoluteFill, useCurrentFrame, useVideoConfig } from "remotion";
import { speedLines } from "@sochen/motion";

export function LinesBehindCard() {
  const frame = useCurrentFrame();
  const { fps, width, height } = useVideoConfig();
  // A pure function of time: the same frame every render, in any order.
  // Streaks in a band behind the card's trailing edge, not across the frame.
  const svg = speedLines.frame(frame / fps, {
    width,
    height,
    region: { x: 0.12, y: 0.55, w: 0.33, h: 0.26 },
    seed: 7,
  });
  return <AbsoluteFill dangerouslySetInnerHTML={{ __html: svg }} />;
}

Where it comes from

Sochen’s video studio uses these effects to make launch videos from your product screenshots and brand.

The library is free and stays free. The studio is where Sochen exports the video, on your credits: each render is priced before it runs, about 6 credits for a 15-second video. Try the studio.

Just one launch video? The launch pack is $15, paid once.

One launch video of your product, made from your website, in 9:16, 16:9 and 1:1, with 4 stills and a share image, and no “Made with Sochen” card. No credits needed, and nothing renews. See the launch pack.