mcpField
M
motion-one

motion-one

github.com/dylantarreデザイン・UI132548 回インストール43 週間前に更新
リポジトリ

motion-one について

Motion Oneでディズニーの12のアニメーション原則を実装するためのデザインスキルです。Web Animations APIを使ったタイムライン、スタガー、スクロール連動などの例を紹介します。

主な機能

  1. 0112のアニメーション原則の例
  2. 02単一アニメーションとタイムライン
  3. 03スタガー効果とスプリングイージング
  4. 04スクロール連動と画面内アニメーション

活用シーン

  1. 01UI要素に動きを加える場面
  2. 02複数要素の動きを順序付ける場面
  3. 03スクロールに反応するWebアニメーションの作成

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/dylantarre/animation-principles --skill motion-one

インストール後、Claude Code で/motion-oneを入力して読み込まれたか確認します。

詳細

Motion One のアニメーション原則

Motion One の高性能な Web Animations API ラッパーを使用して、ディズニーのアニメーション12原則をすべて実装します。

1. つぶしと伸ばし

import { animate } from "motion";

animate(".ball",
  { scaleX: [1, 1.2, 1], scaleY: [1, 0.8, 1] },
  { duration: 0.3, easing: "ease-in-out" }
);

2. 予備動作

import { timeline } from "motion";

timeline([
  [".character", { y: 10, scaleY: 0.9 }, { duration: 0.2 }],
  [".character", { y: -200 }, { duration: 0.4, easing: "ease-out" }]
]);

3. 演出

animate(".background", { filter: "blur(3px)", opacity: 0.6 });
animate(".hero", { scale: 1.1 });

4. ストレートアヘッドとポーズ・トゥ・ポーズ

animate(".element", {
  x: [0, 100, 200, 300],
  y: [0, -50, 0, -30]
}, { duration: 1 });

5. フォロースルーとオーバーラッピングアクション

timeline([
  [".body", { x: 200 }, { duration: 0.5 }],
  [".hair", { x: 200 }, { duration: 0.5, at: "-0.45" }],
  [".cape", { x: 200 }, { duration: 0.6, at: "-0.5" }]
]);

6. スローインとスローアウト

animate(".element", { x: 300 }, {
  duration: 0.6,
  easing: [0.42, 0, 0.58, 1] // cubic-bezier ease-in-out
});
// Or: "ease-in", "ease-out", "ease-in-out"
// Or spring: { easing: spring({ stiffness: 100, damping: 15 }) }

7. アーク

animate(".ball", {
  x: [0, 100, 200],
  y: [0, -100, 0]
}, { duration: 1, easing: "ease-in-out" });

// Or with offset path
animate(".element", {
  offsetDistance: ["0%", "100%"]
}, { duration: 1 });
// CSS: offset-path: path('M0,100 Q100,0 200,100');

8. 副次的アクション

const button = document.querySelector(".button");
button.addEventListener("mouseenter", () => {
  animate(button, { scale: 1.05 }, { duration: 0.2 });
  animate(".icon", { rotate: 15 }, { duration: 0.15 });
});

9. タイミング

import { spring } from "motion";

// Fast snap
animate(".fast", { x: 100 }, { duration: 0.15 });

// Spring physics
animate(".spring", { x: 100 }, {
  easing: spring({ stiffness: 300, damping: 20 })
});

// Slow dramatic
animate(".slow", { x: 100 }, { duration: 0.8, easing: "ease-out" });

10. 誇張

import { spring } from "motion";

animate(".element", { scale: 1.5, rotate: 720 }, {
  easing: spring({ stiffness: 200, damping: 10 }) // overshoot
});

11. 立体感のある描画

animate(".box", {
  rotateX: 45,
  rotateY: 30
}, { duration: 0.5 });
// Set perspective in CSS: perspective: 1000px;

12. 魅力

animate(".card", {
  scale: 1.02,
  boxShadow: "0 20px 40px rgba(0,0,0,0.2)"
}, { duration: 0.3, easing: "ease-out" });

スタガーアニメーション

import { stagger } from "motion";

animate(".item",
  { opacity: [0, 1], y: [20, 0] },
  { delay: stagger(0.1) }
);

スクロールアニメーション

import { scroll, animate } from "motion";

scroll(
  animate(".parallax", { y: [0, 100] }),
  { target: document.querySelector(".container") }
);

ビュー内アニメーション

import { inView } from "motion";

inView(".section", ({ target }) => {
  animate(target, { opacity: 1, y: 0 }, { duration: 0.5 });
});

Motion One の主な機能

  • animate() - 単一のアニメーション
  • timeline() - at による位置指定を使ったシーケンス
  • stagger() - 遅延時間のずらし
  • spring() - 物理ベースのイージング
  • scroll() - スクロール連動アニメーション
  • inView() - Intersection Observer のラッパー
  • Web Animations API を使用(ハードウェアアクセラレーション対応)
  • バンドルサイズが小さい(約3kb)

コメント