Examples demonstrating the core-animation crate's builder APIs.
cargo run --example <name>Recordings (GIF and MP4) can be automatically generated using the provided script:
./tools/update-example-screenshots.shThe script applies a patch that adds recording support, runs all examples, and reverts the patch afterward.
Prerequisites:
- ImageMagick (
brew install imagemagick) - ffmpeg (
brew install ffmpeg)
Basic layer example with animated shapes. Demonstrates CALayer and CAShapeLayer with the builder APIs and GPU-accelerated animations using .animate().
cargo run --example basic_layersBreathing circle - a soft pulsing orb with coordinated scale and opacity. Demonstrates multiple animations on one layer with phase_offset coordination.
cargo run --example breathing_circleParticle emitter using CAEmitterLayerBuilder with the closure-based particle configuration.
cargo run --example emitterLoading spinner with smooth rotating indicator using linear easing. Demonstrates TransformRotation animation with Easing::Linear for constant rotational speed.
cargo run --example loading_spinnerNeon glow - retro neon sign effect with pulsing shadows. Demonstrates shadow property animations (ShadowRadius, ShadowOpacity) to create a glowing neon effect.
cargo run --example neon_glowShowcases all ParticleImage types side by side:
soft_glow- Radial gradient (top-left)circle- Solid circle (top-right)star- Multi-pointed star (bottom-left)spark- Elongated streak (bottom-right)
cargo run --example particle_imagesDemonstrates PointBurstBuilder - a convenience API for the common pattern of particles bursting from a point in all directions.
cargo run --example point_burstRipple rings - water ripple effect with concentric expanding rings. Demonstrates:
KeyPath::TransformScalefor ring expansionKeyPath::Opacityfor rings fading as they expandKeyPath::Custom("lineWidth")for pulsing stroke widthphase_offsetfor staggered timing across multiple ringsEasing::Outfor realistic ripple physics
cargo run --example ripple_ringsStaggered dots - classic loading indicator with phase-offset animations. Demonstrates using phase_offset to create staggered timing across multiple elements.
cargo run --example staggered_dotsBasic window creation with the WindowBuilder API.
cargo run --example window_builder








