@Dasher280I
on
Liquid-Simulation
This project is an interactive 2D fluid simulation built with HTML5 and vanilla JavaScript. Users can interact with the canvas by clicking, dragging, or touching to paint dynamic, swirling ink patterns while background particles react to the underlying velocity fields. It features a sleek, expandable settings menu styled with CSS frosted-glass effects, allowing users to customize stroke width, dissipation duration, brightness, and color themes—such as cyan, purple, green, orange, pink, or white—in real time. Programmatically, the simulation is driven by a grid-based Navier-Stokes physics engine that handles diffusion, advection, and pressure projection, rendering efficient pixel data via an offscreen canvas. Cross-platform usability is supported through pointer events paired with CSS rules that prevent unwanted mobile scrolling and block unintended drawing when interacting with the sidebar controls. A key technical challenge addressed during development was preventing the mathematical simulation from breaking or destabilizing under extremely fast inputs or overlapping forces, which was solved by implementing conditional logic that evaluates and updates maximum density increments rather than allowing runaway value accumulation.
- 4 devlogs
- 24h