When I set out to build this portfolio site, I knew I wanted an interactive element as the homepage hero. Inspired by Josh Comeau's metal shavings component on his blog, my initial idea was to mask a rainbow flag somehow and then reveal it on mouseover.
So naturally, I created an HTML canvas and drew a rainbow flag. Tada!
The problem was, I wasn't sure how to implement the reveal. Not just technically, I mean I wasn't even sure what I wanted it to look like. I've run into this problem a lot making videos. Like so many ideas, it felt fully formed until I really had to think about the execution. For me, the solution is almost always some form of storyboarding. I tried sketching out a few ideas, and in addition to noting a bunch of things I did not want to do (some of these are included down below, just for fun), I did figure out that I wanted the reveal to sort of trail the mouse.
In a flurry of googling, I found Josh talking about the principles behind his design during a Frontend Horse charity livestream from a couple years ago. This was a great help—not only did it point me in the right direction, but when I looked closely, I was able to discern a bunch of hints about what my end product needed to look like. For example, you never see Josh's custom hooks, but you do see what they return. (Though in the case of his normalize( ) utility function, I got lucky and was able to pause the video and steal it line for line.) These are my favorite kinds of resources because they keep me from spinning my wheels while still leaving me plenty to figure out on my own. It's how I learn best.
Note that I happened to build this in React, but the principles apply to other frameworks.
And that's about the gist. I am pretty happy with where I landed, but as promised, here are some snapshots from the journey.