# Gsap Performance > Skill oficial de GSAP para rendimiento: preferir transforms, evitar layout thrashing, will-change y batching. Úsalo al optimizar animaciones, reducir jank o buscar 60 fps. Fuente: https://skillsagentes.com/skills/calesthio/openmontage/gsap-performance Markdown: https://skillsagentes.com/skills/calesthio/openmontage/gsap-performance.md Repositorio: https://github.com/calesthio/OpenMontage Autor: calesthio Licencia: MIT Actualizado: hace 4 meses Coste de contexto: 58 tok instalada, 1k tok al activarse, 1k tok con todos los archivos del bundle Bundle: 1 archivo, 4 KB Permisos que pide: ninguno declarado ## Instalación Un skill son archivos markdown: los mismos archivos valen para cualquier agente y lo único que cambia es el directorio de destino, es decir la bandera `--agent`. Añade `-g` para instalarlo en todos los proyectos de la máquina. ```bash # Claude Code npx -y skills add calesthio/OpenMontage --skill gsap-performance --agent claude-code # Cursor npx -y skills add calesthio/OpenMontage --skill gsap-performance --agent cursor # Codex npx -y skills add calesthio/OpenMontage --skill gsap-performance --agent codex # Gemini CLI npx -y skills add calesthio/OpenMontage --skill gsap-performance --agent gemini # Windsurf npx -y skills add calesthio/OpenMontage --skill gsap-performance --agent windsurf # Cline npx -y skills add calesthio/OpenMontage --skill gsap-performance --agent cline ``` ## Qué hace - Prioriza transform y opacity frente a propiedades que provocan layout - Explica cuándo usar `will-change` y cómo agrupar lecturas y escrituras para evitar layout thrashing - Recomienda `gsap.quickTo()` para propiedades que se actualizan muy a menudo, como un seguidor de ratón - Da pautas para animar listas largas y muchos elementos con stagger ## Cuándo usarla - Optimizar animaciones GSAP para 60 fps estables - Reducir jank o coste de layout y pintado - El usuario pregunta por rendimiento de animación o FPS ## Cuándo no - Rendimiento específico de ScrollTrigger: mira el skill `gsap-scrolltrigger` ## Qué la activa - "Esta animación va a tirones, ¿cómo la arreglo?" - "Optimiza este GSAP para 60 fps" - "¿Cómo animo un seguidor de ratón sin penalizar el rendimiento?" ## Archivos - SKILL.md — 4 KB ## SKILL.md Reproducido tal cual desde calesthio/OpenMontage bajo MIT. Esta sección es el documento original y está en inglés. # GSAP Performance ## When to Use This Skill Apply when optimizing GSAP animations for smooth 60fps, reducing layout/paint cost, or when the user asks about performance, jank, or best practices for fast animations. **Related skills:** Build animations with **gsap-core** (transforms, autoAlpha) and **gsap-timeline**; for ScrollTrigger performance see **gsap-scrolltrigger**. ## Prefer Transform and Opacity Animating **transform** (`x`, `y`, `scaleX`, `scaleY`, `rotation`, `rotationX`, `rotationY`, `skewX`, `skewY`) and **opacity** keeps work on the compositor and avoids layout and most paint. Avoid animating layout-heavy properties when a transform can achieve the same effect. - ✅ Prefer: **x**, **y**, **scale**, **rotation**, **opacity**. - ❌ Avoid when possible: **width**, **height**, **top**, **left**, **margin**, **padding** (they trigger layout and can cause jank). GSAP’s **x** and **y** use transforms (translate) by default; use them instead of **left**/**top** for movement. ## will-change Use **will-change** in CSS on elements that will animate. It hints the browser to promote the layer. ```css will-change: transform; ``` ## Batch Reads and Writes GSAP batches updates internally. When mixing GSAP with direct DOM reads/writes or layout-dependent code, avoid interleaving reads and writes in a way that causes repeated layout thrashing. Prefer doing all reads first, then all writes (or let GSAP handle the writes in one go). ## Many Elements (Stagger, Lists) - Use **stagger** instead of many separate tweens with manual delays when the animation is the same; it’s more efficient. - For long lists, consider **virtualization** or animating only visible items; avoid creating hundreds of simultaneous tweens if it causes jank. - Reuse timelines where possible; avoid creating new timelines every frame. ## Frequently updated properties (e.g. mouse followers) Prefer **gsap.quickTo()** for properties that are updated often (e.g. mouse-follower x/y). It reuses a single tween instead of creating new tweens on each update. ```javascript let xTo = gsap.quickTo("#id", "x", { duration: 0.4, ease: "power3" }), yTo = gsap.quickTo("#id", "y", { duration: 0.4, ease: "power3" }); document.querySelector("#container").addEventListener("mousemove", (e) => { xTo(e.pageX); yTo(e.pageY); }); ``` ## ScrollTrigger and Performance - **pin: true** promotes the pinned element; pin only what’s needed. - **scrub** with a small value (e.g. `scrub: 1`) can reduce work during scroll; test on low-end devices. - Call **ScrollTrigger.refresh()** only when layout actually changes (e.g. after content load), not on every resize; debounce when possible. ## Reduce Simultaneous Work - Pause or kill off-screen or inactive animations when they’re not visible (e.g. when the user navigates away). - Avoid animating huge numbers of properties on many elements at once; simplify or sequence if needed. ## Best practices - ✅ Animate **transform** and **opacity**; use **will-change** in CSS only on elements that animate. - ✅ Use **stagger** instead of many separate tweens with manual delays when the animation is the same. - ✅ Use **gsap.quickTo()** for frequently updated properties (e.g. mouse followers). - ✅ Clean up or kill off-screen animations; call **ScrollTrigger.refresh()** when layout changes, debounced when possible. ## Do Not - ❌ Animate **width**/ **height**/ **top**/ **left** for movement when **x**/ **y**/ **scale** can achieve the same look. - ❌ Set **will-change** or **force3D** on every element “just in case”; use for elements that are actually animating. - ❌ Create hundreds of overlapping tweens or ScrollTriggers without testing on low-end devices. - ❌ Ignore cleanup; stray tweens and ScrollTriggers keep running and can hurt performance and correctness. ## Dónde encaja - Categoría: [Diseño y UI](https://skillsagentes.com/categorias/diseno-ui.md) — Sistemas de diseño, trabajo con componentes y acabado visual. - Creador: [calesthio](https://skillsagentes.com/creators/calesthio.md) — 0 skills en el directorio - [Todas las skills](https://skillsagentes.com/skills.md) - [Ranking de instalaciones](https://skillsagentes.com/ranking.md) ## Otras skills del mismo repositorio - [Seedance 2 5](https://skillsagentes.com/skills/calesthio/openmontage/seedance-2-5.md): Genera vídeo cinematográfico de 4-30 s con ByteDance Seedance 2.5 por fal.ai, Volcengine Ark, Runway o ComfyUI. Cubre el contrato de prompt 2.5, cortes duros, locks de continuidad y voz. - [Comfyui](https://skillsagentes.com/skills/calesthio/openmontage/comfyui.md): Úsalo al trabajar con workflows de ComfyUI en OpenMontage: comfyui_image/video/music, workflows propios, selección de output_node, modelos que faltan, LoRAs, poca VRAM e importación de workflows de la comunidad. - [Fish Audio Tts](https://skillsagentes.com/skills/calesthio/openmontage/fish-audio-tts.md): Genera narración expresiva y multilingüe con fish.audio (modelos S1 / S2) y reutiliza voces clonadas mediante reference_id. - [Minimax H3](https://skillsagentes.com/skills/calesthio/openmontage/minimax-h3.md): Genera vídeo con MiniMax H3 (Hailuo 3.0) por la API oficial v2, fal.ai, Runway, nodos partner de ComfyUI o pesos abiertos locales. Clips de 4-15s a 2K con animación de primer/último fotograma. - [Gemini Omni](https://skillsagentes.com/skills/calesthio/openmontage/gemini-omni.md): Genera y edita conversacionalmente vídeos cortos con Google Gemini Omni Flash: itera con ediciones en lenguaje natural, clips de 3-10s a 720p con audio y texto en pantalla, e imágenes de referencia por etiquetas. --- Skills Agentes · [Índice de páginas en markdown](https://skillsagentes.com/sitemap.md) · [Inicio](https://skillsagentes.com/index.md)