animejs-motion
БесплатноБез исполняемых скриптовНе проверенMotor de animaciones de alta precisión con Anime.js. Timelines secuenciales, morphing de SVG, trazado de rutas vectoriales, efectos stagger para cuadrículas…
от Hectr203★ 21 звезда на GitHubОб этом скилле
Anime.js Motion Engineering
Guía y recetas de producción para integrar Anime.js en proyectos web. Proporciona control milimétrico sobre animaciones complejas de SVG, orquestación secuencial mediante líneas de tiempo (timelines), efectos escalonados (stagger) e interpolación de números para dashboards y métricas de alto rendimiento.
1. Repositorio Oficial y Documentación
- Repositorio GitHub: github.com/juliangarnier/anime
- Sitio Oficial y Demos: animejs.com
- Instalación en proyectos:
O mediante CDN para prototipos rápidos:# Instalación en el frontend npm install animejs npm install -D @types/animejs<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js"></script>
2. Principios de Integración y Rendimiento
- Propiedades Aceleradas por Hardware: Animar exclusivamente
transform(translateX,translateY,scale,rotate) yopacity. Evitar animarwidth,height,topoleftdirectamente para prevenir layout thrashing o reflujos del navegador. - Ciclo de Vida Limpio en React: Toda animación en componentes React debe almacenar la instancia en un
refy pausar o cancelar la ejecución al desmontar el componente (animeInstance.pause()). - Respeto a Preferencias del Usuario: Detectar siempre
prefers-reduced-motion:const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches; if (prefersReducedMotion) { // Desactivar animaciones o fijar duraciones a 0 }
3. Recetas de Producción Listas para Usar
Receta 1: Hook Personalizado en React (useAnime) Interrumpible
Este hook garantiza que las animaciones se limpien adecuadamente y no acumulen fugas de memoria ni colisiones entre renders:
import { useEffect, useRef } from 'react';
import anime from 'animejs';
export function useAnime(
targetRef: React.RefObject<HTMLElement | SVGElement | null>,
params: anime.AnimeParams,
dependencies: any[] = []
) {
const animationRef = useRef<anime.AnimeInstance | null>(null);
useEffect(() => {
if (!targetRef.current) return;
// Si el usuario prefiere movimiento reducido, saltar animación
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
if (prefersReducedMotion) {
return;
}
// Cancelar animación anterior si estaba corriendo
if (animationRef.current) {
animationRef.current.pause();
}
// Iniciar animación con el target referenciado
animationRef.current = anime({
targets: targetRef.current,
...params,
});
return () => {
if (animationRef.current) {
animationRef.current.pause();
}
};
}, dependencies);
return animationRef;
}
Receta 2: Efecto Escalonado para Cuadrículas y Listas (Stagger)
Ideal para revelar tarjetas de productos, elementos de catálogo o filas de una tabla con fluidez:
import anime from 'animejs';
export function animateStaggeredGrid(containerSelector: string) {
return anime({
targets: `${containerSelector} .grid-card`,
opacity: [0, 1],
translateY: [24, 0],
scale: [0.96, 1],
delay: anime.stagger(45, { from: 'first', start: 100 }), // 45ms entre cada elemento
duration: 380,
easing: 'cubicBezier(0.16, 1, 0.3, 1)', // Curva suave Apple-style
});
}
Receta 3: Línea de Tiempo Secuencial (Timeline Orchestration)
Permite encadenar secuencias sincronizadas sin anidar callbacks complejos (callback hell):
import anime from 'animejs';
export function playHeroSequence(elements: {
badge: HTMLElement;
title: HTMLElement;
cta: HTMLElement;
illustration: SVGElement;
}) {
const timeline = anime.timeline({
easing: 'cubicBezier(0.16, 1, 0.3, 1)',
duration: 400,
});
timeline
.add({
targets: elements.badge,
opacity: [0, 1],
translateY: [-10, 0],
duration: 300,
})
.add({
targets: elements.title,
opacity: [0, 1],
translateY: [20, 0],
}, '-=150') // Se solapa 150ms con el anterior para máxima fluidez
.add({
targets: elements.cta,
opacity: [0, 1],
scale: [0.94, 1],
duration: 350,
}, '-=200')
.add({
targets: elements.illustration.querySelectorAll('path'),
strokeDashoffset: [anime.setDashoffset, 0],
easing: 'easeInOutSine',
duration: 700,
delay: anime.stagger(60),
}, '-=250');
return timeline;
}
Receta 4: Dibujo de Rutas SVG y Morphing Vectorial
A. Dibujo progresivo de trazos vectoriales (Line Drawing):
anime({
targets: '.svg-path-illustration path',
strokeDashoffset: [anime.setDashoffset, 0],
easing: 'easeInOutCubic',
duration: 900,
delay: anime.stagger(80),
direction: 'alternate',
loop: false,
})
Установить animejs-motion в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл animejs-motion?
Motor de animaciones de alta precisión con Anime.js. Timelines secuenciales, morphing de SVG, trazado de rutas vectoriales, efectos stagger para cuadrículas, interpolación de métricas y físicas de movimiento elástico sin sobrecarga.
Как установить скилл animejs-motion?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл animejs-motion запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic