animejs
heygen-com/hyperframes
Anime.js adapter for deterministic, seek-driven animations in HyperFrames compositions.
What is animejs?
Integrates Anime.js into HyperFrames by making animations seek-driven rather than time-based. Use this when building Anime.js animations or timelines inside HyperFrames, or translating Anime.js examples into render-safe HTML compositions where HyperFrames controls the clock.
- Register Anime.js animations and timelines on window.__hfAnime for HyperFrames to seek
- Create animations with autoplay: false so HyperFrames owns the timeline
- Support both IIFE and ES module builds of Anime.js
- Seek animations deterministically via instance.seek(timeMs) in HyperFrames time
- Build timelines with sequential and offset animations using anime.timeline()
How to install animejs
npx skills add https://github.com/heygen-com/hyperframes --skill animejs- HyperFrames composition environment
- Anime.js library (via CDN or ES module)
How to use animejs
- 1.Create an Anime.js animation or timeline with autoplay: false
- 2.Register the instance on window.__hfAnime by pushing to the array
- 3.Use finite durations and loop counts; avoid infinite loops
- 4.Run npx hyperframes lint and npx hyperframes validate to verify the composition
- 5.HyperFrames will automatically seek the animation as the composition plays
Use cases
- Creating small SVG and DOM flourishes with compact Anime.js syntax
- Translating existing Anime.js examples into deterministic HyperFrames compositions
- Building multiple independent micro-animations and registering them together
- Animating DOM elements with easing and transforms in a composition-controlled timeline
- HyperFrames composition authors using Anime.js
- Developers porting Anime.js examples to HyperFrames
- Teams preferring Anime.js syntax for simple animations over GSAP
animejs FAQ
No. HyperFrames controls playback through seeking. Set autoplay: false and register on window.__hfAnime; the adapter handles the rest.
Avoid callbacks that mutate DOM based on wall-clock time, network state, or unseeded randomness. Callbacks must be deterministic and composition-safe.
Use GSAP for complex scene sequencing. Use Anime.js for small flourishes where its syntax is compact, or when specifically requested.
Create each animation or timeline with autoplay: false, then push each instance to window.__hfAnime. The adapter seeks all registered instances.
Run npx hyperframes lint and npx hyperframes validate after editing a composition that uses Anime.js.
Full instructions (SKILL.md)
Source of truth, from heygen-com/hyperframes.
name: animejs description: Anime.js adapter patterns for HyperFrames. Use when writing Anime.js animations or timelines inside HyperFrames compositions, registering animations on window.__hfAnime, making Anime.js seek-driven and deterministic, or translating Anime.js examples into render-safe HyperFrames HTML.
Anime.js for HyperFrames
HyperFrames can seek Anime.js instances through its animejs runtime adapter. The composition owns the animation objects; HyperFrames owns the clock.
Contract
- Create animations or timelines synchronously during composition initialization.
- Set
autoplay: falseso Anime.js does not advance on its own clock. - Register every returned animation or timeline on
window.__hfAnime. - Use finite durations and loop counts.
- Avoid callbacks that mutate DOM based on wall-clock time, network state, or unseeded randomness.
The adapter seeks every registered instance with instance.seek(timeMs), where timeMs is HyperFrames time in milliseconds.
Basic Pattern
<script src="https://cdn.jsdelivr.net/npm/animejs@4.0.2/lib/anime.iife.min.js"></script>
<script>
const anim = anime({
targets: ".mark",
translateX: 280,
rotate: "1turn",
opacity: [0, 1],
duration: 1200,
easing: "easeOutExpo",
autoplay: false,
});
window.__hfAnime = window.__hfAnime || [];
window.__hfAnime.push(anim);
</script>
Timeline Pattern
<script>
const tl = anime.timeline({
autoplay: false,
easing: "easeOutCubic",
});
tl.add({
targets: ".title",
translateY: [40, 0],
opacity: [0, 1],
duration: 650,
}).add(
{
targets: ".accent",
scaleX: [0, 1],
duration: 450,
},
250,
);
window.__hfAnime = window.__hfAnime || [];
window.__hfAnime.push(tl);
</script>
Module Builds
If you use an ES module build, the adapter does not care how the instance was created. It only needs the returned object to expose seek(), pause(), and preferably play():
<script type="module">
import { animate } from "https://cdn.jsdelivr.net/npm/animejs/+esm";
const anim = animate(".chip", {
x: "18rem",
duration: 900,
autoplay: false,
});
window.__hfAnime = window.__hfAnime || [];
window.__hfAnime.push(anim);
</script>
Good Uses
- Small SVG and DOM flourishes where Anime.js syntax is compact.
- Imported Anime.js examples that can be made seek-driven.
- Multiple independent micro-animations pushed into the same registry.
Use GSAP for complex scene sequencing unless the user specifically asks for Anime.js. GSAP is still the primary HyperFrames authoring path.
Avoid
- Leaving
autoplayat the Anime.js default. - Depending on
anime.runningauto-discovery instead of explicitwindow.__hfAnime.push(...). - Infinite loops. Compute a finite repeat count from the composition duration.
- Building animations in timers, promises, event handlers, or after async asset loads.
Validation
After editing a composition that uses Anime.js:
npx hyperframes lint
npx hyperframes validate
Credits And References
- HyperFrames adapter source:
packages/core/src/runtime/adapters/animejs.ts. - Anime.js documentation for
autoplay,pause(), andseek(): https://animejs.com/documentation/
Related skills
More from heygen-com/hyperframes and the wider catalog.
hyperframes
Router and entry skill for video authoring—renders video from HTML with intent-based workflow selection.
hyperframes-cli
CLI for HyperFrames video composition: scaffold, lint, validate, render locally or on AWS Lambda.
hyperframes-registry
Install and wire reusable blocks and components into HyperFrames compositions via registry.
remotion-to-hyperframes
Port existing Remotion (React) video compositions to HyperFrames HTML—one-way translation only.
hyperframes-media
Audio and media engine for HyperFrames: TTS, background music, sound effects, transcription, captions, and background removal.
gsap
GSAP animation reference for HyperFrames compositions with timelines, easing, and performance optimization.