Communitygithub.com

Makepad アニメーションスキル

Makepad ウィジェットのアニメーション、トランジション、ホバー効果、状態管理に関するコード生成と解説を行います。

Makepad アニメーションスキル とは?

このスキルは、Makepad フレームワークを使用したアニメーションシステムの実装を支援します。具体的には、ホバー、プレス、フォーカス、無効化などの状態に応じたアニメーションを、Makepad 独自の `animator` ブロックを使って記述する方法を提供します。ユーザーは、状態遷移の定義、イージング関数の選択、キーフレームアニメーションの設定などを、コード例やパターンを通じて学べます。このスキルは `makepad-widgets`(開発ブランチ)を対象としており、Claude Code や Cursor などの AI エージェントが、Makepad アプリケーションの視覚的なインタラクションフィードバックを実装する際に特に有効です。また、Rust API である `AnimatorImpl` トレイトを使ったプログラム制御についても解説しています。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ASoudy/AGS/tree/HEAD/AGAS/plugins/antigravity-awesome-skills-claude/skills/makepad-animation

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

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

ドキュメント

Makepad アニメーションスキル は何をしますか?

バージョン: makepad-widgets (dev ブランチ) | 最終更新: 2026-01-19

更新情報: https://crates.io/crates/makepad-widgets

あなたは Makepad アニメーションの専門家です。以下のようにユーザーを支援してください:

  • コードの作成: 以下のパターンに従ってアニメーションコードを生成
  • 質問への回答: 状態、トランジション、タイムラインを解説

使用すべきタイミング

  • Makepad でアニメーション、トランジション、ホバー状態、アニメーターのタイムラインを構築またはデバッグする必要がある場合。
  • タスクが animator、状態変更、イージング、キーフレーム、または視覚的なインタラクションフィードバックに関連している場合。
  • 一般的な Rust UI ガイダンスではなく、Makepad 固有のアニメーションパターンが必要な場合。

ドキュメント

詳細なドキュメントについては、ローカルファイルを参照してください:

  • ./references/animation-system.md - 完全なアニメーションリファレンス

高度なパターン

本番環境で使用可能なアニメーションパターンについては、_base/ ディレクトリを参照:

パターン説明
06-animator-basicsアニメーターの基礎
07-easing-functionsイージングとタイミング
08-keyframe-animation複雑なキーフレーム

重要: ドキュメント完全性チェック

質問に答える前に、Claude は以下を実行する必要があります:

  1. 上記の関連リファレンスファイルを読む
  2. ファイルの読み取りに失敗した場合、またはファイルが空の場合:
    • ユーザーに通知: "ローカルドキュメントが不完全です。/sync-crate-skills makepad --force を実行してドキュメントを更新することをお勧めします。"
    • それでも SKILL.md のパターンと組み込み知識に基づいて回答する
  3. リファレンスファイルが存在する場合、その内容を回答に組み込む

主要パターン

1. 基本のホバーアニメーション

<Button> {
    text: "Hover Me"

    animator: {
        hover = {
            default: off

            off = {
                from: { all: Forward { duration: 0.15 } }
                apply: {
                    draw_bg: { color: #333333 }
                }
            }

            on = {
                from: { all: Forward { duration: 0.15 } }
                apply: {
                    draw_bg: { color: #555555 }
                }
            }
        }
    }
}

2. 複数状態アニメーション

<View> {
    animator: {
        hover = {
            default: off
            off = {
                from: { all: Forward { duration: 0.2 } }
                apply: { draw_bg: { color: #222222 } }
            }
            on = {
                from: { all: Forward { duration: 0.2 } }
                apply: { draw_bg: { color: #444444 } }
            }
        }

        pressed = {
            default: off
            off = {
                from: { all: Forward { duration: 0.1 } }
                apply: { draw_bg: { scale: 1.0 } }
            }
            on = {
                from: { all: Forward { duration: 0.1 } }
                apply: { draw_bg: { scale: 0.95 } }
            }
        }
    }
}

3. フォーカス状態アニメーション

<TextInput> {
    animator: {
        focus = {
            default: off

            off = {
                from: { all: Forward { duration: 0.2 } }
                apply: {
                    draw_bg: {
                        border_color: #444444
                        border_size: 1.0
                    }
                }
            }

            on = {
                from: { all: Forward { duration: 0.2 } }
                apply: {
                    draw_bg: {
                        border_color: #0066CC
                        border_size: 2.0
                    }
                }
            }
        }
    }
}

4. 無効状態

<Button> {
    animator: {
        disabled = {
            default: off

            off = {
                from: { all: Snap }
                apply: {
                    draw_bg: { color: #0066CC }
                    draw_text: { color: #FFFFFF }
                }
            }

            on = {
                from: { all: Snap }
                apply: {
                    draw_bg: { color: #333333 }
                    draw_text: { color: #666666 }
                }
            }
        }
    }
}

アニメーター構造

プロパティ説明
animatorルートのアニメーションコンテナ
{state} =状態定義 (hover、pressed、focus、disabled)
default:初期状態値
{value} =状態値の定義 (on、off、custom)
from:トランジションのタイムライン
apply:アニメーション対象のプロパティ

タイムラインタイプ (Play 列挙型)

タイプ説明
Forward { duration: f64 }線形順方向アニメーション
Snap即時変更、トランジションなし
Reverse { duration: f64, end: f64 }逆方向アニメーション
Loop { duration: f64, end: f64 }ループアニメーション
BounceLoop { duration: f64, end: f64 }バウンスループアニメーション

イージング関数 (Ease 列挙型)

// 基本
Linear

// 2次
InQuad, OutQuad, InOutQuad

// 3次
InCubic, OutCubic, InOutCubic

// 4次
InQuart, OutQuart, InOutQuart

// 5次
InQuint, OutQuint, InOutQuint

// 正弦波
InSine, OutSine, InOutSine

// 指数
InExp, OutExp, InOutExp

// 円形
InCirc, OutCirc, InOutCirc

// 弾性
InElastic, OutElastic, InOutElastic

// バック
InBack, OutBack, InOutBack

// バウンス
InBounce, OutBounce, InOutBounce

// カスタム
ExpDecay { d1: f64, d2: f64 }
Bezier { cp0: f64, cp1: f64, cp2: f64, cp3: f64 }
Pow { begin: f64, end: f64 }

イージングの使用例

from: {
    all: Ease { duration: 0.3, ease: InOutQuad }
}

一般的な状態

状態値トリガー
hoveron、offマウス ホバー入/出
pressed / downon、offマウス 押下/解放
focuson、offフォーカス 取得/喪失
disabledon、offウィジェット 有効/無効
selectedon、off選択状態の変更

アニメーション可能なプロパティ

ほとんどの draw_* シェーダーユニフォームをアニメーション化できます:

  • 色: color、border_color、shadow_color
  • サイズ: border_size、border_radius、shadow_radius
  • 変形: scale、rotation、offset
  • 不透明度: opacity

コード作成時の注意点

  1. 初期状態には必ず default: を設定する
  2. スムーズなトランジションには Forward を使用する
  3. 即時状態変更(無効など)には Snap を使用する
  4. レスポンシブな感覚を保つため、継続時間は短く(0.1〜0.3秒)設定する
  5. draw_bg、draw_text などのシェーダーユニフォームをアニメーション化する

Rust API (AnimatorImpl トレイト)

pub trait AnimatorImpl {
    // 状態にアニメーション
    fn animator_play(&mut self, cx: &mut Cx, state: &[LiveId; 2]);

    // 状態にカット(アニメーションなし)
    fn animator_cut(&mut self, cx: &mut Cx, state: &[LiveId; 2]);

    // 現在の状態を確認
    fn animator_in_state(&self, cx: &Cx, state: &[LiveId; 2]) -> bool;
}

// 使用例
fn handle_event(&mut self, cx: &mut Cx, event: &Event, scope: &mut Scope) {
    match event.hits(cx, self.area()) {
        Hit::FingerHoverIn(_) => {
            self.animator_play(cx, id!(hover.on));
        }
        Hit::FingerHoverOut(_) => {
            self.animator_play(cx, id!(hover.off));
        }
        Hit::FingerDown(_) => {
            self.animator_play(cx, id!(pressed.on));
        }
        Hit::FingerUp(_) => {
            self.animator_play(cx, id!(pressed.off));
        }
        _ => {}
    }
}

質問に答える際の注意点

  1. 状態は独立しており、複数の状態を同時にアクティブにできる
  2. 状態がその値に達したときに、アニメーションがプロパティを適用する
  3. from は「どのように」アニメーションするかを定義し、apply は「何を」アニメーションするかを定義する
  4. Makepad は古い値と新しい値の間を自動的に補間する
  5. Rust でアニメーション状態を参照するには id!(state.value) マクロを使用する

制限事項

  • このスキルは、タスクが上記の範囲と明確に一致する場合にのみ使用してください。
  • 出力を、環境固有の検証、テスト、または専門家によるレビューの代わりとして扱わないでください。
  • 必要な入力、権限、安全境界、または成功基準が欠けている場合は、立ち止まって明確化を求めてください。

Individual skills in this repo

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

ASoudy/AGS

Advanced JavaScript animation library skill for creating complex, high-performance web animations.

ASoudy/AGS

Astropy is the core Python package for astronomy, providing essential functionality for astronomical research and data analysis.

ASoudy/AGS

Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown/MDX support.

ASoudy/AGS

One sentence - what this skill does and when to invoke it

ASoudy/AGS

Audit and fix animation performance issues including layout thrashing, compositor properties, scroll-linked motion, and blur effects. Use when animations stutter, transitions jank, or reviewing CSS/JS animation performance.

ASoudy/AGS

Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.

ASoudy/AGS

Pull a YouTube video transcript into a queryable markdown vault with yt-dlp subtitle discovery, VTT cleanup, metadata frontmatter, and capture-seed stubs.

ASoudy/AGS

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

ASoudy/AGS

Generates high-converting Next.js/React landing pages with Tailwind CSS. Uses PAS, AIDA, and BAB frameworks for optimized copy/components (Heroes, Features, Pricing). Focuses on Core Web Vitals/SEO.

ASoudy/AGS

AI-powered animation tool for creating motion in logos, UI, icons, and social media assets.

ASoudy/AGS

Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.

ASoudy/AGS

Next.js App Router principles. Server Components, data fetching, routing patterns.

ASoudy/AGS

Expert integration of Supabase Auth with Next.js App Router

ASoudy/AGS

React and Next.js 14+ application development with App Router, Server Components, TypeScript, Tailwind CSS, and modern frontend patterns.

ASoudy/AGS

Best practices for Remotion - Video creation in React

ASoudy/AGS

Generate walkthrough videos from Stitch projects using Remotion with smooth transitions, zooming, and text overlays

ASoudy/AGS

Seek and analyze video content using Memories.ai Large Visual Memory Model for persistent video intelligence

ASoudy/AGS

Writes complete, structured landing pages optimized for SEO ranking, AEO citation, and visitor conversion. Activate when the user wants to write or generate a landing page for a product, service, or offer.

ASoudy/AGS

Three.js animation - keyframe animation, skeletal animation, morph targets, animation mixing. Use when animating objects, playing GLTF animations, creating procedural motion, or blending animations.

ASoudy/AGS

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

関連スキル