DEV Community

Mohamed Idris
Mohamed Idris

Posted on

I made a swing boat that reacts to doom scrolling

When I was a kid, I tried the swing boat a few times and hated it. It made me dizzy. The kind of dizzy where you are not sure if it is fun anymore. You start slow, then someone keeps pushing, and before you know it you are too high and your stomach does not agree.

I got that same feeling recently, but from scrolling.

Doom scrolling is that thing you do when you open your phone for no reason and close it twenty minutes later having seen nothing worth remembering. Your finger goes up and down, up and down, the same motion as a swing. Your brain sits there getting rocked back and forth until it is numb. That is the brain rot part. Not dramatic, just slow and quiet. Your attention gets shorter. Your mood gets worse. You feel tired but you also cannot stop.

I kept thinking about how the finger movement looks exactly like a swing. Up and down, rhythm, momentum. The more you do it, the harder it is to stop. Same physics, different damage.

So I made a small thing to show that.

What it does

It is a red swing boat hanging in the dark. When you scroll, it swings. Keep scrolling and it goes higher. Stop, and it slowly dies down the way a real swing does. Short messages appear below the boat as the energy builds up. They start gentle. They do not stay that way.

How it works

The whole thing is a single HTML file with no dependencies. The boat is an inline SVG so CSS and JavaScript can interact with it directly. The swing uses real pendulum physics, gravity and damping included, so it coasts and rocks naturally after you stop. Scroll speed feeds into the angular velocity, which means the harder you scroll the higher the swing goes.

The scroll itself is captured with a wheel event and preventDefault, so the page never actually scrolls. There is nothing to read. Just the boat.

Try it

Demo: github.com/edriso/doomswing

Top comments (0)