lottie
HyperFrames 用のLottieおよびdotLottieアダプターパターン。このスキルは、lottie-web JSONアニメーションや.lottieファイルの埋め込み、またはインスタンスの登録に使用され、アニメーションの決定論的な再生を実現します。HyperFrames内でのアニメーションの正確な制御と同期を保証し、ロゴの表示、UIモーション、After Effectsのエクスポートコンテンツの統合に適しており、フロントエンドのアニメーション開発の効率と品質を向上させます。
npx skills add https://github.com/heygen-com/hyperframes --skill lottieBefore / After 効果比較
1 组HyperFramesでLottieアニメーションを手動で統合する際、開発者は再生の非同期性やタイムライン制御の不正確さなどの問題に頻繁に遭遇し、アニメーションのデバッグに多大な時間を費やし、開発効率とユーザーエクスペリエンスに影響を与えていました。
Lottieアダプターを使用することで、アニメーションの読み込み、再生、同期が標準化され、予測可能になります。開発者はアニメーションのタイムラインを簡単に制御し、複数のアニメーション間の正確な同期を確保できるため、デバッグ時間を大幅に削減し、アニメーションの表現力を向上させます。
Lottie for HyperFrames
HyperFrames can seek both lottie-web and dotLottie players through its lottie runtime adapter. Lottie is a strong fit because the animation timeline is already encoded in the asset; HyperFrames only needs a player object it can seek.
Contract
- Load assets from local project files, usually under
assets/. - Set
autoplay: false. - Prefer
loop: falseunless the user explicitly wants a loop. - Register every returned animation or player on
window.__hfLottie. - Keep the Lottie container dimensions stable with CSS.
The adapter seeks lottie-web with goToAndStop(timeMs, false) and dotLottie with frame or percentage APIs depending on player shape.
lottie-web Pattern
<div id="logo-lottie" class="lottie-layer"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.12.2/lottie.min.js"></script>
<script>
const anim = lottie.loadAnimation({
container: document.getElementById("logo-lottie"),
renderer: "svg",
loop: false,
autoplay: false,
path: "assets/logo-reveal.json",
});
window.__hfLottie = window.__hfLottie || [];
window.__hfLottie.push(anim);
</script>
.lottie-layer {
width: 100%;
height: 100%;
}
dotLottie Pattern
<canvas id="product-lottie" class="lottie-canvas"></canvas>
<script src="https://unpkg.com/@lottiefiles/dotlottie-web"></script>
<script>
const player = new DotLottie({
canvas: document.getElementById("product-lottie"),
src: "assets/product-flow.lottie",
autoplay: false,
loop: false,
});
window.__hfLottie = window.__hfLottie || [];
window.__hfLottie.push(player);
</script>
.lottie-canvas {
width: 100%;
height: 100%;
display: block;
}
Multiple Animations
Push each player into the same registry:
window.__hfLottie = window.__hfLottie || [];
window.__hfLottie.push(backgroundAnim);
window.__hfLottie.push(iconAnim);
window.__hfLottie.push(confettiAnim);
HyperFrames seeks them all to the same composition time.
Good Uses
- After Effects exports that are already known to render correctly in lottie-web.
- Logo reveals, icon loops, decorative accents, and product UI motion.
- Translating Remotion Lottie usage into plain HyperFrames HTML.
Avoid
- Relying on remote
pathURLs at render time. - Starting playback with
play(). - Assuming unsupported After Effects effects will survive export. Test the JSON or
.lottiefile in a browser first. - Loading a player asynchronously and registering it after HyperFrames validation has already inspected the page.
Validation
After editing a Lottie composition:
npx hyperframes lint
npx hyperframes validate
Credits And References
- HyperFrames adapter source:
packages/core/src/runtime/adapters/lottie.ts. - lottie-web by Airbnb: https://github.com/airbnb/lottie-web
- lottie-web
loadAnimationoptions: https://github.com/airbnb/lottie-web/wiki/loadAnimation-options - dotLottie web player methods by LottieFiles: https://developers.lottiefiles.com/docs/dotlottie-player/dotlottie-web/methods
ユーザーレビュー (0)
レビューを書く
レビューなし
統計データ
ユーザー評価
この Skill を評価