Communitygithub.com

Lottie-Animation – Programmatische JSON-basierte Animationen

Erstelle animierte Logos, Icons und Mikrointeraktionen als leichtgewichtige Lottie-JSON-Dateien. Kein After Effects nötig – Animationen werden vollständig im Code erstellt.

Was ist Lottie-Animation – Programmatische JSON-basierte Animationen?

Diese Skill-Anleitung ermöglicht es KI-Agenten und Entwicklern, Lottie-Animationen programmatisch in reinem JSON zu erstellen – ohne visuelle Editoren wie After Effects. Lottie ist ein offenes, JSON-basiertes Animationsformat, das auf Web, iOS, Android und React Native nativ abgespielt werden kann. Die detaillierte Dokumentation umfasst die gesamte JSON-Struktur, Layer- und Formtypen, Keyframe-Easing-Funktionen sowie Best Practices für schlanke, leistungsoptimierte Animationen. Zusätzlich werden praktische Codebeispiele in JavaScript zur Generierung, Einbettung via Lottie-Player und Nutzung in Remotion bereitgestellt. Verwandte Open-Source-Tools wie Lottie-Tools (Editor) und OmniLottie (KI-Generierung) ergänzen die Anleitung.

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

In Ihrer bevorzugten KI fragen

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

Dokumentation

Was macht Lottie-Animation – Programmatische JSON-basierte Animationen?

Erstelle animierte Logos, Icons und Mikrointeraktionen als leichtgewichtige Lottie-JSON-Dateien. Kein After Effects nötig – Animationen werden vollständig im Code erstellt.

Übersicht

  • Format: Lottie JSON (offener Standard)
  • Player-Repository: github.com/LottieFiles/lottie-player
  • Editor-Repository: github.com/marciogranzotto/lottie-tools (Open-Source-Webeditor)
  • Lizenz: MIT
  • Installation: npm install lottie-web oder npm install @lottiefiles/lottie-player

Was ist Lottie?

Lottie ist ein JSON-basiertes Animationsformat. Animationen werden als keyframed Eigenschaften in einer strukturierten JSON-Datei beschrieben. Sie rendern in jeder Auflösung (vektorbasiert), sind extrem klein in der Dateigröße und laufen nativ auf Web, iOS, Android und React Native.

Lottie-JSON-Struktur

{
  "v": "5.7.1",          // Lottie-Version
  "fr": 30,              // Bildrate
  "ip": 0,               // Startframe
  "op": 60,              // Endframe – 2 Sekunden bei 30fps
  "w": 400,              // Breite
  "h": 400,              // Höhe
  "assets": [],          // Externe Assets (Bilder, Precomps)
  "layers": [            // Animationsebenen (unten nach oben)
    {
      "ty": 4,           // Formebene
      "nm": "Circle",    // Ebenenname
      "ip": 0,
      "op": 60,
      "st": 0,           // Startzeit
      "ks": {            // Transform-Eigenschaften
        "o": { "a": 0, "k": 100 },           // Deckkraft (statisch)
        "r": { "a": 0, "k": 0 },             // Rotation
        "p": {                                 // Position (animiert)
          "a": 1,                              // a=1 bedeutet animiert
          "k": [
            { "t": 0, "s": [200, 300], "e": [200, 100], "i": {"x": 0.5, "y": 1}, "o": {"x": 0.5, "y": 0} },
            { "t": 30, "s": [200, 100] }
          ]
        },
        "s": { "a": 0, "k": [100, 100] }     // Skalierung
      },
      "shapes": [...]    // Formdefinitionen
    }
  ]
}

Ebenentypen

tyTypBeschreibung
0PrecompVerschachtelte Komposition
1SolidEinfarbige Ebene
2ImageBildebene
3NullLeerer Transform-Elternteil
4ShapeVektorformen (am häufigsten)
5TextTextebene

Formtypen

tyForm
"rc"Rechteck
"el"Ellipse
"sr"Stern/Polygon
"sh"Pfad (Bezier)
"fl"Füllung
"st"Kontur
"gf"Verlaufsfüllung
"gs"Verlaufskontur
"tr"Transform
"gr"Gruppe

Animationen im Code erstellen

Einfacher Einblendkreis

{
  "v": "5.7.1",
  "fr": 30,
  "ip": 0,
  "op": 30,
  "w": 200,
  "h": 200,
  "layers": [{
    "ty": 4,
    "nm": "circle",
    "ip": 0,
    "op": 30,
    "st": 0,
    "ks": {
      "o": {
        "a": 1,
        "k": [
          {"t": 0, "s": [0], "e": [100], "i": {"x": [0.4], "y": [1]}, "o": {"x": [0.6], "y": [0]}},
          {"t": 20, "s": [100]}
        ]
      },
      "r": {"a": 0, "k": 0},
      "p": {"a": 0, "k": [100, 100]},
      "s": {
        "a": 1,
        "k": [
          {"t": 0, "s": [0, 0], "e": [100, 100], "i": {"x": [0.2, 0.2], "y": [1, 1]}, "o": {"x": [0.8, 0.8], "y": [0, 0]}},
          {"t": 25, "s": [100, 100]}
        ]
      }
    },
    "shapes": [
      {
        "ty": "gr",
        "it": [
          {"ty": "el", "p": {"a": 0, "k": [0, 0]}, "s": {"a": 0, "k": [80, 80]}},
          {"ty": "fl", "c": {"a": 0, "k": [0.2, 0.5, 1, 1]}, "o": {"a": 0, "k": 100}},
          {"ty": "tr", "p": {"a": 0, "k": [0, 0]}, "s": {"a": 0, "k": [100, 100]}}
        ]
      }
    ]
  }]
}

Keyframe-Easing

// Sanft ein- und ausblenden
"i": {"x": [0.42], "y": [1]},
"o": {"x": [0.58], "y": [0]}

// Ausblenden (verlangsamen)
"i": {"x": [0.0], "y": [1]},
"o": {"x": [0.6], "y": [0]}

// Einblenden (beschleunigen)
"i": {"x": [0.4], "y": [1]},
"o": {"x": [1.0], "y": [0]}

// Linear
"i": {"x": [1], "y": [1]},
"o": {"x": [0], "y": [0]}

Programmatische Erzeugung mit JavaScript

function createLottieAnimation({ width, height, fps, durationFrames, layers }) {
  return {
    v: "5.7.1",
    fr: fps,
    ip: 0,
    op: durationFrames,
    w: width,
    h: height,
    assets: [],
    layers,
  };
}

function createShapeLayer({ name, startFrame, endFrame, shapes, transform }) {
  return {
    ty: 4,
    nm: name,
    ip: startFrame,
    op: endFrame,
    st: startFrame,
    ks: transform,
    shapes,
  };
}

// Erzeugen und speichern
const animation = createLottieAnimation({
  width: 400, height: 400, fps: 30, durationFrames: 60,
  layers: [/* ... */],
});

const fs = require("fs");
fs.writeFileSync("animation.json", JSON.stringify(animation, null, 2));

Lottie im Web abspielen

<!-- Über CDN -->
<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
<lottie-player src="animation.json" background="transparent" speed="1" loop autoplay></lottie-player>
// Über npm
import lottie from "lottie-web";

const anim = lottie.loadAnimation({
  container: document.getElementById("lottie"),
  renderer: "svg",
  loop: true,
  autoplay: true,
  animationData: require("./animation.json"),
});

Lottie in Remotion verwenden

import { Lottie } from "@remotion/lottie";
import animationData from "./animation.json";

export const MyScene: React.FC = () => {
  return <Lottie animationData={animationData} />;
};

Installation: npm install @remotion/lottie

Best Practices

  1. Halte es einfach – Weniger Ebenen = kleinere Datei, bessere Leistung
  2. Verwende Formebenen anstelle von Bildebenen, wenn möglich (Vektor = scharf in jeder Größe)
  3. Verwende Easing für Keyframes – Verwende niemals lineares Easing für organische Bewegungen
  4. 30fps ist Standard für Web-Lottie-Animationen
  5. Unter 2 Sekunden für Mikrointeraktionen, 3-5 Sekunden für Logos
  6. Teste mit lottie-player – Vorschau vor dem Einbetten
  7. Optimiere – Entferne ungenutzte Eigenschaften, minimiere die Genauigkeit von Zahlen

Agent-Skill-Quellen

  • Wiggle (Logo-Animations-Skill): github.com/talknerdytome-labs/wiggle-claude-skill
  • Lottie Tools (Editor): github.com/marciogranzotto/lottie-tools
  • OmniLottie (KI-Generierung): github.com/OpenVGLab/OmniLottie

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

> A TypeScript library using generators to program animations with a real-time editor. Ideal for explainer videos, code walkthroughs, and educational content.

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