Communitygithub.com

Framer Motion 統合スキル(Helios同期)

Helios と Framer Motion のアニメーションをフレーム単位で同期するためのパターンを提供します。

Framer Motion 統合スキル(Helios同期) とは?

このスキルは、Helios のフレームベース・シーク可能なシステムと、Framer Motion の物理エンジンやトランジションを統合する方法を開発者に提供します。Framer Motion のアニメーションは通常時間ベースですが、Helios はフレームベースでシーク可能なため、useVideoFrame フックで取得した Helios の現在フレームを MotionValue にマッピングすることで、両者を同期します。具体的には、フレーム値を useTransform でアニメーション値(回転角度や透明度など)に変換し、それを motion コンポーネントのスタイルに直接バインドします。パフォーマンスを重視する場合は、React の再レンダリングを避け、MotionValue を Helios のサブスクリプション内で直接更新する「アドバンスト」パターンも提供しています。このスキルは React 環境で利用可能で、Helios の全フレーム制御を活かしつつ、Framer Motion の宣言的アニメーションを最大限に活用したい場合に最適です。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/BintzGavin/helios-skills/tree/HEAD/skills/examples/framer-motion

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

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

ドキュメント

Framer Motion 統合

Framer Motion のアニメーションは通常時間ベースです。Helios(フレームベースでシーク可能)と同期させるには、Helios のフレーム状態を MotionValue にマッピングする必要があります。

クイックスタート

1. useVideoFrame フック

useVideoFrame フックが利用できることを確認してください(examples/react/SKILL.md を参照)。

2. フレームを MotionValue にマッピング

useTransform を使用して、現在のフレーム(useVideoFrame から取得)をアニメーション値にマッピングします。

import { useMotionValue, useTransform, motion } from 'framer-motion';
import { useVideoFrame } from './hooks/useVideoFrame';

export const MyComponent = ({ helios }) => {
  // 1. 現在のフレームを取得
  const frame = useVideoFrame(helios);

  // 2. フレーム用の MotionValue を作成
  const frameMv = useMotionValue(0);

  // フレームが変更されるたびに MotionValue を同期
  useEffect(() => {
    frameMv.set(frame);
  }, [frame, frameMv]);

  // 3. フレーム → アニメーション値に変換
  // 例: 60フレーム(0〜60)で360度回転
  const rotate = useTransform(frameMv, [0, 60], [0, 360]);

  // 例: 最初の30フレームでフェードイン
  const opacity = useTransform(frameMv, [0, 30], [0, 1]);

  return (
    <motion.div
      style={{
        width: 100,
        height: 100,
        background: 'blue',
        rotate,   // 変換した値をバインド
        opacity
      }}
    />
  );
};

上級: 手動による MotionValue の設定

深いツリー構造でパフォーマンスを向上させるには、サブスクリプション内で共有の MotionValue を直接更新し、React の状態管理をバイパスします。

const frameMv = useMotionValue(0);

useEffect(() => {
  const unsubscribe = helios.subscribe((state) => {
    // MotionValue を直接更新 - React の再レンダリングは発生しません!
    frameMv.set(state.currentFrame);
  });
  return unsubscribe;
}, [helios, frameMv]);

const x = useTransform(frameMv, [0, 100], [0, 500]);

return <motion.div style={{ x }} />;

ソースファイル

  • 例: examples/framer-motion-animation/

Individual skills in this repo

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

BintzGavin/helios-skills

Make a video, MP4, GIF, animation, music video, short film, explainer, chart animation, product demo, logo reveal or social clip from code. Write one HTML page that draws any frame from its time t, render it frame-exact to MP4 with Helios, check stills and contact sheets, and add a soundtrack. Use whenever the user asks for a video or an animation file.

BintzGavin/helios-skills

>- Story-first motion design philosophy for animated video: motion must earn its place; arc (establish, complicate, resolve); show vs tell; shots as units of thought; quiet vs loud motion; Disney principles with restraint; timing heuristics; composition; grammar by medium (product demos, logos, data viz, explainers); technical commitments (deterministic time, scrubbability, refs); cutting discipline; explicit anti-patterns. Use when planning, storyboarding, critiquing, or implementing programmatic or motion-driven video (Helios, Remotion, explainers, loops, UI capture, logo reveals), or when the user asks for motion direction, pacing, or visual-story structure.

BintzGavin/helios-skills

>- End-to-end production plan template for feeling-first cinematic product promos: brief interrogation, 45s beat structure (cold open through brand), hero-element metaphor, storyboard fidelity ladder, visual system (palette, type, camera, texture), motion mix and easing vocabulary, audio and captions, tooling (animatic through HTML or AE), deliverables matrix, accessibility, review milestones, and compromises to accept or refuse. Use when planning, pitching, storyboarding, or producing polished brand films for any SaaS or consumer product—not category-specific; pair with skills/design/animated-video-philosophy for broader motion principles.

BintzGavin/helios-skills

Patterns for using Helios with GSAP (GreenSock). Use when integrating GSAP timelines with the Helios timeline for precise scrubbing and rendering.

BintzGavin/helios-skills

End-to-end guided workflow for creating an explainer or walkthrough video. Extracts brand identity from the repo, generates a measured soundtrack, and produces a narrative-driven motion.dev composition rendered via Helios CLI. Use when making how-it-works, feature walkthrough, or educational videos.

BintzGavin/helios-skills

Motion design framework for programmatic video. Defines anti-slideshow architecture, visual layering, physics-based easing, choreography rules, and quality validation. Reference this skill from any guided video skill.

BintzGavin/helios-skills

End-to-end guided workflow for creating a promotional hype video. Extracts brand identity from the repo, generates beat-synced music, and produces a high-energy motion.dev composition rendered via Helios CLI. Use when making brand-aligned promo or hype videos.

BintzGavin/helios-skills

End-to-end guided workflow for creating a social proof or testimonial video. Extracts brand identity from the repo, generates a warm soundtrack, and produces a trust-building motion.dev composition rendered via Helios CLI. Use when making customer testimonial, review highlight, or social proof videos.

BintzGavin/helios-skills

Workflow for rendering a Helios composition to a video file. Use when you need to automate video production or export a high-quality animation.

関連スキル