-
A thread on how you can make fancy stuff that's progressively enhanced, performant, *and* honours user preferences. I’m making a cool landing page for a client at the moment. Here it is in all of its glory. That's the optimum conditions though, let’s do a proper job now 🧵
-
…in reply to @piccalilli_
Right, let's now account for *when* JavaScript doesn’t work. The intro animation is based on state changes, controlled by JavaScript timers. When JavaScript fails, we need to make sure everything is available, so I prefix the CSS with a
[data-js-available]which JS adds. -
…in reply to @piccalilli_
That's progressive enhancement in action! Lastly, we need to account for people who prefer reduced motion. All the animation CSS is fenced in a
@media screen and (prefers-reduced-motion: no-preference)media query. -
…in reply to @piccalilli_
This isn't *all* motion though: just unexpected motion. Notice how the buttons still have a transition state. Anyway, all-in-all: it was not much effort to get this working like this and *everyone* gets a great experience.
- …in reply to @piccalilli_
-
…in reply to @piccalilli_
Anyway, if you've got this far, I've got pockets of availability for building nice websites, so hit me up in the DMs or hi@piccalil.li twitter.com/messages/compose?recipient_id=98734097
