W

waapi

by @heygen-comv
4.6(120)

HyperFrames (ハイパーフレームズ) 向けの Web Animations API (WAAPI) アダプターパターン。`element.animate()` モーション、`Animation currentTime` シーキング、`document.getAnimations()`、`KeyframeEffect` タイミング、フィルモード、または HyperFrames で決定論的 (けっていろんてき) にレンダリングする必要があるネイティブブラウザアニメーションを作成する際に使用します。

web-animationsfrontendanimationjavascriptGitHub
インストール方法
git clone https://github.com/heygen-com/hyperframes.git
compare_arrows

Before / After 効果比較

1
使用前

HyperFrames (ハイパーフレームズ) にブラウザのネイティブアニメーションを統合する際、`requestAnimationFrame` の手動管理や CSS アニメーションへの依存が必要となり、タイムラインとの同期問題や再生制御の不正確さが発生しがちです。単純なアニメーションのために GSAP のような大規模なライブラリを導入するのは過剰な場合があります。

使用後

WAAPI アダプターを使用することで、ブラウザネイティブの `element.animate()` アニメーションを HyperFrames のタイムラインに正確に同期させることができます。これにより、複雑な同期ロジックが不要になり、大規模な外部アニメーションライブラリへの依存を減らし、開発効率とアニメーションパフォーマンスを向上させながら、決定論的なレンダリングと正確なシークを実現します。

SKILL.md

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

ユーザーレビュー (0)

レビューを書く

効果
使いやすさ
ドキュメント
互換性

レビューなし

統計データ

インストール数36.7K
評価4.6 / 5.0
バージョン
更新日2026年5月23日
比較事例1 件

ユーザー評価

4.6(120)
5
37%
4
43%
3
13%
2
5%
1
2%

この Skill を評価

0.0

対応プラットフォーム

🤖claude-code

タイムライン

作成2026年5月8日
最終更新2026年5月23日