
Lottie
Wire lottie-web and dotLottie players into HyperFrames so exported motion graphics scrub deterministically on a timeline.
Overview
Lottie is an agent skill for the Build phase that embeds lottie-web and dotLottie players in HyperFrames compositions with seekable, non-autoplay animation instances.
Install
npx skills add https://github.com/heygen-com/hyperframes --skill lottieWhat is this skill?
- Documents HyperFrames `lottie` adapter contract: local assets, autoplay off, optional loop, `window.__hfLottie` registra
- Covers lottie-web (`goToAndStop`) and @lottiefiles/dotlottie-web seek APIs
- Includes copy-paste HTML/JS pattern for Bodymovin 5.12.2 with stable `.lottie-layer` dimensions
- Targets After Effects JSON and .lottie files under project `assets/` for reproducible seeks
- Registers every player on window.__hfLottie
- Documents lottie-web Bodymovin 5.12.2 CDN example
Adoption & trust: 61.4k installs on skills.sh; 25.6k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have After Effects Lottie exports but HyperFrames cannot scrub them unless players are configured and registered the way the lottie adapter expects.
Who is it for?
Indie builders composing HyperFrames scenes that mix vector logo reveals or UI motion from standard Lottie JSON or .lottie packs.
Skip if: Teams not using HyperFrames or projects that rely on autoplaying hero animations without timeline control.
When should I use this skill?
Embedding lottie-web JSON animations, .lottie files, @lottiefiles/dotlottie-web players, or registering instances on window.__hfLottie for HyperFrames.
What do I get? / Deliverables
You get working lottie-web or dotLottie layers that HyperFrames can seek by time, with instances collected on `window.__hfLottie` for the render pipeline.
- Lottie layer markup and init script
- CSS-stable animation container
- Registered __hfLottie player instances
Recommended Skills
Journey fit
How it compares
HyperFrames integration guidance for Lottie players—not a generic lottie-web tutorial outside a deterministic seek workflow.
Common Questions / FAQ
Who is lottie for?
Solo builders and small teams authoring HyperFrames browser compositions who need Bodymovin or dotLottie assets to scrub in sync with other runtime adapters.
When should I use lottie?
During Build when embedding `lottie.loadAnimation` or dotLottie players, setting `autoplay: false`, and registering animations on `window.__hfLottie` before export.
Is lottie safe to install?
Review the Security Audits panel on this Prism page and treat CDN script loads and local asset paths like any frontend dependency before agent execution.
SKILL.md
READMESKILL.md - Lottie
# Lottie for HyperFrames HyperFrames can seek both `lottie-web` and dotLottie players through its `lottie` runtime adapter. Lottie is a strong fit because the animation timeline is already encoded in the asset; HyperFrames only needs a player object it can seek. ## Contract - Load assets from local project files, usually under `assets/`. - Set `autoplay: false`. - Prefer `loop: false` unless the user explicitly wants a loop. - Register every returned animation or player on `window.__hfLottie`. - Keep the Lottie container dimensions stable with CSS. The adapter seeks `lottie-web` with `goToAndStop(timeMs, false)` and dotLottie with frame or percentage APIs depending on player shape. ## lottie-web Pattern ```html <div id="logo-lottie" class="lottie-layer"></div> <script src="https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.12.2/lottie.min.js"></script> <script> const anim = lottie.loadAnimation({ container: document.getElementById("logo-lottie"), renderer: "svg", loop: false, autoplay: false, path: "assets/logo-reveal.json", }); window.__hfLottie = window.__hfLottie || []; window.__hfLottie.push(anim); </script> ``` ```css .lottie-layer { width: 100%; height: 100%; } ``` ## dotLottie Pattern ```html <canvas id="product-lottie" class="lottie-canvas"></canvas> <script src="https://unpkg.com/@lottiefiles/dotlottie-web"></script> <script> const player = new DotLottie({ canvas: document.getElementById("product-lottie"), src: "assets/product-flow.lottie", autoplay: false, loop: false, }); window.__hfLottie = window.__hfLottie || []; window.__hfLottie.push(player); </script> ``` ```css .lottie-canvas { width: 100%; height: 100%; display: block; } ``` ## Multiple Animations Push each player into the same registry: ```js window.__hfLottie = window.__hfLottie || []; window.__hfLottie.push(backgroundAnim); window.__hfLottie.push(iconAnim); window.__hfLottie.push(confettiAnim); ``` HyperFrames seeks them all to the same composition time. ## Good Uses - After Effects exports that are already known to render correctly in lottie-web. - Logo reveals, icon loops, decorative accents, and product UI motion. - Translating Remotion Lottie usage into plain HyperFrames HTML. ## Avoid - Relying on remote `path` URLs at render time. - Starting playback with `play()`. - Assuming unsupported After Effects effects will survive export. Test the JSON or `.lottie` file in a browser first. - Loading a player asynchronously and registering it after HyperFrames validation has already inspected the page. ## Validation After editing a Lottie composition: ```bash npx hyperframes lint npx hyperframes validate ``` ## Credits And References - HyperFrames adapter source: `packages/core/src/runtime/adapters/lottie.ts`. - lottie-web by Airbnb: https://github.com/airbnb/lottie-web - lottie-web `loadAnimation` options: https://github.com/airbnb/lottie-web/wiki/loadAnimation-options - dotLottie web player methods by LottieFiles: https://developers.lottiefiles.com/docs/dotlottie-player/dotlottie-web/methods