Search
How to Prevent Pasting into an Input
19.10.2020
Every once in a while I get to a website that doesn’t allow me to paste into a form input. In most cases it’s something to do with login credentials (username and or password) and auth codes. So how are they preventing me from pasting information? It’s as easy as you’d...
How to Conditionally Add Attributes to Objects
16.10.2020
JavaScript is full of tricks that you don’t know you want until you … want … them. Or maybe just until you see them. One trick I recently realized was conditionally adding attributes to React elements. Of course this trick essentially boils down to conditionally adding properties...
Sports Data for Developers: SportdataAPI (Sponsored)
12.10.2020
Most of the side projects I consider starting revolve around sports, since I’m a huge sports fan. I spend my Saturdays watching soccer, Sundays spent watching soccer and NFL, and of course the mid-week Champions League and Europa League matches. One problem I’ve always had is not being...
39 Shirts – Leaving Mozilla
6.10.2020
In 2001 I had just graduated from a small town high school and headed off to a small town college. I found myself in the quaint computer lab where the substandard computers featured two browsers: Internet Explorer and Mozilla. It was this lab where I fell in love with Mozilla — a browser that...
Curate Custom Content with mediastack
6.10.2020
I used to have a personal aggregator of sites I enjoyed but maintaining it was a nightmare. I needed to grab each site’s RSS feed, categorize their contents, deal with errors and individual rate limits, etc. I had to tear the whole project down because it was a nightmare to manage. Fast...
How to Detect When a Sticky Element Gets Pinned
5.10.2020
The need for position: sticky was around for years before it was implemented natively, and I can boast that I implemented it with JavaScript and scroll events for ages. Eventually we got position: sticky, and it works well from a visual perspective, but I wondered how can we determine when...
Some New Icon Sets
29.9.2020
I’ve bookmarked some icon sets lately, partly because I can never find a nice set when I need to. I figured I’d even go the extra mile here and blog them so I can definitely find them later. Aside from being nice, cohesive, and practical sets of icons, I find it interesting that...
Shoelace 2.0: A Forward-thinking Library of Web Components
29.9.2020
A few years ago, I released a lightweight alternative to Bootstrap affectionately named Shoelace. Shoelace was small and fast because of its minimal design and pure CSS approach to styling. It used CSS custom properties extensively to enable customizations, even when loaded via CDN — something...
How to Detect the Default Branch in a git Repository
28.9.2020
Over the past few years, many engineering teams have switched their default git branch name from master to a different, potentially less offensive term. I’m all for choosing to name your default branch whatever you’d like, but not having a universal default branch name can complicate...
How to Create an Async Function
24.9.2020
One thing I love about JavaScript is that there are many ways to accomplish the same task, one such example being creating functions. There are several patterns for functions; one of the last you see used is the new Function method: /* new Function(arg1, arg2 (...), body) */ const myFunction =...
ztext.js
22.9.2020
Super cool project from Bennett Feely! It makes any web type into 3D lettering with a mouseover effect that moves the 3D objects in space. It’s reminiscent of Zdog, but for type. It works its magic by stacking a bunch of copies of the glyphs on top of each other that are offset by some...
Vital Web Performance
21.9.2020
I hate slow websites. They are annoying to use and frustrating to work on. But what does it mean to be “slow”? It used to be waiting for document load. Then waiting for page ready. But with so many asynchronous patterns in use today, how do we even define what “slow” is? The W3C has […]
The...
Remove the Search Input Clear(x) Icon
21.9.2020
I really appreciate the amount of different <input> elements we’ve received over the past decade. These elements don’t just bring a new semantic advantage, but also provide UI helpers, which in many cases are useful. In a recent case, I found a UI element not useful: the x (clear)...
Lessons Learned from Sixty Days of Re-Animating Zombies with Hand-Coded CSS
16.9.2020
I’ll be linking to individual Pens as I discuss the lessons I learned, but if you’d like to get a sense of the entire project, check out 60 days of Animation on Undead Institute. I started this project to end on August 1st, 2020, coinciding with the publication of a book I wrote featuring...
5 Awesome JavaScript Promise Tricks
14.9.2020
The Promise API changed the game in JavaScript. We went from abusing setTimeouts and settling for synchronous operations to doing everything possible to leverage this new async API. Let’s check out a handful of awesome Promise API tricks! Cancel a fetch Request One problem we instantly...
How to Get Handwriting Animation With Irregular SVG Strokes
11.9.2020
I wanted to do a handwriting animation for calligraphy fonts — the kind where the words animate like they are being written by an invisible pen. Because calligraphy fonts have uneven stroke widths (they actually aren’t even strokes in terms of SVG), it was near impossible to do this sort of thing...
Logical Assignment Operators
10.9.2020
I love JavaScript, it’s my favorite programming language, but I love dipping into other languages because they offer a new perspective on coding paradigms. There’ve been syntax additions to JavaScript that I’ve seen I found interesting (think ?? in optional chaining) and now...
Stroke Text CSS: The Definitive Guide
4.9.2020
Whenever I think of stroked text on the web I think: nope.
There is -webkit-text-stroke in CSS for it, but it places that stroke in the middle of the vector outline of the characters, absolutely ensuring that the character doesn’t look right. Just look at this in Chrome or Safari. Gross....
How to Simplify SVG Code Using Basic Shapes
3.9.2020
There are different ways to work with icons, but the best solution always includes SVG, whether it’s implemented inline or linked up as an image file. That’s because they’re “drawn” in code, making them flexible, adaptable, and scalable in any context.
But when working with SVG, there’s always...
Morphing SVG With react-spring
26.8.2020
I’ve been intrigued by the morphing effect ever since I was a little kid. There’s something about a shape-shifting animation that always captures my attention. The first time I saw morphing left me wondering “ Wow, how did they do that?” Since then, I’ve created demos and written an article about...