Communitygithub.com

AbobakrDiara61/railway-system

CRITICAL : Utilisé pour le système d'animation Makepad. Se déclenche sur : makepad animation, makepad animator, makepad hover, makepad state, makepad transition, "from: { all: Forward", makepad pressed, makepad 动画, makepad 状态, makepad 过渡, makepad 悬停效果

Qu'est-ce que railway-system ?

Cette compétence spécialisée permet aux agents IA (comme Claude Code, Cursor, ou Codex) de générer, déboguer et expliquer le système d'animation de Makepad, un framework d'UI Rust. Elle couvre les animations d'état (hover, pressed, focus, disabled), les transitions, les fonctions d'easing, les keyframes, et l'API Rust `AnimatorImpl`. Utile pour tout développeur créant des interfaces interactives avec Makepad, elle fournit des patrons de code prêts à l'emploi et une référence complète. La compétence s'appuie sur un fichier de documentation local (`animation-system.md`) et peut suggérer sa mise à jour via la commande `/sync-crate-skills makepad --force`. Elle décrit notamment la structure de l'animateur, les types de timeline (Forward, Snap, Loop, BounceLoop), les fonctions d'easing (Linear, InQuad, OutCubic, InElastic, etc.), et les propriétés animables (couleurs, tailles, transformations, opacité).

Compatible avec✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/AbobakrDiara61/railway-system/tree/HEAD/frontend/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érer du code d'animation suivant les patrons ci-dessous
  • Répondant aux questions : Expliquer les états, transitions, timelines

Quand l'utiliser

  • Vous devez construire ou déboguer des animations, transitions, états de survol, ou timelines d'animateur dans Makepad.
  • La tâche implique animator, des changements d'état, des fonctions d'easing, des keyframes, ou un retour d'interaction visuelle.
  • Vous souhaitez des patrons d'animation spécifiques à Makepad plutôt que des conseils génériques d'UI Rust.

Documentation

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

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

Patrons avancés

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

PatronDescription
06-animator-basicsFondamentaux de l'animateur
07-easing-functionsFonctions d'easing et timing
08-keyframe-animationKeyframes 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 listé(s) ci-dessus
  2. Si la lecture échoue ou si le fichier est vide :
    • Informer l'utilisateur : "本地文档不完整,建议运行 /sync-crate-skills makepad --force 更新文档"
    • Répondre quand même sur la base des patrons du SKILL.md + des connaissances intégrées
  3. Si le fichier de référence existe, intégrer son contenu dans la réponse

Patrons 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-états

<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 d'état initiale
{value} =Définition de valeur d'état (on, off, personnalisée)
from:Timeline de transition
apply:Propriétés à animer

Types de timeline (énumération Play)

TypeDescription
Forward { duration: f64 }Animation linéaire avant
SnapChangement instantané, sans transition
Reverse { duration: f64, end: f64 }Animation inverse
Loop { duration: f64, end: f64 }Animation en boucle
BounceLoop { duration: f64, end: f64 }Animation de rebond en boucle

Fonctions d'easing (énumération 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

// Retour
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'easing

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

États courants

ÉtatValeursDéclencheur
hoveron, offEntrée/sortie de souris
pressed / downon, offAppui/relâchement de 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 des changements d'état instantanés (comme désactivé)
  4. Garder les durées courtes (0.1-0.3s) pour une sensation de réactivité
  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]);

    // Passer à un état (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 interpole automatiquement entre les anciennes et nouvelles valeurs
  5. Utilisez la macro id!(state.value) pour référencer les états d'animation en Rust

Limitations

  • Utilisez cette compétence uniquement lorsque la tâche correspond clairement au périmètre décrit ci-dessus.
  • Ne considérez pas la sortie 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, autorisations, limites de sécurité ou critères de succès requis sont manquants.

Individual skills in this repo

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

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

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.

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

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.

AbobakrDiara61/railway-system

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.

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

Best practices for Remotion - Video creation in React

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

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.

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

Automate TikTok tasks via Rube MCP (Composio): upload/publish videos, post photos, manage content, and view user profiles/stats. Always search tools first for current schemas.

AbobakrDiara61/railway-system

Video and audio perception, indexing, and editing. Ingest files/URLs/live streams, build visual/spoken indexes, search with timestamps, edit timelines, add overlays/subtitles, generate media, and create real-time alerts.

AbobakrDiara61/railway-system

Upload, stream, search, edit, transcribe, and generate AI video and audio using the VideoDB SDK.

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

Automate YouTube tasks via Rube MCP (Composio): upload videos, manage playlists, search content, get analytics, and handle comments. Always search tools first for current schemas.

AbobakrDiara61/railway-system

Extract transcripts from YouTube videos and generate comprehensive, detailed summaries using intelligent analysis frameworks

Skills associés