An interactive, kid-friendly visualizer for the JavaScript event loop and execution model. Built with Svelte, Vite, Tailwind CSS, Three.js, and GSAP.
Kid Mode |
Pro Mode |
3D Engine |
Basic Scenarios:
Advanced Scenarios:
prefers-reduced-motion)# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
Open the dev server URL (typically http://localhost:5173) in your browser. Use the mode selector and scenario dropdown to explore different visualizations.
# Linting
npm run lint # Check for issues
npm run lint:fix # Auto-fix issues
# Formatting
npm run format # Check formatting
npm run format:write # Auto-format code
# Testing
npm run test:unit # Run Vitest unit tests
npm run test:e2e # Run Playwright E2E tests
npm run test:all # Run all tests
All tests include:
src/
โโโ App.svelte # Main app component with controls
โโโ lib/
โ โโโ Stage.svelte # 2D SVG visualization stage
โ โโโ NewJSEngine3D.svelte # 3D visualization container
โ โโโ Controls.svelte # Playback controls
โ โโโ Legend.svelte # Visual legend
โ โโโ Token.svelte # Animated task tokens
โ โโโ sim/
โ โ โโโ engine.ts # Deterministic simulation runner
โ โ โโโ scenarios.ts # Predefined scenario scripts
โ โ โโโ types.ts # TypeScript types
โ โโโ jsengine3d/
โ โโโ JSEngine3D.ts # Core 3D engine
โ โโโ components/ # 3D component modules
โ โโโ CallStack.ts
โ โโโ WebAPIs.ts
โ โโโ MicrotaskQueue.ts
โ โโโ MacrotaskQueue.ts
โ โโโ EventLoop.ts
โ โโโ ExecutionFlow.ts
โโโ tests/
โ โโโ e2e/ # Playwright E2E tests
โโโ docs/ # Comprehensive documentation
MVP Complete โ All core features implemented:
In Progress:
See docs/tasks.md for detailed status.
MIT โ see LICENSE
Contributions are welcome! Please read the documentation in docs/ to understand the architecture and workflow. Always work in a feature branch (never directly in main).
Made with โค๏ธ to help everyone understand JavaScript's magic โจ