-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduced Motion Animations (for #192) #341
base: main
Are you sure you want to change the base?
Conversation
Run & review this pull request in StackBlitz Codeflow. |
very nice, this seems like a great angle to try out! "reduced" animations truly. do you have vestibular motion sickness? i'm going to ping a few folks I know to see how it makes them feel. i'll get back to you once they've got back to me 👍🏻 |
Yeah, a mild form. I don't do well on boats specifically.
Awesome, thank you. I'm definitely interested to learn whether this helps other people with motion sickness. |
deploy preview available for testing here https://sensational-dasik-603d9d.netlify.app/#animations |
first report is that it's helpful but not bulletproof. the scale animations still triggered them. they suggested it's "reduced" effect is a fade out. pretty good suggestion. i wonder how many we can make fallback to a crossfade? |
for readability, and to not conflate with any specific reduced-motion things
sorry about the delay, i was working on some other stuff.
maybe stepped animations are the way to go after all. i made some new animations that use stepped fades.
i added new animations for: scale, slide, spin, float, bounce, pulse, shake. |
no worries on speed here, no rush, thanks for comin back and hackin. there's definitely some cool results in here! the stepped fades are pretty sweet. they have an entry and exit cross fade animation, which we know is g2g, and then it shows the animation in the end state. seems to check a lot of boxes. there's still some finesse needed to get these fully ready, but it feels like progress. disregarding the kinda akwards starts to some of the stepped crossfades, the spin is working really well. i like the scales too. the steps allow for the element to move somewhere while the cross fade takes the motion out of it and lets the brain kinda fill it in. i agree the shakes are quite working tho. i made this little playground to try a more isolated sandbox out, check it out here https://codepen.io/argyleink/pen/wvxVMJg Video capture of the scale up animation vs the reduced, stepped and crossfaded, scale up:Kapture.2023-02-10.at.10.23.07.mp4Using the animations devtools you can replay the transition, see how it works. you can also click anywhere in the demo to replay the animation and see them side by side. |
hey Adam. thanks for the pen, that made it easier to mess with. i have probably spent too long playing with it. here's my pen. shake and bounce are a little strobe-y, and i don't really have any good ideas for that. |
shake and bounce are strobe-y yep… but, there's a lot to like in this too I think! thanks for putting this together 🙂 lemme share it around and gather feedback 👍🏻 |
lots of great feedback so far, this is definitely the most articulate 🙂 -- start quote -- Slides and scales look pretty good. My thoughts on them 1 by 1: Spin BUT after playing around with your demo for a while and putting content inside of the spining elemnt and as well removing the crossfade again I think this is a solid solution and looks way better than just a step animation if there is real content in place and / or is embedded inside of a page. Ping Fiddled around a little bit. Came up with something like this. @keyframes reduced-ping {
0% {
opacity: 1;
}
33% {
transform: scale(1);
}
33.01% {
transform: scale(2);
opacity: 0;
}
60% {
opacity: .5;
}
90%,
100% {
transform: scale(2);
opacity: 0;
}
} So it adds two extra steps one that first shows the small one and fades it out and a second that fades in the large one but just until about 50% opactiy to then fade it out again. 🙂 Tbh. I don't know any other way to have a like an more or less instant transition between two states in an animation besides setting low third digit percentage differences. Regarding the shake and bounce animations. Shake Bounce Generally speaking about shake and bounce I am not quite sure if it makes sense to try to simulate the for reduced motion users. As the overall positioning of the element doesn't change and the elements end and start points are equal I'd just suggest using something like blink to show some animation on the element. I don't think we have to provide like an 1:1 experience for reduced motion for every animation. There are some cases that just can't be shown. In cases like this I always think of it like of the IE problem back in the days, we don't have to make sure everything looks the same on all devices. We just have to make sure no one gets explicitly excluded and has access to the same content with an experience suited to his / her individual settings and technological choice. |
link to my pen for convenience: https://codepen.io/saitheninja/pen/XWPjWjR i appreciate the feedback. it all makes a lot of sense. spin:
my thoughts exactly. ping:
i couldn't figure out a way to smoothly transition the scale while already using a fade for the ping effect. i like the shake:
makes sense to me. removed the fades, and made a blink-only option. bounce:
also makes sense. changed it to not match so closely. also made a blink-only option. probably my most important take away:
|
I really think we're onto an improvement here and want to keep moving it forward ❤️ What do you think of like, putting all "attention getters" into a category that gets reduced fallbacks that blink? This would mean that all the hard to reduce animations become basic attention getters, while all the animations we're confident do have nice crossfade reductions can continue to be as they are. Categories like this: Has reduced animation with reasonably similar effect
Has the same attention getting reduced animation, a slowish blink
This feels helpful for anyone who uses one of the attention getters, that when one of their users needs reduced motion, they get a reasonable attention getter (which was the goal of the CSS author anyway). This also means the CSS we ship isn't super bloaty for all the reduced motion fallbacks. 7 animations all get the same slow blink fallback 👍🏻 tldr; thoughts? |
I'll quickly jump back into the loop, as this is finally close to shipping.
Ship it! I think this is close to if not the most optimal solution for this use case, where we have reusable and freely configurable animations, there is.
Do we put this somewhere inside the docs and maybe add smth. like a toggle on the top right of the animation sample section to give people an option to easily inspect those reduced animations?
We are just reusing the normal blink animation here right? One more small side note, could we agree on naming / renaming those reduced animation with the following pattern @saitheninja, @argyleink Thanks for putting in the work & sorry for not finishing #194! |
How about both? Text + smth. like: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey! glad to see commits in here 🙂
I see it's a draft too, so maybe I'm giving this a premature review 😅
for starters, it's super hard to tell what you're adding and what the linter/formatter changed.. can you remove all the changes that arent part of this reduced motion PR please? it will drastically help me review and merge with confidence.
looks like a big chunk of the work is done tho! when i set reduced motion in my browser and try the samples, most of them begin correctly but dont fade in at the end state. that's something you're hackin on? the slide-in's tho, they seem unfinished?
thanks for workin this stuff out, hope my early review didnt cramp your style. i'm certainly excited for all this! 🙂
whoops! i forgot that pushing would trigger the CI. sorry, my bad.
no worries, just needed to clean up a bit. i implemented the suggestions from you and @Que-tin, and cleaned up the diff. the documentation might need some work. everything else is ready for review! also i tested the new animations and it looks good on my side. i used the latest stable Chrome and Firefox on Linux. maybe @Que-tin could also test it out? a summary: in/out that has similar reduced effect:
"attention getters" (start and end are the same) reduced to blink:
|
Just checking into it. There is actually a bit more to it than just changing the Because we actually need to add smth. to the stylesheet generation functions and reuse that inside of the |
Add dynamic style creation
[add] Dynamic reduced animations [add] Local reference for the blink animation values
e90f5d3
to
61cdce2
Compare
awesome, thanks for your help @Que-tin. i see what i missed. i think git is synced and merged properly now.
i did a |
From a pure build & technological stand point I'm fine with the PR. We might have to look at the Regarding that and the docs content itself @argyleink is the person to decide. Update: |
i'll be takin a deep look and dive this week! thanks for hackin y'all 🤘🏻 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've made a suggestion here that fixes a couple things:
- groups all the keyframes under the same MQ
- removes the semicolon after ${val}, required after change Gen props from a javascript object #1 here
These animations aren't behaving properly though. Need fixed before this can merge:
- slide in down
- slide in up
- slide in right
- slide in left
All the animations:
- to me it seems like they're abit too quick
- the initial fade outs are great, but the fade in's feel abrupt
Lastly, the tests need updated. Looks like the number here needs updated to account for the additional keyframes.
All in all, nice work y'all, feels like we're gettin close to done!
[fix] Total props count test
Fixed the test and made the changes suggested to the Regarding the animations, @saitheninja could you take a look at it? |
puts all the reduced keyframes into 1 media query instead of many Co-authored-by: Adam Argyle <[email protected]>
merge changes from reduced-motion branch
looks like there's a build issue too to fix https://github.com/argyleink/open-props/actions/runs/4936351522/jobs/8951530987?pr=341 |
I think my pull request didn't get merged yet. @saitheninja I think we've worked on the same stuff here, but there are a few problems inside your build adjustments. Let's work together on getting my PR merged inside of your branch so we can finish this of :) |
1b865f6
to
752fc57
Compare
0da174c
to
c54ca85
Compare
c54ca85
to
ebe68a9
Compare
Hi Adam.
I noticed that the old pull request (#194) for this issue (#192) has gotten a little stale so I took a crack at it in a new pull request. I did just enough to preview animations on the doc site in dev. I can fill in the rest of the packaging stuff whenever you need it.
The feedback you got on the previous pull request said that stepped movement felt a little strange, so instead of doing steps I made things move smaller distances, and slower. Spin is the exception. It's movement is stepped, because it makes me kind of sick even when it's slow, and it has to rotate all the way around so the distance is fixed.
I kept the timings the same for full motion and reduced motion one-shot animations so that they can be substituted easily, especially when combining animations. I slowed down the timing for the infinite animations because they still felt too fast to me, even when moving less.
The reduced motion slides don't move as far, which isn't exactly a drop-in replacement, but it can be combined with a fade to get the same effect as sliding from/to offscreen.