DEV Community

Cover image for Rainbow 🌈 animation page background
Matt Ellen-Tsivintzeli
Matt Ellen-Tsivintzeli

Posted on • Edited on

1

Rainbow 🌈 animation page background

I was inspired by

to show off an old animation of mine. It's probably possible to do this with just CSS, so if you know how post it in the comments!

I had an idea to make balls zoom across the screen, in the colours of the rainbow. Here's the result (it can take a second to load, so be patient):

I wrote this before I knew about let and const, so please forgive that! In fact there are a few things I would change now, like using template strings. But, I suppose, if it isn't broken I shouldn't try to fix it :D

The frames are generated upfront, so the animation is just changing pictures, not calculating each frame. You can see the data-url updating in the page's background for each frame.

The speed of each ball is random.

If you save the background image, it will tile perfectly.

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs