Communitygithub.com

shengdabai/Tony-Claude-Code-Skills

適用於 HyperFrames 的 CSS 動畫適配器模式。用於編寫 CSS 關鍵幀、基於 animation-delay 的時間控制、animation-fill-mode、animation-play-state,或 HyperFrames 在預覽和渲染時必須能確定性搜尋的純 CSS 動畫。

Tony-Claude-Code-Skills 是什麼?

此技能提供了一組預先定義的模式與約定,讓開發者在 HyperFrames 專案中使用 CSS 動畫進行確定性搜尋與渲染。它透過 CSS 執行時期適配器運作,能發現具有計算後動畫名稱的元素,並利用瀏覽器的 Animation 控制句柄進行搜尋,或在必要時以負值的 animation-delay 作為備用。技能強調使用有限的動畫持續時間與重複次數,並將動畫元素在執行時期初始化前放入 DOM,同時為元素添加 `data-start` 屬性以使本地動畫時間與片段同步。此技能支援基本動畫模式與交錯動畫模式,適合裝飾性循環、遮罩、光暈、微光與簡易單元素入場,且應避免依賴使用者事件、佈局屬性動畫或無限制的 CSS 動畫。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/shengdabai/Tony-Claude-Code-Skills/tree/HEAD/skills/hyperframes-css-animations

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

HyperFrames 的 CSS 動畫

HyperFrames 可透過其 css 執行時期適配器來搜尋 CSS 關鍵幀動畫。將此用於簡單重複的主題、背景運動、微光、光暈、遮罩及非序列裝飾。

對於場景編排,GSAP 通常更清晰。當動畫屬於單一元素且具有固定持續時間時,CSS 動畫表現最佳。

合約

  • 在執行時期初始化完成之前,將動畫元素放入 DOM。
  • 為計時元素提供 data-start 值,使本地動畫時間與片段匹配。
  • 使用有限的 animation-duration 與 animation-iteration-count,因為負值延遲的備用方案無法在沒有 WAAPI 支援的 CSS 動畫環境中表示無界持續時間。
  • 偏好使用 animation-fill-mode: both,以便在主動運動前後,搜尋狀態能保持住。
  • 避免依賴實際時鐘的 JavaScript、懸浮觸發的狀態,以及依賴使用者事件的類別切換。

此適配器會發現具有計算後 animation-name 的元素,在可用時搜尋其瀏覽器 Animation 控制句柄,並以負值 animation-delay 暫停作為備用。

基本模式

<div
  id="pulse-ring"
  class="clip pulse-ring"
  data-start="0"
  data-duration="4"
  data-track-index="2"
></div>

<style>
  .pulse-ring {
    width: 280px;
    height: 280px;
    border: 4px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation-name: pulse-ring;
    animation-duration: 1200ms;
    animation-timing-function: cubic-bezier(0.2, 0, 0, 1);
    animation-iteration-count: 3;
    animation-fill-mode: both;
  }

  @keyframes pulse-ring {
    from {
      opacity: 0;
      transform: scale(0.82);
    }
    35% {
      opacity: 1;
    }
    to {
      opacity: 0;
      transform: scale(1.18);
    }
  }
</style>

交錯模式

使用 CSS 自訂屬性以避免重複關鍵幀:

<div class="clip dots" data-start="1" data-duration="3" data-track-index="3">
  <span style="--i: 0"></span>
  <span style="--i: 1"></span>
  <span style="--i: 2"></span>
</div>

<style>
  .dots span {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border-radius: 50%;
    background: currentColor;
    animation: dot-pop 900ms ease-out both;
    animation-delay: calc(var(--i) * 120ms);
  }

  @keyframes dot-pop {
    from {
      opacity: 0;
      transform: translateY(18px) scale(0.75);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
</style>

良好用途

  • 具有已知重複次數的裝飾性循環。
  • 遮罩、光暈、微光、顆粒與細微視差圖層。
  • 使用完整 JS 時間線會過度設計的簡單單元素入場。

避免事項

  • 無限 CSS 動畫,除非你已確認瀏覽器暴露了可供搜尋的 WAAPI 支援的 CSS 動畫控制句柄。偏好使用涵蓋可見持續時間的有限重複次數。
  • 當變形(transforms)可達成時,動畫化佈局屬性,如 top、left、width 或 height。
  • 依賴懸浮(hover)、焦點(focus)、滾動(scroll)或媒體查詢(media queries)來觸發渲染關鍵的運動。
  • 在啟動後更改動畫類別,除非另一個確定性時間線控制該更改。

驗證

編輯 CSS 動畫組合後:

npx hyperframes lint
npx hyperframes validate

鳴謝與參考資料

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

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.

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

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.

相關技能