Neigh we go round
When it comes to animated graphics I am often presumptuous in assuming that not only you want to see shapes move over time, but that you can tolerate the change as well. But with the benefit of JavaScript it is possible to alleviate the issue.
The idea is to test the preference for reduced motion.
const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)'); You can set the option even at system level to disable animation effects, and in this instance, the media query matches.
if (reducedMotion.matches) {
// please reduce motion
} In this manner you have a boolean, a flag to decide. Is the preference turned on? If so you might want to stick with a static picture — but on Monday in pseudo-3D. Is the sudden animation acceptable? Step right up and entertain the option.
Only one question remains when you accept the change: do you actually like it? A matter of taste, a whole different preference, you might argue. And one preference for which there’s no code to find the same quick answer.
"Zdog Monday", a series of gorgeous pseudo-3D graphics built with Zdog in one day of the week.
There is a collection on CodePen, but if you want some context, and a few twists, I took care to write about each single piece.
- Beauty sleep
- Counting shapes
- Step through frames
- Spinning change
- One out of six
- Child's play
- Memory pop
- ZZ Anne
- Just keep spinning
- Advent of shapes
- Joystick drift
- Canard sans souci
- Brilliant idea
- Lighten up
- Guiding star
- Small whimsy
- Double axis
- Neigh we go round
- Having a ball
- Powerful mix
- Assembly code
- When lightning strikes
- Loopty loops
- Season's rewards
- Cherry-pick
- Trail blazer
- Hatch-a-doodle-doo
- Bubble up
- Think you can