CSS

One page on this site had a list of all countries I had ever visited. It was kinda boring. So I decided to see if there was a better way of displaying the data. I thought: “How about a map?” Then I thought: “How about an interactive map?” That’s when I realized that would probably need some Javascript. And while I do use some on this website, I prefer not to. “Could there be a CSS-only way of doing it now?”, my mind wondered. So I went to my preferred search engine and started searching for CSS-only world maps.

Turns out what I should have been looking for was SVG maps, but I got there with my search as well. SVG allows for a textual way to represent shapes. The text is like a list of coordinates and they can be rendered as a shape by your browser. The one I eventually decided to base mine on was amazing. The author had basically plotted out the entire globe in a Mercator projection. Country by country—all in SVG code. He added some CSS for coloring and hover effects.

I wanted to make it my own, so I gave it my colors, added my background, made it work with dark and light mode and added sections you can zoom into, so small countries can be found more easily per world part. Doing all of this required a lot of CSS work, but the result is pretty cool—even if I say so myself.

I had forgotten how fun CSS really is.

CSS is awesome

And it’s gotten so much more powerful! There are things CSS can do now that were impossible some years back. A couple of years ago it blew my mind that CSS had gotten variables. Now I can even do calculations in CSS!

All of this is to say, I’ve had a great deal of fun playing with modern CSS and it got me looking for more interesting ways of displaying data on my site. I have a list of software I use. This is boring and can be more fun. How about presenting this as a Pokémon-style card deck instead? For sure someone has animated cards in CSS… Spoiler: yes they have and I am using their code as a base to make my own.

So—expect more playthings using CSS in my curiorama soon(ish)!