# Gsap Timeline > Skill oficial de GSAP para timelines: gsap.timeline(), parámetro de posición, anidado y control de reproducción. Úsalo al secuenciar animaciones o coreografiar keyframes. Fuente: https://skillsagentes.com/skills/calesthio/openmontage/gsap-timeline Markdown: https://skillsagentes.com/skills/calesthio/openmontage/gsap-timeline.md Repositorio: https://github.com/calesthio/OpenMontage Autor: calesthio Licencia: MIT Actualizado: hace 4 meses Coste de contexto: 74 tok instalada, 1.1k tok al activarse, 1.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-timeline --agent claude-code # Cursor npx -y skills add calesthio/OpenMontage --skill gsap-timeline --agent cursor # Codex npx -y skills add calesthio/OpenMontage --skill gsap-timeline --agent codex # Gemini CLI npx -y skills add calesthio/OpenMontage --skill gsap-timeline --agent gemini # Windsurf npx -y skills add calesthio/OpenMontage --skill gsap-timeline --agent windsurf # Cline npx -y skills add calesthio/OpenMontage --skill gsap-timeline --agent cline ``` ## Qué hace - Construye animaciones de varios pasos con `gsap.timeline()` y el parámetro de posición - Usa `defaults` para compartir duración y easing entre los tweens hijos - Cubre etiquetas, anidado de timelines y control de reproducción - Recuerda que la duración de la timeline la marcan sus hijos, no el constructor - Prohíbe anidar animaciones que lleven ScrollTrigger: eso va solo en el nivel superior ## Cuándo usarla - Secuenciar varias animaciones en serie o en paralelo - Coreografiar keyframes o controlar el orden de una animación - El usuario pregunta por timelines o secuenciado en GSAP ## Cuándo no - Tweens sueltos y easings: usa `gsap-core` - Timelines guiadas por scroll: usa `gsap-scrolltrigger` ## Qué la activa - "Encadena estas tres animaciones en orden" - "Necesito una secuencia de entrada coreografiada" - "¿Cómo controlo la reproducción de esta animación?" ## 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 Timeline ## When to Use This Skill Apply when building multi-step animations, coordinating several tweens in sequence or parallel, or when the user asks about timelines, sequencing, or keyframe-style animation in GSAP. **Related skills:** For single tweens and eases use **gsap-core**; for scroll-driven timelines use **gsap-scrolltrigger**; for React use **gsap-react**. ## Creating a Timeline ```javascript const tl = gsap.timeline(); tl.to(".a", { x: 100, duration: 1 }) .to(".b", { y: 50, duration: 0.5 }) .to(".c", { opacity: 0, duration: 0.3 }); ``` By default, tweens are **appended** one after another. Use the **position parameter** to place tweens at specific times or relative to other tweens. ## Position Parameter Third argument (or position property in vars) controls placement: - **Absolute**: `1` — start at 1 second. - **Relative (default)**: `"+=0.5"` — 0.5s after end; `"-=0.2"` — 0.2s before end. - **Label**: `"labelName"` — at that label; `"labelName+=0.3"` — 0.3s after label. - **Placement**: `"<"` — start when recently-added animation starts; `">"` — start when recently-added animation ends (default); `"<0.2"` — 0.2s after recently-added animation start. Examples: ```javascript tl.to(".a", { x: 100 }, 0); // at 0 tl.to(".b", { y: 50 }, "+=0.5"); // 0.5s after last end tl.to(".c", { opacity: 0 }, "<"); // same start as previous tl.to(".d", { scale: 2 }, "<0.2"); // 0.2s after previous start ``` ## Timeline Defaults Pass defaults into the timeline so all child tweens inherit: ```javascript const tl = gsap.timeline({ defaults: { duration: 0.5, ease: "power2.out" } }); tl.to(".a", { x: 100 }).to(".b", { y: 50 }); // both use 0.5s and power2.out ``` ## Timeline Options (constructor) - **paused: true** — create paused; call `.play()` to start. - **repeat**, **yoyo** — same as tweens; apply to whole timeline. - **onComplete**, **onStart**, **onUpdate** — timeline-level callbacks. - **defaults** — vars merged into every child tween. ## Labels Add and use labels for readable, maintainable sequencing: ```javascript tl.addLabel("intro", 0); tl.to(".a", { x: 100 }, "intro"); tl.addLabel("outro", "+=0.5"); tl.to(".b", { opacity: 0 }, "outro"); tl.play("outro"); // start from "outro" tl.tweenFromTo("intro", "outro"); // pauses the timeline and returns a new Tween that animates the timeline's playhead from intro to outro with no ease. ``` ## Nesting Timelines Timelines can contain other timelines. ```javascript const master = gsap.timeline(); const child = gsap.timeline(); child.to(".a", { x: 100 }).to(".b", { y: 50 }); master.add(child, 0); master.to(".c", { opacity: 0 }, "+=0.2"); ``` ## Controlling Playback - **tl.play()** / **tl.pause()** - **tl.reverse()** / **tl.progress(1)** then **tl.reverse()** - **tl.restart()** — from start. - **tl.time(2)** — seek to 2 seconds. - **tl.progress(0.5)** — seek to 50%. - **tl.kill()** — kill timeline and (by default) its children. ## Official GSAP Best practices - ✅ Prefer timelines for sequencing - ✅ Use the **position parameter** (third argument) to place tweens at specific times or relative to labels. - ✅ Add **labels** with `addLabel()` for readable, maintainable sequencing. - ✅ Pass **defaults** into the timeline constructor so child tweens inherit duration, ease, etc. - ✅ Put ScrollTrigger on the timeline (or top-level tween), not on tweens inside a timeline. ## Do Not - ❌ Chain animations with **delay** when a **timeline** can sequence them; prefer `gsap.timeline()` and the position parameter for multi-step animation. - ❌ Forget to pass **defaults** (e.g. `defaults: { duration: 0.5, ease: "power2.out" }`) when many child tweens share the same duration or ease. - ❌ Forget that **duration** on the timeline constructor is not the same as tween duration; timeline “duration” is determined by its children. - ❌ Nest animations that contain a ScrollTrigger; ScrollTriggers should only be on top-level Tweens/Timelines. ## 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)