Communitygithub.com

Motion Canvas — TypeScript 애니메이션 엔진

제너레이터를 사용하여 애니메이션을 프로그래밍하고 실시간 편집기로 제어할 수 있는 TypeScript 라이브러리입니다. 설명 영상, 코드 워크스루, 교육 콘텐츠 제작에 적합합니다.

Motion Canvas — TypeScript 애니메이션 엔진란 무엇인가요?

Motion Canvas는 TypeScript 제너레이터를 기반으로 한 애니메이션 엔진으로, 실시간 편집기를 제공하여 설명 영상, 코드 워크스루, 교육 콘텐츠를 제작할 수 있습니다. 제너레이터 함수를 사용하여 애니메이션을 명령형 방식으로 프로그래밍하며, `yield*` 키워드로 각 프레임을 제어합니다. 이러한 접근 방식은 개발자에게 익숙한 프로그래밍 패러다임을 제공하면서도 직관적인 애니메이션 제작이 가능합니다. 주요 기능으로는 2D 씬, 코드 하이라이팅, 이징 함수, 신호 기반 반응형 데이터가 있으며, 내장된 실시간 편집기를 통해 미리보기와 조정이 용이합니다. GitHub에서 18K 이상의 스타를 받은 인기 프로젝트로, MIT 라이선스로 제공됩니다. React 기반인 Remotion과 달리 명령형 스타일을 선호하고 코드 애니메이션에 특화된 사용자에게 적합합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ever-just/agentskills/tree/HEAD/skills/motion-canvas

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Motion Canvas — TypeScript 애니메이션 엔진 (설명 영상 제작용)

제너레이터를 사용하여 애니메이션을 프로그래밍하고 실시간 편집기로 제어할 수 있는 TypeScript 라이브러리입니다. 설명 영상, 코드 워크스루, 교육 콘텐츠 제작에 적합합니다.

개요

  • 저장소: github.com/motion-canvas/motion-canvas (18K+ 스타)
  • 언어: TypeScript
  • 라이선스: MIT
  • 설치: npm create @motion-canvas@latest
  • 문서: motioncanvas.io/docs

핵심 개념

프로젝트 설정

npm create @motion-canvas@latest my-animation
cd my-animation
npm install
npm start  # localhost:9000에서 편집기 실행

씬(Scene)

모든 애니메이션은 씬으로 구성되며, 각 씬은 제너레이터 함수입니다:

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" />);

  // 원 애니메이션
  yield* circle().scale(2, 0.6);
  yield* circle().opacity(0, 0.3);
});

제너레이터를 이용한 애니메이션

yield* 키워드가 각 프레임을 순차적으로 제어합니다:

// 순차 애니메이션 (하나씩 실행)
yield* rect().position.x(300, 1);   // 1초 동안 오른쪽으로 이동
yield* rect().fill("#00ff00", 0.5); // 0.5초 동안 색상 변경

// 병렬 애니메이션 (동시에 실행)
yield* all(
  rect().position.x(300, 1),
  rect().rotation(360, 1),
);

// 지연과 체인 연결
yield* chain(
  rect().opacity(1, 0.3),
  waitFor(0.5),
  rect().scale(2, 0.6),
);

// 일정 시간 대기
yield* waitFor(2); // 2초 대기

노드 (시각 요소)

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

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

// 텍스트
<Txt text="Hello" fontSize={48} fill="white" fontFamily="monospace" />

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

// 이미지
<Img src={myImage} width={400} />

// 레이아웃 (flexbox)
<Layout direction="column" gap={20} alignItems="center">
  <Txt text="Title" />
  <Rect width={200} height={50} />
</Layout>

신호 (반응형 값)

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

const progress = createSignal(0);

// 컴포넌트에서 사용
<Rect width={() => progress() * 400} height={20} fill="blue" />

// 신호 애니메이션
yield* progress(1, 2); // 0에서 1까지 2초 동안 애니메이션

이징(Easing)

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

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

코드 하이라이팅

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}`}
  />
);

// 특정 줄 하이라이트
yield* code().selection(lines(1, 2), 0.3);

// 코드 변경 애니메이션
yield* code().code(
  `function hello() {\n  return "world";\n}`,
  0.6,
);

명령어

# 편집기 실행 (실시간 미리보기)
npm start

# 영상 렌더링
npx motion-canvas render

# 특정 씬 렌더링
npx motion-canvas render --scene=myScene

모범 사례

  1. 애니메이션 대상은 ref 사용: 애니메이션할 노드마다 createRef<Circle>() 사용
  2. 제너레이터 기반 흐름: 순차적으로 생각하세요 — yield*가 타임라인입니다
  3. all()로 병렬 처리: 동시에 실행할 애니메이션은 그룹화
  4. 반응형 데이터는 신호 사용: 여러 노드가 의존하는 값에 적합
  5. flexbox는 Layout 컴포넌트 사용: 자식 요소를 자동으로 배치
  6. 씬을 짧게 유지: 긴 애니메이션은 여러 씬으로 분할
  7. 편집기 활용: 실시간 미리보기와 스크러빙이 매우 유용합니다

Motion Canvas vs Remotion 사용 시기

Motion CanvasRemotion
적합한 대상교육, 설명 영상제품, 마케팅 영상
애니메이션 스타일명령형 (제너레이터)선언형 (React)
편집기내장 실시간 편집기Remotion Studio
코드 애니메이션일급 지원수동 구현
생태계성장 중대규모 (npm 패키지)
음성 동기화내장 오디오 동기화수동 동기화

출처

  • 저장소: github.com/motion-canvas/motion-canvas
  • 문서: motioncanvas.io/docs
  • 예제: 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.

관련 스킬