Bioluminescence

Entry for CodePenChallenge April #2, 2025 - Card Glow

Fungi

Bioluminescent fungi emit a continuous yellowish-green light.

There are more than 100 known species of fungi which can glow, with the purpose to attract insects which will then spread their spores.

Jellyfish

Over 50% of jellyfish species produce some kind of bioluminescence, most as a deterrent to predators.

The ability also helps them attract prey and communicate. Some jellyfish have specialized bioluminescent organs.

Fireflies

Fireflies create their glow in their abdomen, and it's used for communication and mating.

Each species has a unique flash pattern and timing.

About

I wasn't too sure how I wanted to approach this week's challenge. But somehow I ended up thinking of glowing organisms.

I made a quick sketch of what I wanted - and went in fully expecting to use JavaScript for the fireflies.

To my pleasant surprise, CSS is able to animate along a path! 🥳 (Guide linked in the credits below) and so everything was achieved without JS.

I did have to inline the SVG designs to avoid CORS-policy blocking them from loading (I'm still trying to figure out an alternative), so, sorry for the SVG spam in the HTML. I moved it down to the bottom however so it doesn't clutter up the code for the cards too much.

All in all, this was a fun challenge that got me thinking outside the box, and learning about life that glows.

Any Problems?

Haha yup! Safari again. My initial approach was to use filter: drop-shadow but this wouldn't show in Safari for some reason, either my SVG or what I was doing to them (movement and opacity animation) was breaking the effect there.

So, I had to re-work it with SVG Filters instead. This was a bit of a learning experience, and also removed my ability to use CSS Variables to define the colour so easily.

Oh! Another problem I noticed (Only in Safari) is that the animating fireflies leave a bit of trail behind them? It looks cool though, so I don't mind leaving it in. It's not a bug, it's a feature.