AutoAnimate – Add motion to web apps with a single line of code
github.com
github.com
[1] https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pref...
I think this is a different thing from people who just want things to feel faster/snappier, vs those who have an accessibility need.
Particularly with Android 12, wow. So many animations added, and they run so, so, so slowly. There were a number of rather severe UI glitches for the first few patches, but it's alright nowadays. Beyond 12's other major issues, that is - I highly recommend not upgrading. Maybe 13 will actually fix some of it.
(If anyone is looking for the option: it's in the developer settings and there are two entries, one for windows and another for general animations.)
The worst thing is that it isn't respected by many apps and browsers.
But it does at least get rid of that awful stretch-bounce animation on scroll views basically everywhere. That alone is practically worth it.
https://news.ycombinator.com/item?id=30237846
In addition, "reduced motion" is only a partial solution to the problem of unwanted motion. I would much prefer zero motion. In Firefox, it is possible to disable CSS animations globally, by adding the following to both chrome/userContent.css (with the appropriate namespace header) and chrome/userChrome.css in your profile directory:
*, :before, :after {
transition: none !important;
animation-delay: 0ms !important;
animation-duration: 0ms !important;
}
This also requires setting toolkit.legacyUserProfileCustomizations.stylesheets to true in about:configI have been disabling animation in userContent.css (which affects websites) for years with no problems. More recently, I realized I could also disable it in userChrome.css (which affects the Firefox UI). This exposes what appears to be a race condition bug involving tabs. Occasionally, a tab's close button will stop responding, and that tab will also become impossible to drag to new positions. This can be worked around by attempting to drag a different tab, releasing that drag, then immediately dragging the frozen tab to an empty part of the tab bar, which will unfreeze the tab.
I consider this minor annoyance well worth the benefits, which includes disabling animations that would be permitted with prefers-reduced-motion, such as the sliding of the "Find in Page" panel. It is possible that setting an extremely brief animation might avoid the bug without showing visible animation but I have not tested this.
> AutoAnimate is fundamentally a single function — autoAnimate — that accepts a parent element. Automatic animations will be applied to the parent element and its immediate children. Animations are specifically triggered when one of three events occurs:
> A child is added in the DOM.
> A child is removed in the DOM.
> A child is moved in the DOM.
In the animated one, I have to wait for the animation to finish.
Seems like a poor example of when animation adds value.
But there are places it works.
Is there a way for the library to eliminate this “blink”? Or is this behavior unavoidable with current one liner approach?
https://codesandbox.io/s/framer-motion-reorder-animation-bvi...
I don't trust the implementation of observers, usually in Safari, to reliably recreate this effect. I'm not sure it's even specced.
Would you mind if I asked a few questions?
- does your device have remote debugging enabled on Safari?
- was your phone in low-power mode?
- did you first access the site through a WebKit in-app browser panel before opening it Safari?
- what version of iOS?
- what model of iPhone?
Those are my leading theories for what contributes to the flash happening. If you force quit and restart safari and / or reboot your phone does it work as expected?
Do you mean “Web Inspector”? Yes.
> - was your phone in low-power mode?
No.
> - did you first access the site through a WebKit in-app browser panel before opening it Safari?
No.
> - what version of iOS?
15.2
> - what model of iPhone?
13 Pro Max
I did force quit Safari and I no longer see the brief flash of target state when adding items to lists. But I didn’t check if I saw that immediately before doing force quit, sorry. I’ll write if I ever see that again.
https://github.com/metafizzy/isotope
It was so popular back in the day but hasn't received any recent updates.
1) it adds meaningful value to the ux (like that sorting example in the link)
2) it’s a micro interaction, like a heart lighting up when you like something, so it adds delight to the ux and I don’t have to wait for it to finish
3) it covers up other jank in the ux, like known slow processing or something
If you insist of animations, make them incredibly fast, otherwise we’re all going to be mad eventually.
It’s ALWAYS better to invest the time you’d have spent on animating shit to instead just make your app faster
With that in mind, it seems pretty nice if a library can make simple animations much easier.
The demo shows some promising examples that tend to be common polish on, say, iOS. The simple sorting/delete ListView example is pretty nice compared to the instant changes with zero feedback it's compared to.
Meanwhile, web animations by hand can take quite a bit of thought even for basic things, like fiddling with CSS `transition` and ensuring your component lifecycle sees it through. Always ends up being a bit brittle, like having to duplicate CSS time durations with your JS components.
I'll have to play with it.
I think just a layer of smoothness can help a lot.
I’d argue that the web is almost always janky, no matter how fast or slow.
on a 8 year old device, with 200ms network latency, while the browser performs three hundred TLS handshakes with all the ads and tracking services... not so great
Apps animate between making it look less janky and they also hold your position when you return while a web app will reload the whole thing including requests when you move back, losing your state and position.
Imo animations are an accessibility feature for people who can't follow UI updates very quickly and who need the smooth transitions to keep track of what's on the page where. They should be opt-in like high contrast themes.
Blink does not work :(
blink { animation: blink 1s steps(1, start) infinite; }
@keyframes blink { 50% { opacity: 0; }}