Communitygithub.com

shengdabai/Tony-Claude-Code-Skills

适用于 HyperFrames 的 CSS 动画适配器模式。在编写 CSS 关键帧、基于 animation-delay 的时序、animation-fill-mode、animation-play-state 或纯 CSS 动画时使用,这些动画在预览和渲染过程中 HyperFrames 必须能够确定性地进行定位。

Tony-Claude-Code-Skills 是什么?

该技能为 HyperFrames 提供了 CSS 动画适配器模式,用于在 HyperFrames 环境中实现确定性的 CSS 动画定位。它通过一个 CSS 运行时适配器,能够定位浏览器中的 CSS 关键帧动画,支持简单重复图案、背景动效、微光、发光、遮罩和非序列装饰等场景。技能支持通过 `data-start` 属性将动画时间与剪辑对齐,并推荐使用有限的 `animation-duration` 和 `animation-iteration-count`,以及 `animation-fill-mode: both` 以确保状态在动画前后保持。适用于 HyperFrames 平台,主要工作方式是在运行时发现带有 `animation-name` 的元素,尽可能利用浏览器的 `Animation` 手柄进行定位,否则通过负的 `animation-delay` 实现回退暂停。

兼容平台✓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 的新对话。

文档

CSS 动画 for HyperFrames

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 动画手柄。推荐使用覆盖可见时长的有限迭代次数。
  • 在可以使用变换的情况下,对布局属性(如 top、left、width 或 height)进行动画。
  • 依赖悬停、焦点、滚动或媒体查询来触发渲染关键动效。
  • 在启动后更改动画类,除非有另一个确定性时间线控制该更改。

验证

编辑 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.

相关技能