Communitygithub.com

nehanakajanala/personal_website

Esta habilidad se debe utilizar cuando el usuario solicite "agregar una animación Lottie", "reproducir una animación .lottie o .json", "integrar una animación de Bodymovin/After Effects en web o móvil", "controlar la reproducción/segmentos de Lottie", "hacer un Lottie impulsado por scroll", "recolorear un Lottie en tiempo de ejecución" o "exportar una animación de AE a Lottie". Cubre la integración de dotLottie/lottie-web, control de reproducción, interactividad, tematización y la lista de verificación de exportación de AE.

¿Qué es personal_website?

Esta habilidad proporciona una guía completa para trabajar con animaciones Lottie, desde la integración hasta el control avanzado y la exportación desde After Effects. Está diseñada para desarrolladores que necesitan incorporar animaciones vectoriales ligeras y de alta fidelidad en aplicaciones web, iOS, Android y React Native. La habilidad cubre en detalle el uso de los runtimes modernos dotLottie (basado en canvas + WASM) y el legado lottie-web, ofreciendo ejemplos de código en JavaScript vanilla y React. Incluye control de reproducción (play, pause, stop, velocidad, modo), manejo de segmentos, animaciones impulsadas por scroll e interactividad avanzada (hover, click, cursor) mediante la biblioteca `@lottiefiles/lottie-interactivity`. Además, aborda la tematización en tiempo de ejecución con temas dotLottie o sobrescritura manual de colores, la optimización de archivos (preferencia por formato `.lottie` comprimido) y un flujo de trabajo de verificación que permite congelar fotogramas exactos para capturas de pantalla mediante un `?t=N` en la URL. También incluye referencias a archivos complementarios con la lista de verificación completa de exportación de After Effects y patrones de interacción.

Compatible con~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/nehakanjamala/personal_website/tree/HEAD/.agents/skills/lottie-animation

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

Animación Lottie

El puente desde After Effects al producto: animación vectorial enviada como JSON (o comprimida en .lottie), pequeña e independiente de resolución, reproducida por un runtime en web, iOS, Android y React Native. Esta habilidad cubre la integración, control y exportación de Lottie.

Cuándo usarlo

  • Enviar una animación de AE de un diseñador a web/iOS/Android/React Native
  • Ilustraciones en bucle, onboarding, estados vacíos, iconos animados
  • Reproducción vectorial impulsada por scroll o interacción (hover, clic, cursor)
  • Tematización/recoloración en tiempo de ejecución en lugar de reexportar por marca

Formatos: .json vs .lottie

  • .json — la salida cruda de Bodymovin. Legible por humanos, más grande.
  • .lottie — un contenedor comprimido (a menudo 60–80% más pequeño) que puede agrupar múltiples animaciones, imágenes y temas. Preferido para distribución. Reproductor: @lottiefiles/dotlottie-web (moderno, canvas + WASM) reemplaza al antiguo lottie-web.

Prefiera el runtime dotLottie para trabajo nuevo; use lottie-web solo para necesidades heredadas de .json + renderizador SVG.

Flujo de trabajo principal (web, dotLottie)

npm i @lottiefiles/dotlottie-web        # vanilla
npm i @lottiefiles/dotlottie-react      # envoltura React

Vanilla:

import { DotLottie } from "@lottiefiles/dotlottie-web";

const dotLottie = new DotLottie({
  canvas: document.querySelector("#lottie"),  // un elemento <canvas>
  src: "/hero.lottie",                         // o .json
  loop: true,
  autoplay: true,
  // speed: 1, mode: "forward" | "reverse" | "bounce", renderConfig: { autoResize: true }
});

React:

import { DotLottieReact } from "@lottiefiles/dotlottie-react";

function Hero() {
  return <DotLottieReact src="/hero.lottie" loop autoplay style={{ width: 320 }} />;
}

Capture la instancia para controlarla:

const [dl, setDl] = useState(null);
<DotLottieReact src="/icon.lottie" dotLottieRefCallback={setDl} />;
// dl?.play(); dl?.pause(); dl?.setSpeed(2);

Control de reproducción

dotLottie.play();
dotLottie.pause();
dotLottie.stop();
dotLottie.setSpeed(1.5);
dotLottie.setMode("bounce");        // forward | reverse | bounce | reverse-bounce
dotLottie.setFrame(42);             // saltar a un fotograma
dotLottie.setSegment(30, 90);       // restringir reproducción a un rango de fotogramas (ej. un bucle de "carga")

Los eventos secuencian la reproducción y la interfaz:

dotLottie.addEventListener("load", () => { /* totalFrames ahora disponible */ });
dotLottie.addEventListener("complete", () => { /* reproducción sin bucle finalizada */ });
dotLottie.addEventListener("frame", ({ currentFrame }) => { /* por fotograma */ });

Estilo máquina de estados (ej. botón que reproduce el segmento "marcado" y luego se detiene): reproduzca un segmento, escuche complete, luego setSegment al bucle de inactividad.

Lottie impulsado por scroll (sin necesidad de GSAP)

Mapee el progreso del scroll (0–1) a un fotograma. Pause el autoplay y maneje los fotogramas usted mismo.

const dotLottie = new DotLottie({ canvas, src: "/scroll.lottie", autoplay: false });
let total = 0;
dotLottie.addEventListener("load", () => { total = dotLottie.totalFrames; });

window.addEventListener("scroll", () => {
  const el = canvas.closest(".scrolly");
  const rect = el.getBoundingClientRect();
  const p = clamp(-rect.top / (rect.height - window.innerHeight), 0, 1); // 0..1 a través de la sección
  dotLottie.setFrame(p * (total - 1));
}, { passive: true });

const clamp = (v, lo, hi) => Math.min(hi, Math.max(lo, v));

Para interacciones más ricas (hover-to-play, clic toggle, cursor-follow) sin escribir la conexión, use @lottiefiles/lottie-interactivity, que mapea los modos scroll, hover, click, play y cursor a rangos de fotogramas de forma declarativa.

Tematización / recoloración en tiempo de ejecución

Dos caminos:

  • Temas dotLottie: un .lottie puede incluir temas de color con nombre; cambie con dotLottie.setTheme("dark") / loadTheme(...). Creado en las herramientas de LottieFiles — no necesita reexportar para recolorar.
  • Sobrescritura manual de color: cargue el JSON, recorra layers[].shapes[] y parchee los arrays de color c.k (RGBA normalizado 0–1), luego inicialice el reproductor con el objeto modificado. Frágil (depende de la estructura de capas) — prefiera temas o renderizador SVG basado en CSS (lottie-web rendererSettings) cuando deba cambiar el estilo por clase.

Runtimes móviles (paridad)

  • iOS — lottie-ios (LottieAnimationView): .play(), .currentProgress, .play(fromFrame:toFrame:).
  • Android — lottie-android (LottieAnimationView / Compose LottieAnimation): setMinAndMaxFrame, progress.
  • React Native — lottie-react-native (<LottieView source={...} progress={anim} />, conduzca progress con Animated).

El mismo .lottie/.json se reproduce en todas las plataformas; los segmentos y conceptos de progreso coinciden con la API web.

Optimización

  • Envíe .lottie (comprimido) en lugar de .json sin comprimir; cargue de forma diferida los reproductores fuera de pantalla y pausar cuando no sean visibles (IntersectionObserver → play/pause).
  • Prefiera el renderizador canvas/WASM de dotLottie para muchas animaciones simultáneas; el renderizador SVG (lottie-web) está bien para un icono nítido pero cuesta más DOM en archivos complejos.
  • Mantenga las composiciones de AE pequeñas: menos capas/fotogramas clave, sin rásteres incrustados grandes; aplaste precomposiciones cuando sea posible. El tamaño del archivo sigue la complejidad de fotogramas clave y trazados, no la duración.
  • Recoloree en tiempo de ejecución (temas) en lugar de exportar un archivo por marca/tema.

Entregar y verificar (HTML independiente)

Asistente empaquetado (scripts/): scripts/seek-shot.sh anim.html 0 1.5 3 congela el ?t=N del arnés y captura cada momento; scripts/contact-sheet.sh sheet.png frame-*.png los organiza en mosaico para una revisión de un vistazo. Ver scripts/README.md.

Para una demostración de Lottie autónoma (ilustración en bucle, icono animado, estado vacío), el entregable es un archivo HTML que se abre directamente en un navegador — el runtime dotLottie/lottie-web desde CDN, un <canvas> y su .lottie/.json (un archivo relativo o una URL de datos). Sin paso de construcción. Un archivo es el nivel adecuado para enviar un reproductor; no recurra a un empaquetador.

Contrato de salida:

  • Un archivo .html: el runtime vía CDN (@lottiefiles/dotlottie-web), el canvas y autoplay:false para que el fotograma sea suyo para controlar.
  • Incluya el arnés de búsqueda para que cualquier fotograma pueda congelarse para una captura de pantalla.

Arnés de búsqueda — congele un fotograma exacto. ?t=N salta a un fotograma y lo mantiene para que una captura de pantalla caiga en un fotograma fijo y determinista. El cabezal de reproducción de Lottie está en fotogramas, así que deténgase directamente en el fotograma:

<script>
  const dl = new DotLottie({ canvas, src: "/icon.lottie", autoplay: false });
  dl.addEventListener("load", () => {
    const t = new URLSearchParams(location.search).get("t");
    if (t !== null) dl.setFrame(parseFloat(t));      // congelar en fotograma N (lottie-web: anim.goToAndStop(N, true))
    else dl.play();
    console.log("totalFrames", dl.totalFrames);       // leer para fotograma final
    window.__ready = true;
  });
</script>

Bucle de verificación — renderizar → congelar → capturar pantalla → comprobar: abra el archivo en el primer / medio / último fotograma (?t=0, ?t=<total/2>, ?t=<total-1>; lea totalFrames desde la consola), capture cada uno y verifique la fidelidad (colores/tema correctos, bucles de segmento donde se pretende) más artefactos (canvas borroso por falta de autoResize/DPR, composición recortada, FOUC antes de que se cargue el archivo, tirones). Cualquier herramienta sin interfaz gráfica funciona:

npx playwright screenshot --wait-for-timeout=600 "file://$PWD/lottie.html?t=42" frame-mid.png

Antes de finalizar:

  1. Se abre de forma independiente — sin errores de consola, el runtime CDN y el .lottie/.json se cargan.
  2. ?t=N (setFrame/goToAndStop) congela el fotograma correcto y determinista.
  3. Capturado en el primer / medio / último fotograma — coincide con el resumen, nítido, sin recortes.
  4. Se respeta prefers-reduced-motion — no autoplay un bucle; muestre un fotograma estático u ofrezca un control de reproducción.
  5. La suavización es intencional — la velocidad/segmento de reproducción se eligió a propósito, el movimiento integrado en AE se lee como diseñado.

Referencia rápida

ObjetivoLlamada
Reproducir un rangosetSegment(inicio, fin)
Saltar a fotogramasetFrame(n)
Invertir / rebotar`setMode("reverse"
Impulsado por scrollautoplay:false + setFrame(p*totalFrames)
Cambiar temasetTheme("dark")
Conocer duracióntotalFrames tras evento load
Interactividad declarativa@lottiefiles/lottie-interactivity

Archivos de referencia

  • references/integration-and-export.md — configuración completa de dotLottie-web + React y control de eventos/segmentos, configuraciones de modo de lottie-interactivity, patrones de scroll/cursor, detalles de tematización en tiempo de ejecución y la lista de verificación completa de exportación de After Effects → Bodymovin con la lista de funciones no compatibles de AE y cómo evitarlas.

Individual skills in this repo

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

nehakanjamala/personal_website

This skill should be used when the user asks to "fix janky CSS animation", "make animation 60fps", "stop layout thrashing", "animate width/height/top/left smoothly", "convert animation to transform", "animate box-shadow performantly", "animate height auto", "FLIP animation", or "why is my scroll/hover animation choppy".

nehakanjamala/personal_website

This skill should be used when the user asks to "respect prefers-reduced-motion", "honor reduced motion", "make my animations accessible", "fix vestibular / motion-sickness issues", "add a useReducedMotion hook", "gate GSAP / Framer Motion / Lenis for reduced motion", or "meet WCAG 2.3.3 / C39". Provides tiered (not all-or-nothing) reduced-motion patterns in CSS and JS.

nehakanjamala/personal_website

Create, modify, debug, and deploy Apify Actors, and write their input and output schemas. Use when building an Actor from scratch, changing or troubleshooting Actor code, generating or updating .actor schema files, or pushing an Actor to the Apify platform. To wrap an existing non-Actor project, use apify-actorization instead.

nehakanjamala/personal_website

Convert existing projects into Apify Actors - serverless cloud programs. Actorize JavaScript/TypeScript (SDK with Actor.init/exit), Python (async context manager), or any language (CLI wrapper). Use when migrating code to Apify, wrapping CLI tools as Actors, or adding Actor SDK to existing projects.

nehakanjamala/personal_website

Deprecated. Output schema generation moved to the apify-actor-development skill; prefer that skill whenever it is available.

nehakanjamala/personal_website

Design and build an official Apify integration for a company's product - workflow-automation apps (Zapier/n8n-style), AI agent plugins (coding-agent skills+MCP bundles or OpenClaw/Hermes-style harnesses), AI framework packages (LangChain/LlamaIndex-style), or direct application clients via apify-client. Use when planning, creating, or reviewing an integration that exposes Apify Actors, runs, datasets, or key-value stores inside another product.

nehakanjamala/personal_website

Universal AI-powered web scraper for any platform. Scrape data from Instagram, Facebook, TikTok, YouTube, LinkedIn, X/Twitter, Google Maps, Google Search, Google Trends, Reddit, Airbnb, Yelp, and 15+ more platforms. Use for lead generation, brand monitoring, competitor analysis, influencer discovery, trend research, content analytics, audience analysis, review analysis, SEO intelligence, recruitment, or any data extraction task.

nehakanjamala/personal_website

This skill should be used when the user asks to "add a glassmorphism effect", "frosted glass UI", "Apple liquid glass style", "frosted blur card", "translucent glass panel animation", "make a frosted nav bar", "build a glass modal/dialog", "animate a glass card on hover", or "add a refracting liquid-glass hero". Covers frosted translucent panels with backdrop-filter blur, edge/specular highlights, SVG liquid-glass refraction, motion on hover/scroll/enter, and accessible reduced-transparency fallbacks.

nehakanjamala/personal_website

This skill should be used when the user asks to "build a scroll animation", "add ScrollTrigger", "pin a section while scrolling", "scrub an animation to scroll", "create a hero timeline", "do a horizontal scroll section", "split text and animate words", "animate a layout change with GSAP Flip", "sync ScrollTrigger with Lenis", "Lenis smooth scroll jittery", "ScrollTrigger markers drift", "ScrollTrigger pins break with Lenis/Locomotive", or "set up smooth scroll with GSAP pinning". Covers GSAP timelines, ScrollTrigger, SplitText, Flip, and Lenis/Locomotive smooth-scroll sync for code-driven web motion.

nehakanjamala/personal_website

This skill should be used when the user asks to "add a hover/press effect", "animate a toggle or switch", "build an animated like button", "make a toast/snackbar slide in", "animate a drawer or modal", "animate list reordering or add/remove", "do a shared-element layout transition", or "polish UI feedback". Covers UI motion with Framer Motion (motion/react) and modern CSS.

nehakanjamala/personal_website

This skill should be used when the user asks to "animate page or route transitions", "add a page transition or crossfade between views", "animate route changes in Next.js App Router", "use the View Transitions API", "AnimatePresence exit doesn't fire on navigation", or "Framer Motion exit animation not working / exit animation before unmount in Next.js". Covers enter/exit page-transition animation with the View Transitions API and Framer Motion, for Next.js App Router and general SPA routing.

nehakanjamala/personal_website

Scrape web pages using Scrapling with anti-bot bypass (like Cloudflare Turnstile), stealth headless browsing, spiders framework, adaptive scraping, and JavaScript rendering. Use when asked to scrape, crawl, or extract data from websites; web_fetch fails; the site has anti-bot protections; write Python code to scrape/crawl; or write spiders.

nehakanjamala/personal_website

This skill should be used when the user asks to "animate an SVG", "make a line draw itself on", "do a stroke draw-on / signature animation", "morph one shape into another", "move an element along a path", "animate an icon/logo", or "animate an SVG gradient or filter". Covers stroke-dashoffset draw-on, path morphing, motion-along-path, and animated icons/gradients/filters via CSS, SMIL, and GSAP.

Skills relacionados