All MicroEvals
Create a complete, single-file HTML app (including embedded ...
Create MicroEval
Header image for Create a complete, single-file HTML app (including embedded ...

Create a complete, single-file HTML app (including embedded ...

Prompt

Create a complete, single-file HTML app (including embedded CSS inside <style> and JavaScript inside <script>) that implements an interactive "Interactive Physics Particle Sandbox & Celestial Gravity Simulator". Requirements: 1. Visuals & Polish: - Dark mode UI with a glowing cyber/neon aesthetic. - Smooth HTML5 Canvas rendering running at 60 FPS. - Clean floating UI overlay (control sidebar) to tweak parameters in real-time. 2. Physics Engine Features: - Particle Generation: Ability to spawn interactive particles with adjustable density, mass, velocity, and color spectrums. - Celestial Gravity: Toggleable heavy central bodies (black holes or stars) that pull particles with adjustable gravitational force ($F = G \frac{m_1 m_2}{r^2}$). - Particle Collisions: Elastic/inelastic collisions between particles with visual feedback (sparks or color shifting on impact). - Mouse Interaction: Mouse click/drag acts as a gravitational attractor or repulsive force pulse. 3. Performance & Controls: - Must run smoothly up to 2,000+ active particles. - UI Controls: Sliders for Gravity, Friction/Damping, Particle Count, Collision Elasticity, and Trail Emitter effect toggles. - Include a "Preset" dropdown (e.g., "Galaxy Spiral", "Explosive Supernova", "Chaos Pendulum Grid"). 4. Execution: - Return ONLY executable HTML code inside a single html code block. - No external libraries, frameworks, or dependencies—pure vanilla JS and native CSS/Canvas APIs. - Must work immediately upon opening in a browser.

A system prompt was added to support web rendering

Drag to resize
Drag to resize
Drag to resize