PluginBench
Skill
Pass
Audit score 90

waapi

heygen-com/hyperframes

Web Animations API adapter for deterministic, seekable native browser animations in HyperFrames.

What is waapi?

Adapter patterns for using element.animate() with HyperFrames' timeline seeking. Use WAAPI when you need lightweight native keyframe animations that must render deterministically without GSAP or external animation libraries.

  • Create synchronous animations during composition initialization with element.animate()
  • Seek animations to specific currentTime values synchronized with HyperFrames timeline
  • Support finite durations, delays, offsets, and easing via native KeyframeEffect options
  • Pause animations after creation for deterministic rendering
  • Apply fill: "both" to persist seeked animation states
  • Stagger multiple animations using delay and index-based timing

How to install waapi

npx skills add https://github.com/heygen-com/hyperframes --skill waapi
Prerequisites
  • HyperFrames runtime environment
  • Basic understanding of Web Animations API (element.animate)
  • Knowledge of keyframe syntax and timing options
Claude Code
Cursor
Windsurf
Cline

How to use waapi

  1. 1.Create animations synchronously during composition initialization
  2. 2.Use element.animate() with finite duration and iterations
  3. 3.Set fill: "both" to persist seeked animation states
  4. 4.Call animation.pause() after creation or let the adapter pause on first seek
  5. 5.Use delay property to model clip-local start times relative to document timeline
  6. 6.For staggered animations, loop through elements and apply index-based delays

Use cases

Good for
  • Lightweight DOM motion sequences where CSS keyframes are too rigid
  • Generated animations from structured data or dynamic element lists
  • Simple timelines with keyframes, delays, and cubic-bezier easing
  • Staggered element entrance animations with calculated delays
  • Clip-based motion synchronized to HyperFrames document timeline
Who it's for
  • HyperFrames composition authors
  • Frontend developers avoiding GSAP dependencies
  • Teams building deterministic, seekable animations
  • Motion designers working with structured animation data

waapi FAQ

Can I use infinite iterations?

No. Avoid infinite iterations; use finite duration and iterations values only.

How do I synchronize animations to HyperFrames timeline?

The adapter calls document.getAnimations(), sets each animation's currentTime to HyperFrames time in milliseconds, then pauses it. Model clip offsets using delay or control element visibility with HyperFrames timing.

Should I use animation.finished promise for render-critical state?

No. Avoid depending on animation.finished or callbacks to mutate render-critical DOM. Keep state mutations outside animation callbacks.

Can I run requestAnimationFrame or timers alongside WAAPI animations?

No. Avoid running separate clocks with requestAnimationFrame, timers, or performance.now() as they conflict with HyperFrames' deterministic seeking.

What properties should I animate?

Prefer transforms and opacity. Avoid animating layout properties when transforms and opacity can express the motion.

Full instructions (SKILL.md)

Source of truth, from heygen-com/hyperframes.


name: waapi description: Web Animations API adapter patterns for HyperFrames. Use when authoring element.animate() motion, Animation currentTime seeking, document.getAnimations(), KeyframeEffect timing, fill modes, or native browser animations that must render deterministically in HyperFrames.

Web Animations API for HyperFrames

HyperFrames can seek Web Animations API animations through its waapi runtime adapter. WAAPI is useful when you want native browser keyframes with JavaScript-created timing and no GSAP dependency.

Contract

  • Create animations synchronously during composition initialization.
  • Use element.animate(...) with finite duration and iterations.
  • Use fill: "both" so seeked states persist.
  • Pause animations after creation or let the adapter pause them on first seek.
  • Avoid callbacks and promises for render-critical state.

The adapter calls document.getAnimations(), sets each animation's currentTime to HyperFrames time in milliseconds, then pauses it.

Basic Pattern

<div id="orb" class="clip orb" data-start="2" data-duration="3" data-track-index="2"></div>

<script>
  const orb = document.getElementById("orb");
  const animation = orb.animate(
    [
      { transform: "translate3d(-160px, 0, 0) scale(0.8)", opacity: 0 },
      { transform: "translate3d(0, 0, 0) scale(1)", opacity: 1, offset: 0.35 },
      { transform: "translate3d(120px, 0, 0) scale(1.08)", opacity: 1 },
    ],
    {
      duration: 3000,
      delay: 2000,
      easing: "cubic-bezier(0.2, 0, 0, 1)",
      fill: "both",
      iterations: 1,
    },
  );

  animation.pause();
</script>

Stagger Pattern

document.querySelectorAll(".token").forEach((token, index) => {
  const animation = token.animate(
    [
      { transform: "translateY(24px)", opacity: 0 },
      { transform: "translateY(0)", opacity: 1 },
    ],
    {
      duration: 620,
      delay: index * 80,
      easing: "cubic-bezier(0.2, 0, 0, 1)",
      fill: "both",
      iterations: 1,
    },
  );
  animation.pause();
});

Good Uses

  • Lightweight DOM motion where CSS keyframes are too rigid and GSAP is unnecessary.
  • Generated animations from structured data.
  • Simple timelines that can be represented as keyframes, delays, and offsets.

Avoid

  • Infinite iterations.
  • Depending on animation.finished to mutate render-critical DOM.
  • Running separate clocks with requestAnimationFrame, timers, or performance.now().
  • Animating layout properties when transforms and opacity can express the motion.
  • Assuming clip-local start time is automatic. WAAPI adapter seeks document-level animation time; model clip offsets with delay or create the animation on an element whose visibility is controlled by HyperFrames timing.

Validation

After editing a WAAPI composition:

npx hyperframes lint
npx hyperframes validate

Credits And References