Communitygithub.com

ASoudy/AGS

Utilisation critique pour le système d’animation Makepad. Se déclenche sur : animation Makepad, animateur Makepad, survol Makepad, état Makepad, transition Makepad, "from: { all: Forward", pressé Makepad.

Qu'est-ce que AGS ?

Cette compétence est conçue pour aider les développeurs à utiliser le système d’animation du framework Makepad. Elle couvre la création d’animations pour les états de survol, de pression, de focus et de désactivation des widgets, en utilisant l’animateur intégré de Makepad. La compétence fournit des extraits de code prêts à l’emploi, des explications détaillées sur la structure de l’animateur, les types de chronologie (Forward, Snap, Reverse, Loop, BounceLoop) et les fonctions d’easing (de Linear à Bounce). Elle indique également comment animer des propriétés comme les couleurs, les bordures, les échelles et l'opacité via les shaders `draw_*`. Les développeurs peuvent l'utiliser pour générer du code d’animation, répondre à des questions sur les transitions et les états, ou déboguer des comportements visuels. La compétence vérifie la disponibilité des fichiers de documentation locaux et, s'ils manquent, suggère de les synchroniser via `/sync-crate-skills makepad --force`. Son utilisation est réservée aux tâches clairement liées au système d’animation Makepad.

Compatible avec✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ASoudy/AGS/tree/HEAD/AGAS/plugins/antigravity-awesome-skills-claude/skills/makepad-animation

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

Compétence d’animation Makepad

Version : makepad-widgets (branche dev) | Dernière mise à jour : 2026-01-19

Vérifier les mises à jour : https://crates.io/crates/makepad-widgets

Vous êtes un expert des animations Makepad. Aidez les utilisateurs en :

  • Écrivant du code : générez du code d’animation en suivant les motifs ci-dessous
  • Répondant aux questions : expliquez les états, les transitions, les chronologies

Quand l’utiliser

  • Vous devez construire ou déboguer des animations, transitions, états de survol ou chronologies d’animateur dans Makepad.
  • La tâche implique animator, des changements d’état, des interpolations (easing), des images clés ou un retour d’interaction visuelle.
  • Vous souhaitez des motifs d’animation spécifiques à Makepad plutôt qu’un guide Rust générique.

Documentation

Consultez les fichiers locaux pour une documentation détaillée :

  • ./references/animation-system.md – Référence complète des animations

Motifs avancés

Pour des motifs d’animation prêts pour la production, voir le répertoire _base/ :

MotifDescription
06-animator-basicsFondamentaux de l’animateur
07-easing-functionsInterpolation et temporisation
08-keyframe-animationImages clés complexes

IMPORTANT : Vérification de l’exhaustivité de la documentation

Avant de répondre aux questions, Claude DOIT :

  1. Lire le(s) fichier(s) de référence pertinent(s) listé(s) ci-dessus
  2. Si la lecture du fichier échoue ou si le fichier est vide :
    • Informer l’utilisateur : "La documentation locale est incomplète. Il est recommandé d’exécuter /sync-crate-skills makepad --force pour mettre à jour la documentation."
    • Répondre quand même en s’appuyant sur les motifs de SKILL.md + les connaissances intégrées
  3. Si le fichier de référence existe, intégrer son contenu dans la réponse

Motifs clés

1. Animation de survol de base

<Button> {
    text: "Survolez-moi"

    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. Animation multi-état

<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. Animation d’état de focus

<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. État désactivé

<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 }
                }
            }
        }
    }
}

Structure de l’animateur

PropriétéDescription
animatorConteneur racine de l’animation
{state} =Définition d’état (hover, pressed, focus, disabled)
default:Valeur initiale de l’état
{value} =Définition de la valeur d’état (on, off, custom)
from:Chronologie de transition
apply:Propriétés à animer

Types de chronologie (Enum Play)

TypeDescription
Forward { duration: f64 }Animation linéaire vers l’avant
SnapChangement instantané, sans transition
Reverse { duration: f64, end: f64 }Animation inversée
Loop { duration: f64, end: f64 }Animation en boucle
BounceLoop { duration: f64, end: f64 }Animation en boucle avec rebond

Fonctions d’interpolation (Enum Ease)

// Basique
Linear

// Quadratique
InQuad, OutQuad, InOutQuad

// Cubique
InCubic, OutCubic, InOutCubic

// Quartique
InQuart, OutQuart, InOutQuart

// Quintique
InQuint, OutQuint, InOutQuint

// Sinusoïdale
InSine, OutSine, InOutSine

// Exponentielle
InExp, OutExp, InOutExp

// Circulaire
InCirc, OutCirc, InOutCirc

// Élastique
InElastic, OutElastic, InOutElastic

// Recul (Back)
InBack, OutBack, InOutBack

// Rebond
InBounce, OutBounce, InOutBounce

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

Utilisation de l’interpolation

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

États courants

ÉtatValeursDéclencheur
hoveron, offEntrée/sortie de la souris
pressed / downon, offAppui/relâchement de la souris
focuson, offPrise/perte de focus
disabledon, offWidget activé/désactivé
selectedon, offChangement de sélection

Propriétés animables

La plupart des uniforms de shader draw_* peuvent être animés :

  • Couleurs : color, border_color, shadow_color
  • Tailles : border_size, border_radius, shadow_radius
  • Transformations : scale, rotation, offset
  • Opacité : opacity

Lors de l’écriture de code

  1. Toujours définir default: pour l’état initial
  2. Utiliser Forward pour des transitions fluides
  3. Utiliser Snap pour les changements d’état instantanés (comme désactivé)
  4. Garder des durées courtes (0.1–0.3 s) pour une sensation réactive
  5. Animer les uniforms de shader dans draw_bg, draw_text, etc.

API Rust (Trait AnimatorImpl)

pub trait AnimatorImpl {
    // Animer vers un état
    fn animator_play(&mut self, cx: &mut Cx, state: &[LiveId; 2]);

    // Aller à un état directement (sans animation)
    fn animator_cut(&mut self, cx: &mut Cx, state: &[LiveId; 2]);

    // Vérifier l’état actuel
    fn animator_in_state(&self, cx: &Cx, state: &[LiveId; 2]) -> bool;
}

// Exemple d’utilisation
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));
        }
        _ => {}
    }
}

Lors de la réponse aux questions

  1. Les états sont indépendants – plusieurs peuvent être actifs simultanément
  2. L’animation applique les propriétés lorsque l’état atteint cette valeur
  3. from définit COMMENT animer, apply définit QUOI animer
  4. Makepad effectue automatiquement une interpolation entre les valeurs anciennes et nouvelles
  5. Utilisez la macro id!(state.value) pour faire référence aux états d’animation dans Rust

Limitations

  • N’utilisez cette compétence que lorsque la tâche correspond clairement au champ décrit ci-dessus.
  • Ne considérez pas le résultat comme un substitut à une validation, un test ou une revue d’expert spécifique à l’environnement.
  • Arrêtez-vous et demandez des clarifications si les entrées, permissions, limites de sécurité ou critères de succès requis sont absents.

Individual skills in this repo

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

ASoudy/AGS

Advanced JavaScript animation library skill for creating complex, high-performance web animations.

ASoudy/AGS

Astropy is the core Python package for astronomy, providing essential functionality for astronomical research and data analysis.

ASoudy/AGS

Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown/MDX support.

ASoudy/AGS

One sentence - what this skill does and when to invoke it

ASoudy/AGS

Audit and fix animation performance issues including layout thrashing, compositor properties, scroll-linked motion, and blur effects. Use when animations stutter, transitions jank, or reviewing CSS/JS animation performance.

ASoudy/AGS

Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.

ASoudy/AGS

Pull a YouTube video transcript into a queryable markdown vault with yt-dlp subtitle discovery, VTT cleanup, metadata frontmatter, and capture-seed stubs.

ASoudy/AGS

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

ASoudy/AGS

Generates high-converting Next.js/React landing pages with Tailwind CSS. Uses PAS, AIDA, and BAB frameworks for optimized copy/components (Heroes, Features, Pricing). Focuses on Core Web Vitals/SEO.

ASoudy/AGS

AI-powered animation tool for creating motion in logos, UI, icons, and social media assets.

ASoudy/AGS

Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.

ASoudy/AGS

Next.js App Router principles. Server Components, data fetching, routing patterns.

ASoudy/AGS

Expert integration of Supabase Auth with Next.js App Router

ASoudy/AGS

React and Next.js 14+ application development with App Router, Server Components, TypeScript, Tailwind CSS, and modern frontend patterns.

ASoudy/AGS

Best practices for Remotion - Video creation in React

ASoudy/AGS

Generate walkthrough videos from Stitch projects using Remotion with smooth transitions, zooming, and text overlays

ASoudy/AGS

Seek and analyze video content using Memories.ai Large Visual Memory Model for persistent video intelligence

ASoudy/AGS

Writes complete, structured landing pages optimized for SEO ranking, AEO citation, and visitor conversion. Activate when the user wants to write or generate a landing page for a product, service, or offer.

ASoudy/AGS

Three.js animation - keyframe animation, skeletal animation, morph targets, animation mixing. Use when animating objects, playing GLTF animations, creating procedural motion, or blending animations.

ASoudy/AGS

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

Skills associés