Communitygithub.com

shengdabai/Tony-Claude-Code-Skills

Anime.js アダプターパターン for HyperFrames。Anime.js アニメーションやタイムラインを HyperFrames コンポジション内で記述する際、アニメーションを window.__hfAnime に登録し、シーク駆動かつ決定論的に動作させる場合、または Anime.js のサンプルをレンダリングセーフな HyperFrames HTML に変換する場合に使用します。

Tony-Claude-Code-Skills とは?

このスキルは、Anime.js アニメーションを HyperFrames ランタイムと統合するためのベストプラクティスとパターンを提供します。HyperFrames は独自のクロックでアニメーションをシーク駆動するため、Anime.js の autoplay を false に設定し、すべてのアニメーションインスタンスを window.__hfAnime 配列に明示的に登録する必要があります。これにより、HyperFrames の再生ヘッドが移動するたびに instance.seek(timeMs) が呼び出され、アニメーションが決定論的に動作します。シンプルなアニメーション、タイムライン、ES モジュールビルドに対応しており、SVG や DOM の装飾、インポート済みの Anime.js サンプルの変換に適しています。無限ループやタイマーによるアニメーション構築は避けるべきです。検証には npx hyperframes lint および npx hyperframes validate を使用します。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/shengdabai/Tony-Claude-Code-Skills/tree/HEAD/skills/hyperframes-animejs

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Anime.js for HyperFrames

HyperFrames は、animejs ランタイムアダプターを介して Anime.js インスタンスをシークできます。コンポジションがアニメーションオブジェクトを所有し、HyperFrames がクロックを管理します。

契約

  • コンポジションの初期化中に、アニメーションまたはタイムラインを同期的に作成します。
  • Anime.js が独自のクロックで進行しないよう、autoplay: false を設定します。
  • 返されたすべてのアニメーションまたはタイムラインを window.__hfAnime に登録します。
  • 有限の持続時間とループ回数を使用します。
  • 壁時計時間、ネットワーク状態、またはシードされていない乱数に基づいて DOM を変更するコールバックを避けます。

アダプターは、登録された各インスタンスに対して instance.seek(timeMs) を呼び出します。ここで timeMs は HyperFrames の時間(ミリ秒)です。

基本パターン

<script src="https://cdn.jsdelivr.net/npm/[email protected]/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>

タイムラインパターン

<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>

モジュールビルド

ES モジュールビルドを使用する場合、アダプターはインスタンスがどのように作成されたかを気にしません。必要なのは、返されたオブジェクトが seek()、pause()、およびできれば 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>

適切な使用例

  • Anime.js の構文がコンパクトな小さな SVG および DOM の装飾。
  • シーク駆動にできるインポート済みの Anime.js サンプル。
  • 同じレジストリにプッシュされる複数の独立したマイクロアニメーション。

複雑なシーンシーケンスには、ユーザーが特に Anime.js を要求しない限り、GSAP を使用してください。GSAP は依然として主要な HyperFrames オーサリングパスです。

避けるべきこと

  • autoplay を Anime.js のデフォルトのままにすること。
  • 明示的な window.__hfAnime.push(...) ではなく、anime.running の自動検出に依存すること。
  • 無限ループ。コンポジションの時間から有限の繰り返し回数を計算してください。
  • タイマー、プロミス、イベントハンドラー、または非同期アセット読み込み後のアニメーション構築。

検証

Anime.js を使用するコンポジションを編集した後:

npx hyperframes lint
npx hyperframes validate

クレジットと参考情報

  • HyperFrames アダプターのソース: packages/core/src/runtime/adapters/animejs.ts。
  • Anime.js ドキュメント(autoplay、pause()、seek() について): https://animejs.com/documentation/

Individual skills in this repo

This repo contains 8 individual skills — each has its own dedicated page.

shengdabai/Tony-Claude-Code-Skills

Downloads videos from YouTube and other platforms for offline viewing, editing, or archival. Handles various formats and quality options.

shengdabai/Tony-Claude-Code-Skills

接收抖音、小红书、微信视频号等短视频链接或分享文案,查询作品/账号数据并提取语音文字稿,按作者和标题归档为 Markdown。用户希望完整解析短视频、取得数据或文字稿时使用;运行前检查 TikHub 与轻抖使用凭证,缺少时用新手能理解的方式引导购买和安全配置。

shengdabai/Tony-Claude-Code-Skills

Read-only queue dashboard for workspace-aware ship. (gstack)

shengdabai/Tony-Claude-Code-Skills

Author a new HyperFrames registry block (caption style, VFX block, transition, lower third) or component (text effect, overlay, snippet) and ship it as an upstream PR to the hyperframes repo. Use ONLY when the user wants to CONTRIBUTE to the public catalog — for in-project caption/transition authoring use the `hyperframes` skill, for installing existing registry items use the `hyperframes-registry` skill.

shengdabai/Tony-Claude-Code-Skills

CSS animation adapter patterns for HyperFrames. Use when authoring CSS keyframes, animation-delay based timing, animation-fill-mode, animation-play-state, or CSS-only motion that HyperFrames must seek deterministically during preview and rendering.

shengdabai/Tony-Claude-Code-Skills

GSAP animation reference for HyperFrames. Covers gsap.to(), from(), fromTo(), easing, stagger, defaults, timelines (gsap.timeline(), position parameter, labels, nesting, playback), and performance (transforms, will-change, quickTo). Use when writing GSAP animations in HyperFrames compositions.

shengdabai/Tony-Claude-Code-Skills

HyperFrames CLI dev loop — `npx hyperframes` for scaffolding (init), validation (lint, inspect), preview, render, and environment troubleshooting (doctor, browser, info, upgrade). Use when running any of these commands or troubleshooting the HyperFrames build/render environment. For asset preprocessing commands (`tts`, `transcribe`, `remove-background`), invoke the `hyperframes-media` skill instead.

shengdabai/Tony-Claude-Code-Skills

Asset preprocessing for HyperFrames compositions — text-to-speech narration (Kokoro), audio/video transcription (Whisper), and background removal for transparent overlays (u2net). Use when generating voiceover from text, transcribing speech for captions, removing the background from a video or image to use as a transparent overlay, choosing a TTS voice or whisper model, or chaining these (TTS → transcribe → captions). Each command downloads its own model on first run.

関連スキル