Communitygithub.com

Motion Canvas — TypeScript-Animation-Engine für Erklärvideos

Eine TypeScript-Bibliothek, die Generatoren nutzt, um Animationen mit einem Echtzeit-Editor zu programmieren. Ideal für Erklärvideos, Code-Walkthroughs und Bildungsinhalte.

Was ist Motion Canvas — TypeScript-Animation-Engine für Erklärvideos?

Motion Canvas ist eine leistungsstarke, quelloffene TypeScript-Bibliothek (MIT-Lizenz, 18.000+ Sterne auf GitHub), mit der Entwickler Animationen für Erklärvideos, Code-Walkthroughs und Bildungsinhalte programmieren können. Die Bibliothek nutzt Generatorfunktionen, die es ermöglichen, Animationen Schritt für Schritt zu steuern: Mit `yield*` werden Animationen sequenziell oder parallel (via `all()`) abgespielt. Der integrierte Echtzeit-Editor (gestartet mit `npm start`) bietet eine Live-Vorschau mit Scrubbing, was die Erstellung und Anpassung von Animationen extrem effizient macht. Motion Canvas unterstützt eine Vielzahl von Node-Typen (Rechtecke, Kreise, Text, Bilder, Videos) und bietet Signals für reaktive Werte, Easing-Funktionen und ein erstklassiges Code-Highlighting. Es ist besonders geeignet für erklärende Inhalte im Vergleich zu Remotion, das eher auf Produkt- und Marketingvideos ausgerichtet ist.

Funktioniert mit~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ever-just/agentskills/tree/HEAD/skills/motion-canvas

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Was macht Motion Canvas — TypeScript-Animation-Engine für Erklärvideos?

Eine TypeScript-Bibliothek, die Generatoren nutzt, um Animationen mit einem Echtzeit-Editor zu programmieren. Ideal für Erklärvideos, Code-Walkthroughs und Bildungsinhalte.

Überblick

  • Repository: github.com/motion-canvas/motion-canvas (18K+ Sterne)
  • Sprache: TypeScript
  • Lizenz: MIT
  • Installation: npm create @motion-canvas@latest
  • Dokumentation: motioncanvas.io/docs

Kernkonzepte

Projekteinrichtung

npm create @motion-canvas@latest my-animation
cd my-animation
npm install
npm start  # Öffnet den Editor unter localhost:9000

Szenen

Jede Animation besteht aus Szenen. Eine Szene ist eine Generatorfunktion:

import { makeScene2D } from "@motion-canvas/2d";
import { createRef } from "@motion-canvas/core";
import { Circle } from "@motion-canvas/2d/lib/components";

export default makeScene2D(function* (view) {
  const circle = createRef<Circle>();

  view.add(<Circle ref={circle} size={100} fill="#e13238" />);

  // Kreis animieren
  yield* circle().scale(2, 0.6);
  yield* circle().opacity(0, 0.3);
});

Animation mit Generatoren

Das Schlüsselwort yield* steuert die Animation Bild für Bild:

// Sequenzielle Animationen (nacheinander)
yield* rect().position.x(300, 1);   // In 1 Sekunde nach rechts bewegen
yield* rect().fill("#00ff00", 0.5); // In 0,5 Sekunden Farbe ändern

// Parallele Animationen (gleichzeitig)
yield* all(
  rect().position.x(300, 1),
  rect().rotation(360, 1),
);

// Verkettet mit Verzögerung
yield* chain(
  rect().opacity(1, 0.3),
  waitFor(0.5),
  rect().scale(2, 0.6),
);

// Auf bestimmte Dauer warten
yield* waitFor(2); // 2 Sekunden warten

Nodes (Visuelle Elemente)

import { Rect, Circle, Line, Txt, Img, Video, Layout } from "@motion-canvas/2d/lib/components";

// Rechteck
<Rect width={200} height={100} fill="#333" radius={10} />

// Text
<Txt text="Hallo" fontSize={48} fill="white" fontFamily="monospace" />

// Kreis
<Circle size={80} fill="#e13238" />

// Bild
<Img src={myImage} width={400} />

// Layout (Flexbox)
<Layout direction="column" gap={20} alignItems="center">
  <Txt text="Titel" />
  <Rect width={200} height={50} />
</Layout>

Signale (Reaktive Werte)

import { createSignal } from "@motion-canvas/core";

const progress = createSignal(0);

// Verwendung in Komponenten
<Rect width={() => progress() * 400} height={20} fill="blue" />

// Signal animieren
yield* progress(1, 2); // Von 0 auf 1 über 2 Sekunden animieren

Easing

import { easeInOutCubic, easeOutBounce, linear } from "@motion-canvas/core";

yield* rect().position.x(300, 1, easeInOutCubic);
yield* circle().scale(2, 0.8, easeOutBounce);

Code-Highlighting

import { Code, lines, word } from "@motion-canvas/2d/lib/components";

const code = createRef<Code>();

view.add(
  <Code
    ref={code}
    fontSize={24}
    code={`function hello() {\n  console.log("world");\n}`}
  />
);

// Bestimmte Zeilen hervorheben
yield* code().selection(lines(1, 2), 0.3);

// Code-Änderungen animieren
yield* code().code(
  `function hello() {\n  return "world";\n}`,
  0.6,
);

Befehle

# Editor starten (Live-Vorschau)
npm start

# Als Video rendern
npx motion-canvas render

# Bestimmte Szene rendern
npx motion-canvas render --scene=myScene

Best Practices

  1. Refs für Animationsziele verwenden: createRef<Circle>() für jeden Knoten, den du animierst
  2. Generatorbasierter Ablauf: Denk sequenziell – yield* ist deine Timeline
  3. all() für parallele Animationen: Gruppiere gleichzeitige Animationen
  4. Signale für reaktive Daten: Werte, von denen mehrere Knoten abhängen
  5. Layout-Komponente für Flexbox: Positioniert Kindelemente automatisch
  6. Szenen kurz halten: Unterteile lange Animationen in mehrere Szenen
  7. Den Editor nutzen: Die Live-Vorschau mit Scrubbing ist unverzichtbar

Wann Motion Canvas und wann Remotion verwenden

Motion CanvasRemotion
Am besten geeignet fürBildungs- und ErklärinhalteProdukt- und Marketingvideos
AnimationsstilImperativ (Generatoren)Deklarativ (React)
EditorIntegrierter Echtzeit-EditorRemotion Studio
Code-AnimationErstklassige UnterstützungManuelle Umsetzung
ÖkosystemWachsendGroß (npm-Pakete)
SynchronisationEingebaute Audio-SynchronisationManuelle Synchronisation

Quelle

  • Repository: github.com/motion-canvas/motion-canvas
  • Dokumentation: motioncanvas.io/docs
  • Beispiele: motioncanvas.io/docs/examples

Individual skills in this repo

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

ever-just/agentskills

> Declarative animations for React. Springs, gestures, layout animations, and page transitions. GPU-accelerated, production-ready.

ever-just/agentskills

> Create animated logos, icons, and micro-interactions as lightweight Lottie JSON files. No After Effects needed — build animations entirely in code.

ever-just/agentskills

> Add animated subtitles and captions to Remotion videos from .SRT files. TikTok-style word-by-word highlights, karaoke effects, and more.

ever-just/agentskills

> Create videos programmatically using React components. The most mature framework for code-driven video production.

ever-just/agentskills

> Copy-paste video components for Remotion. Intros, text effects, transitions, and full scene templates. Like shadcn/ui but for video.

ever-just/agentskills

Extract actionable intelligence from video content across YouTube, Vimeo, and company websites. Video reveals what text sources cannot: facility scale, team composition, product demonstrations, signage, event attendance, and operational reality.

ever-just/agentskills

Optimize and embed an existing video as a fast, crisp, autoplaying hero/background/loop on a website. Use when adding or replacing a video on a marketing site and it is too heavy, will not autoplay (especially on mobile/Safari), shows a codec error, or looks soft — to transcode it to web-safe H.264 with the right pixel format, faststart, retina-aware sizing, and a poster frame, then embed and verify it actually plays. This is optimization + embedding of footage you already have, not creating/animating a video (for that use remotion/moviepy/motion-canvas). Use when the user says "add this video to the site", "the hero video is too big / won't play / isn't crisp", "replace the homepage video", or "make this loop on the landing page".

ever-just/agentskills

Full conversion audit for any homepage or landing page. Use when someone asks to "review my homepage," "audit my landing page," "why isn't my page converting," "check my website," or wants feedback on their marketing page. Requires URL or screenshot before proceeding.

ever-just/agentskills

Automatically fetch YouTube video transcripts, generate structured summaries, and send full transcripts to messaging platforms. Detects YouTube URLs and provides metadata, key insights, and downloadable transcripts.

Verwandte Skills