Celebration Animation Generator
Overview
This skill generates self-contained p5.js celebration animation modules for the reading-for-kindergarten intelligent textbook project. Each animation is a single JavaScript file that can be copied into any MicroSim folder to provide visual celebration feedback when students complete tasks correctly.
When to Use This Skill
Use this skill when users request:
- Creating a new celebration animation (e.g., "baseballs exploding", "butterflies flying")
- Adding particle effects for student rewards
- Generating visual feedback animations for educational games
- Expanding the celebration animation library
Workflow
Step 1: Parse the Animation Request
Extract from the user's description:
- Object/Shape: What is being animated (baseballs, hearts, butterflies, etc.)
- Motion Pattern: How it moves (exploding, floating, falling, zooming, etc.)
- Origin Point: Where it starts (bottom center, top, sides, center, etc.)
- Suggested Name: Derive a kebab-case filename (e.g., "baseball-explosion.js")
Step 2: Generate the Animation File
Create a new JavaScript file in /docs/sims/shared/animations/ following the template pattern in references/animation-template.md.
Key requirements:
- Use a unique particle array name (e.g.,
baseballExplosionParticles)
- Use a unique suffix for helper functions to avoid conflicts (e.g.,
drawBaseballBE())
- Include all four standard API functions:
create[Name](params, speedMultiplier) - Initialize particles
updateAndDraw[Name]() - Physics and rendering
is[Name]Active() - Check if animation is playing
clear[Name]() - Stop animation immediately
- Support
speedMultiplier parameter (0.5=slow, 1.0=medium, 1.8=fast)
- Use the standard rainbow color palette for variety
Step 3: Update the Animation Library Tester
After creating the animation file, update /docs/sims/animation-lib-tester/ to include the new animation:
- main.html: Add a new
<script> import for the animation file
- animation-lib-tester.js:
- Add the animation name to the
animationTypes array
- Add
updateAndDraw[Name]() call in the draw() function
- Add
clear[Name]() call in the triggerCelebration() function
- Add a new case in the switch statement to trigger the animation
Step 4: Update the README
Add the new animation to /docs/sims/shared/animations/README.md:
- Add row to the "Available Animations" table
- Add API documentation section with function signature and description
Animation Patterns Reference
Motion Patterns
| Pattern |
Description |
Example Use |
| Burst Up |
Objects shoot upward from a point with gravity |
Book Burst, Alphabet Fireworks |
| Float Up |
Objects gently float upward |
Yellow Stars, Balloons |
| Fall Down |
Objects fall from top |
Happy Star Sprinkle, Confetti, Spark Shower |
| Explode Out |
Objects radiate outward from center |
Rainbow Sparkle Burst, Magic Book Bloom |
| Zoom Across |
Objects move horizontally |
Reading Rocket Zoom |
| Pop/Bounce |
Objects appear, bounce, then pop |
Giggle Glitter Pop |
Standard Color Palette
const rainbowColors = [
'#FF6B6B', // red
'#FF8E53', // orange
'#FFD93D', // yellow
'#6BCB77', // green
'#4D96FF', // blue
'#9B59B6', // purple
'#FF6B9D' // pink
];
Common Particle Properties
{
x, y, // Position
vx, vy, // Velocity
size, // Size/radius
alpha, // Transparency (0-255)
fadeRate, // How fast alpha decreases
rotation, // Current angle
rotationSpeed, // Angular velocity
color, // p5.js color object
gravity, // Downward acceleration (for burst patterns)
wobble, // Oscillation factor (for floating patterns)
trail: [] // Array of past positions (for trail effects)
}
File Naming Convention
- Use kebab-case for filename:
baseball-explosion.js
- Use PascalCase for function names:
createBaseballExplosion()
- Use camelCase for particle array:
baseballExplosionParticles
- Add unique suffix to helper functions:
drawBaseballBE()
Example: Creating "Baseball Explosion"
For request: "Baseballs exploding from the bottom middle of the screen"
- Filename:
baseball-explosion.js
- Motion: Burst Up pattern (like Book Burst)
- Object: Baseball with red stitching
- Functions:
createBaseballExplosion(centerX, startY, speedMultiplier)
updateAndDrawBaseballExplosion()
isBaseballExplosionActive()
clearBaseballExplosion()
Resources
references/animation-template.md
Contains the complete template for a new animation file with all required functions and documentation structure.
1---2name: celebration-animation-generator3description: This skill generates self-contained p5.js celebration animations for educational MicroSims. Use this skill when users request creating new celebration animations, particle effects, reward animations, or visual feedback for student achievements. The skill creates a new animation JavaScript file in /docs/sims/shared/animations/ and integrates it with the animation-lib-tester MicroSim for testing.4---5
6# Celebration Animation Generator
7
8## Overview
9
10This skill generates self-contained p5.js celebration animation modules for the reading-for-kindergarten intelligent textbook project. Each animation is a single JavaScript file that can be copied into any MicroSim folder to provide visual celebration feedback when students complete tasks correctly.
11
12## When to Use This Skill
13
14Use this skill when users request:
15- Creating a new celebration animation (e.g., "baseballs exploding", "butterflies flying")
16- Adding particle effects for student rewards
17- Generating visual feedback animations for educational games
18- Expanding the celebration animation library
19
20## Workflow
21
22### Step 1: Parse the Animation Request
23
24Extract from the user's description:
251. **Object/Shape**: What is being animated (baseballs, hearts, butterflies, etc.)
262. **Motion Pattern**: How it moves (exploding, floating, falling, zooming, etc.)
273. **Origin Point**: Where it starts (bottom center, top, sides, center, etc.)
284. **Suggested Name**: Derive a kebab-case filename (e.g., "baseball-explosion.js")
29
30### Step 2: Generate the Animation File
31
32Create a new JavaScript file in `/docs/sims/shared/animations/` following the template pattern in `references/animation-template.md`.
33
34Key requirements:
35- Use a **unique particle array name** (e.g., `baseballExplosionParticles`)
36- Use a **unique suffix for helper functions** to avoid conflicts (e.g., `drawBaseballBE()`)
37- Include all four standard API functions:
38 - `create[Name](params, speedMultiplier)` - Initialize particles
39 - `updateAndDraw[Name]()` - Physics and rendering
40 - `is[Name]Active()` - Check if animation is playing
41 - `clear[Name]()` - Stop animation immediately
42- Support `speedMultiplier` parameter (0.5=slow, 1.0=medium, 1.8=fast)
43- Use the standard rainbow color palette for variety
44
45### Step 3: Update the Animation Library Tester
46
47After creating the animation file, update `/docs/sims/animation-lib-tester/` to include the new animation:
48
491. **main.html**: Add a new `<script>` import for the animation file
502. **animation-lib-tester.js**:
51 - Add the animation name to the `animationTypes` array
52 - Add `updateAndDraw[Name]()` call in the `draw()` function
53 - Add `clear[Name]()` call in the `triggerCelebration()` function
54 - Add a new case in the switch statement to trigger the animation
55
56### Step 4: Update the README
57
58Add the new animation to `/docs/sims/shared/animations/README.md`:
59- Add row to the "Available Animations" table
60- Add API documentation section with function signature and description
61
62## Animation Patterns Reference
63
64### Motion Patterns
65
66| Pattern | Description | Example Use |
67|---------|-------------|-------------|
68| Burst Up | Objects shoot upward from a point with gravity | Book Burst, Alphabet Fireworks |
69| Float Up | Objects gently float upward | Yellow Stars, Balloons |
70| Fall Down | Objects fall from top | Happy Star Sprinkle, Confetti, Spark Shower |
71| Explode Out | Objects radiate outward from center | Rainbow Sparkle Burst, Magic Book Bloom |
72| Zoom Across | Objects move horizontally | Reading Rocket Zoom |
73| Pop/Bounce | Objects appear, bounce, then pop | Giggle Glitter Pop |
74
75### Standard Color Palette
76
77```javascript
78const rainbowColors = [
79 '#FF6B6B', // red
80 '#FF8E53', // orange
81 '#FFD93D', // yellow
82 '#6BCB77', // green
83 '#4D96FF', // blue
84 '#9B59B6', // purple
85 '#FF6B9D' // pink
86];
87```
88
89### Common Particle Properties
90
91```javascript
92{
93 x, y, // Position
94 vx, vy, // Velocity
95 size, // Size/radius
96 alpha, // Transparency (0-255)
97 fadeRate, // How fast alpha decreases
98 rotation, // Current angle
99 rotationSpeed, // Angular velocity
100 color, // p5.js color object
101 gravity, // Downward acceleration (for burst patterns)
102 wobble, // Oscillation factor (for floating patterns)
103 trail: [] // Array of past positions (for trail effects)
104}
105```
106
107## File Naming Convention
108
109- Use kebab-case for filename: `baseball-explosion.js`
110- Use PascalCase for function names: `createBaseballExplosion()`
111- Use camelCase for particle array: `baseballExplosionParticles`
112- Add unique suffix to helper functions: `drawBaseballBE()`
113
114## Example: Creating "Baseball Explosion"
115
116For request: "Baseballs exploding from the bottom middle of the screen"
117
1181. **Filename**: `baseball-explosion.js`
1192. **Motion**: Burst Up pattern (like Book Burst)
1203. **Object**: Baseball with red stitching
1214. **Functions**:
122 - `createBaseballExplosion(centerX, startY, speedMultiplier)`
123 - `updateAndDrawBaseballExplosion()`
124 - `isBaseballExplosionActive()`
125 - `clearBaseballExplosion()`
126
127## Resources
128
129### references/animation-template.md
130Contains the complete template for a new animation file with all required functions and documentation structure.