npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@anvpx/motion-scenes

v0.1.94

Published

Scene registry and browser renderer for @anvpx/motion storyboards.

Readme

@anvpx/motion-scenes

Scene plugins (ScenePlugin from @anvpx/motion-schema) and the shared browser runtime. Base scenes: title, bullets, stat, flow, outro. Overlay scenes: lower-third, bug, progress, countdown, chapter.

  • sceneRegistry / getScene(type) / sceneTypes: build consumes only this barrel.
  • runtimeFiles(): shared modules (runtime/easing.js, timeline.js, mount.js), emitted once by build.
  • emit(entry, ctx) returns, per scene id: scenes/<id>/fragment.html, style.css, scene.js.

Fragment root is <section id="scene-<id>"> without a clip class; build wraps timing.

Add a scene

  1. New folder src/scenes/<type>/ with index.ts, style.css, scene.js, index.test.ts.
  2. Build the plugin with defineScene (type, configSchema, meta, style, script, render); run describeSceneContract in its test.
  3. Add one import and one entry to the plugins list in src/registry.ts.
  4. Run mk catalog --write to refresh the root CATALOG.md (a test fails on drift).

Overlay scenes

An overlay is a transparent layer above the base timeline (layer: "overlay" on the storyboard entry; the plugin declares layer: "overlay" in defineScene). The root has no background, ignores pointer events and keeps the 5 % safe margin as padding, so content stays inside 90 % of the frame.

Catalog metadata

Each scene passes meta: { purpose, example } to defineScene: a one-line purpose and the smallest props object that passes the schema. sceneDocs() derives everything else (layer, fields, required/optional, types, enums, defaults) from configSchema via z.toJSONSchema, so the schema stays the single source of truth. mk catalog and the generated CATALOG.md at the repo root consume it. Cross-field rules (for example bug: exactly one of text or image) are not derivable; state them in purpose.

Flow layout

flow sizes its cards from the label text with a deterministic width estimate (scenes/flow/measure.ts, no font loading): labels wrap only at spaces, into at most two lines, and a word is never broken; a card widens for a long word and the text steps down lg -> md -> sm (theme steps, so always >= 28 px) before it is declared crowded. Edge labels sit on or beside their own edge and slide along it (then to either side) until they clear every card, earlier label and other edge; the room between layers is 2.2x the longest label. planFlow is the single layout; the scene renders it and inspectFlow (exported) feeds the lint rules below.

Runtime contract

createScene(root, config, ctx) returns { seek(t), dispose(), ready }. seek(t) is a pure function of t. Config falls back to data-* attributes on the root (ease, move, focus, fps, duration). Browser code is plain ES modules (// @ts-check plus JSDoc), shipped as text. No requestAnimationFrame, Date.now or unseeded random.

Theme and text rules

CSS uses only --mk-* custom properties from @anvpx/motion-themes; text is at least 28 px and uses one theme font family; at most 40 on-screen words per scene (limitWords). Props are strict (unknown keys rejected).

Shared helpers

src/shared/ holds the helpers every scene reuses (one implementation, no per-scene copies): staggerStart/staggerDuration (offset always < item duration), countUp (ease-out, exact end), progress/scale/lerp/clamp, wipe, drawOn, revealTimings/revealProgress (word by word), fmt (locale-free tabular numbers: unit, decimals, sign, compact), fitText (deterministic width estimate, balanced wrap, never breaks a word, last line >= 35 % of the widest), sceneIcon (config error with the prop pointer and 3 suggestions), and esc/accentHtml ([x] accent markup; every character escaped, only <span class="accent"> is emitted). motion.js and format.js are plain browser ES modules (they import runtime/easing.js); emitting them next to runtime/ is wired by the first scene that needs them. @anvpx/motion-assets (a leaf) is imported only by shared/icon.ts.