"""Demo: Animation Gallery This script demonstrates all available animations in Burme-Coder-Max. """ import sys import time from pathlib import Path sys.path.insert(0, str(Path(__file__).parent.parent / "src")) from animations import Spinner, ProgressBar, ParticleBurst, TypingEffect from animations.particle_effect import SimpleConfetti def demo_spinner(): """Demonstrate spinner animation.""" print("\nšŸ”„ Loading Spinner Demo") print("=" * 40) print("\nBasic spinner:") with Spinner("Processing your request"): for _ in range(20): time.sleep(0.05) print("āœ“ Complete!\n") def demo_progress(): """Demonstrate progress bar animation.""" print("\nšŸ“Š Progress Bar Demo") print("=" * 40) print("\nDefault progress bar:") for i in ProgressBar(range(50), description="Downloading"): time.sleep(0.03) print("✦ Progress bar demo complete!\n") def demo_particles(): """Demonstrate particle burst effect.""" print("\n✨ Particle Burst Demo") print("=" * 40) print("\nšŸŽ‰ Celebration effect:") burst = ParticleBurst(count=40) burst.center_x = 50 burst.center_y = 12 burst.explode() print("✦ Particle burst complete!\n") def demo_typing(): """Demonstrate typing effect.""" print("\nāŒØļø Typing Effect Demo") print("=" * 40) effect = TypingEffect("Hello from Burme-Coder-Max! šŸ§‘ā€šŸ’»", delay=0.06) effect.animate() print() def demo_confetti(): """Demonstrate confetti effect.""" print("\nšŸŽŠ Confetti Demo") print("=" * 40) confetti = SimpleConfetti(duration=1.5) confetti.show() print() def main(): """Run all animation demos.""" print() print("ā•”" + "═" * 48 + "ā•—") print("ā•‘" + " šŸŽØ ANIMATION GALLERY ".center(48) + "ā•‘") print("ā•š" + "═" * 48 + "ā•") demos = [ ("Spinner", demo_spinner), ("Progress Bar", demo_progress), ("Particle Burst", demo_particles), ("Typing Effect", demo_typing), ("Confetti", demo_confetti), ] for name, demo_func in demos: try: demo_func() time.sleep(0.3) except KeyboardInterrupt: print("\n\nInterrupted by user") break print("ā•”" + "═" * 48 + "ā•—") print("ā•‘" + " ✨ DEMO COMPLETE ".center(48) + "ā•‘") print("ā•š" + "═" * 48 + "ā•") if __name__ == "__main__": main()