A few days ago, I wrote about getting bored with flat, static websites and trying to build something that actually reacts to the user. I wanted the DOM to feel physical.
For my next update, my original plan was to go completely overboard — I'm talking HTML5 Canvas, complex math, Hooke's Law for spring physics, and particles that react to cursor velocity.
Here is what I added to make the UI feel even more alive:
1.True Magnetic UI (Hooke's Law in JS) 🧲
In the first version, elements just followed the cursor. Now, they have mass and tension.I implemented a physics engine for the buttons using Hooke’s Law ($F = -kx$). When your cursor gets within a certain radius, the button snaps towards it. But the magic happens when you pull away — it doesn't just snap back; it wobbles and settles down with friction.












