Playfulness In Code: Supercharge Your Learning by Having Fun
Tags: javascript, css, coding
Published: 2021-01-16 15:18:04

I’m often asked where the ideas come from. How do I know the things I do? Having ten years of experience in development helps, but what supercharged my learning was pushing myself to build the things that came into my head, however unusual.

I developed an appetite for building things that aren’t ‘the norm.’ With that mindset, every idea becomes an opportunity to try something new.

One of my main mantras is to make learning fun. It’s something people have come to know me by. [Tuggable SVG light bulbs with GreenSock](https://codepen.io/jh3y/pen/VwjgdLj), [Vincent van Git](https://vincent-van-git.netlify.app/), [Useless machines with React](https://codepen.io/jh3y/pen/LYNZwGm)… plenty more besides. You can read the docs, you can follow the tutorials, but wouldn’t you be more motivated by trying to make something unique, something no one else has seen before?

Here’s how having fun can supercharge your learning. Throw a record on, pick a mood, and let’s get to it.

{% codepen https://codepen.io/jh3y/pen/NWRKMQm %}


## Wanting to Learn

There is a big caveat to everything I’m about to say: if you’re not motivated to learn, you won’t learn. Even if you know it’s something you need to learn. The need is optional, but the want is not. Odds are that if you don’t want to do something, you’re not going to do it. After all, most of you reading this are likely out of school now. You’re not obligated to prepare for that exam or get that grade. You have your own free will.

In most cases, learning is driven by some goal or target. An extreme example would be the goal of paying your bills. “I must learn X for my job, to keep my job and pay my bills”. This article isn’t about those scenarios. It’s about the times when it’s not necessary. (You can only rebuild your portfolio so many times, after all.)

I have to go back quite a bit to think about how I turned out to be writing this article. I wasn’t always an extracurricular learner or even a creative coder. I actually started out as a middleware developer. I finished my degrees, got my job, and I was happy doing the eight-hour day and leaving it there. It wasn’t until towards the end of my first role that I met the “front-end” and started dabbling in it.

The first thing I remember making was a basic Trello clone. It was an opportunity to try out HTML5 “Drag and Drop” and the `contenteditable` attribute. It was very basic, and you could create tasks and move them about. I put it in a jsfiddle or jsbin and shared it. Some colleagues thought it was cool, and that was that. Unfortunately, I’ve lost that demo now, but here’s a quick recreation from memory.

{% codepen https://codepen.io/jh3y/pen/dypbOww %}

Fast forward a little and CSS animation and 3D transforms were on my radar. In fact, 3D CSS and animation were some of the first things I spent time playing with. One thing I started with was creating a collection of loading spinners. If I had a few moments, I’d mess about with different properties and see what I could make while adding them to a file all the time. Later, [I’d turn it all into a GitHub project](https://github.com/jh3y/whirl).

A pattern was emerging of me wanting to make things. And when an opportunity to try something came along, I’d pair that with an idea and see what happened. Further adjustments to that Trello clone got valuable feedback when I posted it on Hacker News. That spurred me to create new versions of it. I haven’t touched it for a few years, but it [still lives over on Github](https://jh3y.github.io/tyto).

A few side projects and some time after that came to a winking bear demo, which I posted on CodePen. CodePen was new to me at this point.

{% codepen https://codepen.io/jh3y/pen/jOMNyOB %}

The next day, I was on a client site and someone said, “I saw your pen on the front page of CodePen! Nice!”. I said “Thanks!”, but I had no idea what that meant until I went and checked. And there was the winking bear! This was a catalyst for my “playfulness” with code, where the pattern flipped. I went from “I want to learn X, so how do I fit it into Y” to “I want to make Y, can I learn X to do it?”.

That’s what motivates me and  **makes learning fun**. It could work for you, too! Instead of the thought of learning X being the driving force, it’s the thought of making Y. The fact you’re learning new skills is a bonus. As my skills have developed, the ability to make my demos more and more “playful” is noticeable. But it all began from making things for the sake of making things and learning something. “How would you do that?” and not “How can you learn that?”. As your skills develop, you too can become more playful with your code. And the two will complement each other.

## Playful Coding

Where do all the ideas come from? Well, it’s a good question. We can’t force creativity, but there are things I can suggest that might help convince it to appear.

### Document Everything

Get a notebook, start a Trello board, open a Notion account. Find a way to take notes of your ideas.  **No idea is a bad idea. Repeat. No idea is a bad idea.**  I write down every little spark that comes into my head. That’s why I’d suggest a digital solution you can install on your phone. You never know when you’ll have an idea, and it will be annoying the next day when you can’t remember it. Trust me, I’ve been there.

Here are five random things from my “List” that all trigger something for me:

- Red and white toadstools;
- Impossible checkbox spin-off;
- Peter Griffin blinds in CSS;
- Power-up screen bear glare huge parallax from the game documentary;
- Bread Array slice/splice cartoon.

Some of that might make sense. Some of it might not. The important thing is to write down keywords that trigger thoughts of something I want to make. I can tell you the first idea is a Procreate drawing, and the fourth is from a show I watched on Netflix. There was a part in the show where a character’s face almost parallaxes on the screen. I thought it would make an amusing Twitch overlay if I can make it. On the list they go.

Another solution I’ve recently adopted and would also suggest, keep notebooks dotted about. One by the side of the bed is great! It means you don’t need to get out of bed to write down that idea you just had. Your note-taking needn’t be limited to ideas either. Document your processes and other things as you go. You’ll find that scribbling things down can often spark new ideas.

### Sparking ideas

That leads to “Where?”. Where can you grab an idea from? The answer here is very cliché: anywhere! The more I speak about it with people, the more it feels like an instinct you refine.  **Plucking ideas out of nothing is something you train your mind to do over time.**

To kickstart things, here’s a list of places you can go to start:

#### CodePen

CodePen is a great resource. Have a browse, see what people are making. Could you make something similar? Someone created an Elephant with CSS, can you create a Giraffe? CodePen does a weekly prompt via email challenging you to make something. There will be a theme or certain criteria and you can follow the tags to see what people are making. And then there’s [the Spark](https://codepen.io/spark/), CodePen’s newsletter which will usually be full of cool things. There are loads of great demos on the site, people giving feedback. It’s an inspiring place.

{% codepen https://codepen.io/jh3y/pen/NWRKdxd %}

#### Media (TV, Books, Film)

You can get a lot of ideas from the media. Seen a cool TV advert? Can you recreate part of it? How about the opening credits of a film? Lots of things pop up that can spark a little creativity. Books are another great resource — fiction and nonfiction. I created this HSL slider after reading _[Refactoring UI](https://refactoringui.com/book/)_:

{% codepen https://codepen.io/jh3y/pen/zYKONBJ %}

And this is from the closing credits of the Netflix series, “Love, Death, and Robots”:

{% codepen https://codepen.io/jh3y/pen/rNMBjqo %}

#### Newsletters

Sign up for newsletters that interest you. You don’t have to read them all the time, but they’re there for you. I’ve already mentioned the CodePen one. [Codrops](https://tympanus.net/codrops/) is another great one for seeing a variety of demos. They also do an “Awesome Demos Roundup”. [CSS Tricks](https://css-tricks.com/newsletters/) is another with great reads and resources. Or, of course, [the _Smashing_ newsletter](https://www.smashingmagazine.com/the-smashing-newsletter/).

This demo below was created due to a challenge set in the [ViewBox](https://viewbox.club/) newsletter. And the idea was itself inspired by the film _Men in Black_ which I’d happened to watch twice that week.

{% codepen https://codepen.io/jh3y/pen/eYdOgdr %}

#### Muzli

I love this one. [Muzli](https://muz.li/) is a browser extension that fills your “New Tab” screen with design inspiration. Have a browse through this when opening a new tab and you’re bound to find some ideas. They also do a roundup for various things [over on Medium](https://medium.muz.li/). I’ve often picked up ideas from looking through these. Such as this demo inspired by [this roundup](https://medium.muz.li/weekly-design-inspiration-230-6647c65c4edf). RamBear was a recreation of this [Dribbble shot](https://dribbble.com/shots/7780062-VFX-2D-Weapon-Fire-Tutorial-Game-Design-and-Animation) from “Gigantic” with a bear spin on it.

{% codepen https://codepen.io/jh3y/pen/ZEpzLBx %}

#### News & Seasonal

Current news and seasonal events are sure to get ideas firing. How about spooky demos for Halloween? I made this bear having an X-Ray because of a CodePen challenge set for Halloween.

{% codepen https://codepen.io/jh3y/pen/ZEpzLLo %}

Or remember when everything was cake? Yeah? I thought about making a 3D cake that you could interact with and it kinda went from there. My back catalog is full of demos that relate to current events.

{% codepen https://codepen.io/jh3y/pen/WNGeRpO %}

#### Dribbble

[Dribble](https://dribbble.com/) is a great site for checking out other people’s creative work, and it could spark some ideas of your own. It’s not unusual to see people recreating things they’ve seen on Dribbble. That said, if you do recreation, please credit the original work. It’s not “inspiration” if you take the original, recreate it, and take the credit. You take the opportunity from others to discover work from the original author.

#### Reddit

I’m not a big Reddit user myself. But, you can sometimes find interesting animations and things in various sub-Reddits. [/r/oddlysatisfying](https://www.reddit.com/r/oddlysatisfying/) has had the occasional animation that I’ve recreated. This [cubes animation](https://www.reddit.com/r/oddlysatisfying/comments/65ym9r/these_cubes/) was something I wanted to recreate. At the same time, I wanted to try GreenSock. So I paired the two and it was the first time I used GreenSock. Honestly, try searching for “oddlysatisfying cubes”.

{% codepen https://codepen.io/jh3y/pen/LYRPxWo %}

Years later, I’ve revisited this to build it in a different way. That allowed me to put a spin on it.

{% codepen https://codepen.io/jh3y/pen/JjRPEwP %}

#### Twitter

If you have a Twitter account, follow people who interest and inspire. They could be in a completely different field, but their work may well spark ideas for you. There are some fantastic accounts out there. One account that springs to mind is [@beesandbombs](https://twitter.com/beesandbombs). They upload real cool animations that often have optical illusions within them. I’ve often thought “I’ll make that,” and then proceeded to try some way of making it whether it be CSS, HTML5 Canvas, and so on. It’s a great way to train to work on the finer details.

{% twitter 1344448685262970892 %}

#### Anywhere Else

I could keep listing sources of inspiration, but it can be different for everyone. These are the ones that work for me. But consider anything. Things you see on your travels, conversations, or things around the house.

### Turning Ideas into Demos && Projects

You’ve got your ideas. But, there’s no rush to make them. You don’t have to make everything you note down. In fact, odds are you’ll never have time to make everything. That’s something you have to deal with. It’s something I struggled with the better I got at documenting my ideas.

{% codepen https://codepen.io/jh3y/pen/xxEKgrB %}

If you browse [my CodePen history](https://codepen.io/jh3y/pens/public) it’s like a timeline for what I’ve been learning and exploring, driven by ideas and inspiration. The thought of making something, not learning something. I don’t usually have time to look back at old demos but this article has prompted that. It’s interesting to look back and remember what drove what.

For example, I wanted to create Masonry layouts, so I learned the technique for it using flex. I wanted to create star fields, so I learned HTML5 Canvas rendering techniques. In fact, I remember learning the latter in the mornings over breakfast.

{% codepen https://codepen.io/jh3y/pen/yLaBgoK %}

This lava lamp was prompted by a CodePen challenge. I’d seen a bit about SVG filters but not had anything I wanted to try them out on. I wanted to make a lava lamp with CSS and it was a perfect opportunity.

Make for the sake of making. Don’t overthink it. Be driven by the idea because you will learn things. You’ll probably learn a lot more things than you ever expected. It can and will  **strengthen your ability to rise to a challenge**  or switch context at the drop of a hat. These are skills that can really empower your career as a developer.

Document your ideas and when you want to make them, go for it! If your first focus is the “How” or the “Why”, that idea might stick around on your list for some time.

### Don’t Dwell On The ‘Why’ And ‘How’

I make a lot of ‘whimsical’ things and I am often asked, “Why?”, “Is there any practical use for this?”, and so on. Don’t dwell on that side of things. You’re making something because you want to. Making something unconventional can be more fun than following “Build a TODO app 101”. There’s a time and a place for the 101s, but I want you to enjoy learning. Gain an appetite for creating wonderful things that none of us have ever seen.

**Work on the ideas that spark joy for you**. Don’t let the “How?” distract you. Focus on the “What?”. The goal is to get the idea, then find a way to make it. If it means learning something new — great. If you can do it with something already in your toolbelt — awesome. Let the ideas guide you. The variety of your projects can often challenge you to use tools you already know in different ways. You can pick up new techniques from tackling problems others might not have even seen. It gives you an ability to think “Outside of the box”.

Let’s also address the idea that these things aren’t ‘useful’. I don’t believe this is ever the case. A major example for me is CSS art. “Why do this with CSS? Use an image like SVG”. Don’t buy into that. By drawing something with CSS, you  **level up your skills**  by creating interesting shapes, learning the stacking index, and so much more. The cool thing with CSS art, in particular, is that every creation tends to yield a different problem. Yes, you won’t be dropping that 1000 lines of CSS into a production site anytime soon and you’ll use an image. But, did the image teach you how to use `clip-path` or be a wizard with `border-radius`?

For example, a demo of mine is “The impossible checkbox”. It’s a toggle that when you toggle on, a bear turns off. The more you turn it on, the angrier the bear gets. If I had focused on the “How?” then that demo may never have come to life. Instead, I sketched out what I thought might look like. And then decided I was going to use React and GreenSock together with SVG.

{% codepen https://codepen.io/jh3y/pen/bGwbgoW %}

Don’t let the idea of “How?” deter you from the “What?”. Also, never question the “Why?” Make cool things and you will learn from them, no doubt.

### Make, Make, Make

Start writing down your ideas and making things for the sake of making things. That’s my advice if you want to level up and add some playfulness to your code.

What you learn will find its way back into your work. As a recent example, I put together [an eBook on CSS animations](https://gumroad.com/l/move-things-with-css). I could’ve created every demo with a red square, but that’s not very engaging. Instead, the book has animated bunnies, racecars and UFOs to help the knowledge stick. Instead of trying to remember what the red square was doing and how. It’s “Remember we made the bunnies all jump at different times using animation-delay”.

{% codepen https://codepen.io/jh3y/pen/rNMBjGZ %}

This is the major point.  **Being playful with your code and what might seem like “lateral” learning can be a huge driving factor in evolving your skills.**  It might not be noticeable at once, but every time you make some new whimsical thing, you’re leveling up!

Grab a notebook, download a note-taking app (Notion, Trello, Keep), and start documenting your ideas. Training yourself to write down ideas. However big, however small, write them down. Create ideas from things that interest you. Hoard inspiration. Sign up for newsletters. They don’t have to be tech-related. Give [muz.li](https://muz.li/) a try. Read a book, watch a film. Bookmark [Dribbble](https://dribbble.com/), perhaps.

And when the moment strikes, start making! Struggle with the “How”? Try different methods, check out how others do things, reach out to people online. Every step teaches you something new. Besides, isn’t fun worth having for its own sake anyway?