Communitygithub.com

Makepad Animation Skill

ÚSALO SIEMPRE cuando la solicitud coincida con animaciones de Makepad: CRÍTICO: Usar para el sistema de animación de Makepad.

¿Qué es Makepad Animation Skill?

Esta habilidad está diseñada para desarrolladores que trabajan con el sistema de animación de Makepad, un framework de GUI en Rust. Proporciona guías detalladas, patrones de código y documentación de referencia para crear animaciones responsivas y de alto rendimiento. Cubre conceptos fundamentales como estados de animación (hover, pressed, focus, disabled), tipos de línea de tiempo (Forward, Snap, Loop, BounceLoop) y funciones de easing. Incluye ejemplos prácticos de código Rust y patrones de shader para animar propiedades como colores, transformaciones y opacidad. La habilidad es útil para cualquier tarea que involucre el sistema `animator` de Makepad, transiciones de estado o feedback visual interactivo. Se integra perfectamente con el repositorio de Makepad y la documentación de referencia para garantizar una implementación precisa y completa.

Compatible con✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Anhvu1107/all-agent-skill/tree/HEAD/.agent/skills/makepad-animation

Preguntar en tu IA favorita

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

Documentación

Habilidad de Animación Makepad

Regla de Lectura Selectiva

Comience con:

  • references/senior-master-standard.md
  • references/usage-routing.md
  • references/quality-checklist.md

Luego cargue solo los documentos, scripts, activos o ejemplos heredados que coincidan con la tarea real del usuario.

Versión: makepad-widgets (rama dev) | Última actualización: 2026-01-19

Busque actualizaciones: https://crates.io/crates/makepad-widgets

Es usted un experto en animaciones Makepad. Ayude a los usuarios:

  • Escribiendo código: Genere código de animación siguiendo los patrones a continuación
  • Respondiendo preguntas: Explique estados, transiciones, líneas de tiempo

Cuándo Usarlo

  • Necesita construir o depurar animaciones, transiciones, estados de hover o líneas de tiempo del animador en Makepad.
  • La tarea involucra animator, cambios de estado, easing, fotogramas clave o retroalimentación de interacción visual.
  • Desea patrones de animación específicos de Makepad en lugar de guías genéricas de UI en Rust.

Documentación

Consulte los archivos locales para obtener documentación detallada:

  • ./references/animation-system.md - Referencia completa de animación

Patrones Avanzados

Para patrones de animación listos para producción, vea el directorio _base/:

PatrónDescripción
06-animator-basicsFundamentos del animador
07-easing-functionsEasing y temporización
08-keyframe-animationFotogramas clave complejos

IMPORTANTE: Verificación de Integridad de Documentación

Antes de responder preguntas, Claude DEBE:

  1. Leer el(los) archivo(s) de referencia relevantes listados arriba
  2. Si la lectura del archivo falla o el archivo está vacío:
    • Informar al usuario: "La documentación local está incompleta. Se recomienda ejecutar /sync-crate-skills makepad --force para actualizar la documentación."
    • Aún así responder basándose en los patrones de SKILL.md + conocimiento incorporado
  3. Si el archivo de referencia existe, incorporar su contenido en la respuesta

Patrones Clave

1. Animación Básica de Hover

<Button> {
    text: "Pasar el ratón"

    animator: {
        hover = {
            default: off

            off = {
                from: { all: Forward { duration: 0.15 } }
                apply: {
                    draw_bg: { color: #333333 }
                }
            }

            on = {
                from: { all: Forward { duration: 0.15 } }
                apply: {
                    draw_bg: { color: #555555 }
                }
            }
        }
    }
}

2. Animación Multi-Estado

<View> {
    animator: {
        hover = {
            default: off
            off = {
                from: { all: Forward { duration: 0.2 } }
                apply: { draw_bg: { color: #222222 } }
            }
            on = {
                from: { all: Forward { duration: 0.2 } }
                apply: { draw_bg: { color: #444444 } }
            }
        }

        pressed = {
            default: off
            off = {
                from: { all: Forward { duration: 0.1 } }
                apply: { draw_bg: { scale: 1.0 } }
            }
            on = {
                from: { all: Forward { duration: 0.1 } }
                apply: { draw_bg: { scale: 0.95 } }
            }
        }
    }
}

3. Animación de Estado de Enfoque

<TextInput> {
    animator: {
        focus = {
            default: off

            off = {
                from: { all: Forward { duration: 0.2 } }
                apply: {
                    draw_bg: {
                        border_color: #444444
                        border_size: 1.0
                    }
                }
            }

            on = {
                from: { all: Forward { duration: 0.2 } }
                apply: {
                    draw_bg: {
                        border_color: #0066CC
                        border_size: 2.0
                    }
                }
            }
        }
    }
}

4. Estado Deshabilitado

<Button> {
    animator: {
        disabled = {
            default: off

            off = {
                from: { all: Snap }
                apply: {
                    draw_bg: { color: #0066CC }
                    draw_text: { color: #FFFFFF }
                }
            }

            on = {
                from: { all: Snap }
                apply: {
                    draw_bg: { color: #333333 }
                    draw_text: { color: #666666 }
                }
            }
        }
    }
}

Estructura del Animador

PropiedadDescripción
animatorContenedor raíz de animación
{state} =Definición de estado (hover, pressed, focus, disabled)
default:Valor de estado inicial
{value} =Definición de valor de estado (on, off, custom)
from:Línea de tiempo de transición
apply:Propiedades a animar

Tipos de Línea de Tiempo (Enum Play)

TipoDescripción
Forward { duration: f64 }Animación lineal hacia adelante
SnapCambio instantáneo, sin transición
Reverse { duration: f64, end: f64 }Animación inversa
Loop { duration: f64, end: f64 }Animación en bucle
BounceLoop { duration: f64, end: f64 }Animación de bucle rebotante

Funciones de Easing (Enum Ease)

// Básico
Linear

// Cuadrático
InQuad, OutQuad, InOutQuad

// Cúbico
InCubic, OutCubic, InOutCubic

// Cuártico
InQuart, OutQuart, InOutQuart

// Quíntico
InQuint, OutQuint, InOutQuint

// Sinusoidal
InSine, OutSine, InOutSine

// Exponencial
InExp, OutExp, InOutExp

// Circular
InCirc, OutCirc, InOutCirc

// Elástico
InElastic, OutElastic, InOutElastic

// Retroceso
InBack, OutBack, InOutBack

// Rebote
InBounce, OutBounce, InOutBounce

// Personalizado
ExpDecay { d1: f64, d2: f64 }
Bezier { cp0: f64, cp1: f64, cp2: f64, cp3: f64 }
Pow { begin: f64, end: f64 }

Usando Easing

from: {
    all: Ease { duration: 0.3, ease: InOutQuad }
}

Estados Comunes

EstadoValoresDisparador
hoveron, offEntrada/salida del ratón
pressed / downon, offPresión/liberación del ratón
focuson, offGanancia/pérdida de enfoque
disabledon, offWidget habilitado/deshabilitado
selectedon, offCambio de selección

Propiedades Animables

La mayoría de los uniformes de shader draw_* se pueden animar:

  • Colores: color, border_color, shadow_color
  • Tamaños: border_size, border_radius, shadow_radius
  • Transformaciones: scale, rotation, offset
  • Opacidad: opacity

Al Escribir Código

  1. Siempre establezca default: para el estado inicial
  2. Use Forward para transiciones suaves
  3. Use Snap para cambios de estado instantáneos (como deshabilitado)
  4. Mantenga duraciones cortas (0.1-0.3s) para una sensación receptiva
  5. Anime los uniformes de shader en draw_bg, draw_text, etc.

API de Rust (Trait AnimatorImpl)

pub trait AnimatorImpl {
    // Animar al estado
    fn animator_play(&mut self, cx: &mut Cx, state: &[LiveId; 2]);

    // Ir al estado (sin animación)
    fn animator_cut(&mut self, cx: &mut Cx, state: &[LiveId; 2]);

    // Verificar estado actual
    fn animator_in_state(&self, cx: &Cx, state: &[LiveId; 2]) -> bool;
}

// Ejemplo de uso
fn handle_event(&mut self, cx: &mut Cx, event: &Event, scope: &mut Scope) {
    match event.hits(cx, self.area()) {
        Hit::FingerHoverIn(_) => {
            self.animator_play(cx, id!(hover.on));
        }
        Hit::FingerHoverOut(_) => {
            self.animator_play(cx, id!(hover.off));
        }
        Hit::FingerDown(_) => {
            self.animator_play(cx, id!(pressed.on));
        }
        Hit::FingerUp(_) => {
            self.animator_play(cx, id!(pressed.off));
        }
        _ => {}
    }
}

Al Responder Preguntas

  1. Los estados son independientes, varios pueden estar activos simultáneamente
  2. La animación aplica propiedades cuando el estado alcanza ese valor
  3. from define CÓMO animar, apply define QUÉ animar
  4. Makepad interpola entre valores antiguos y nuevos automáticamente
  5. Use la macro id!(state.value) para referenciar estados de animación en Rust

Limitaciones

  • Use esta habilidad solo cuando la tarea coincida claramente con el alcance descrito anteriormente.
  • No trate la salida como un sustituto de validación, pruebas o revisión experta específica del entorno.
  • Deténgase y pida aclaraciones si faltan entradas requeridas, permisos, límites de seguridad o criterios de éxito.

Individual skills in this repo

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

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches 007: Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Agentfolio: Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Animejs Animation: Advanced JavaScript animation library skill for creating complex, high-performance web animations.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Astropy: Astropy is the core Python package for astronomy, providing essential functionality for astronomical research and data analysis.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Astro: Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown/MDX support.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Emotional ARC Designer: One sentence - what this skill does and when to invoke it

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Fixing Motion Performance: Audit and fix animation performance issues including layout thrashing, compositor properties, scroll-linked motion, and blur effects.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches I18n Localization: Internationalization and localization patterns.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Interactive Portfolio: Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches JQ: Expert jq usage for JSON querying, filtering, transformation, and pipeline integration.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Landing Page Generator: Generates high-converting Next.js/React landing pages with Tailwind CSS.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches LEX: Centralized ''Truth Engine'' for cross-jurisdictional legal context (US, EU, CA) and contract scaffolding.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Magic Animator: AI-powered animation tool for creating motion in logos, UI, icons, and social media assets.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Nextjs APP Router Patterns: Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.

Anhvu1107/all-agent-skill

ALWAYS use this when the user mentions Nextjs Best Practices, asks to build, debug, review, document, automate, test, configure, migrate, or make decisions in this domain, or the task clearly depends on Nextjs Best Practices; scope: Next.js App Router principles. Apply the bundled workflow, references, scripts, Senior Master standard, and Codex strict review gate before final output.

Anhvu1107/all-agent-skill

description: ALWAYS use this when the work is specifically about modern Next.js or React architecture, data flow, rendering strategy, routing, or performance-sensitive frontend behavior.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Nextjs Supabase Auth: Expert integration of Supabase Auth with Next.js App Router

Anhvu1107/all-agent-skill

ALWAYS use this when the task involves reading, extracting, splitting, merging, rotating, creating, validating, OCR-ing, form-filling, or otherwise producing or modifying PDF files.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches React Nextjs Development: React and Next.js 14+ application development with App Router, Server Components, TypeScript, Tailwind CSS, and modern frontend patterns.

Anhvu1107/all-agent-skill

ALWAYS use this when working with Remotion code, video compositions, rendering logic, timing, media assets, or React-based motion workflows.

Skills relacionados