The plugin stopped working
-
Animations for Blocks worked fine until a few days ago, but now, all the animations are not working.
Here’s an example of how set up the effect on some blocks:

And this is the related page: https://www.pierodesopo.com/category/journal/
The page I need help with: [log in to see the link]
-
Looks like it’s working to me.
Does your browser/device perhaps have
prefers-reduced-motionenabled? In which case the the animations won’t play.Thanks, @skadev
This is really weird. I’m not seeing the animations on any of the browsers installed on my system: Opera, Vivaldi, Edge, Firefox, Zen, Chrome.
Strangely enough, it seems to work fine on my phone.
I have no clue of what’s going on.
Edit: also, I’ve tried with a different animation plugin for the block editor, and the animation works on my PC too, but I’d really like to keep using Animations for Blocks instead.
-
This reply was modified 6 months, 3 weeks ago by
LightCatcher.
I have an update on the issue. I noticed that the animation effects under my Windows accessibility settings was off. By turning it on, restores the animation on the browsers as well.
Is there a way to keep my system animation effects off, and still have the animation in the browser working?
Is there a way to keep my system animation effects off, and still have the animation in the browser working?
Yes, you would need to add this custom code (to your child theme’s
functions.php, a mu-plugin, snippet, etc):add_action('wp_enqueue_scripts', function() {
if(defined('WSD_ANFB_AOS_HANDLE') && wp_style_is(WSD_ANFB_AOS_HANDLE, 'enqueued')) {
// Override 'screen and (prefers-reduced-motion: no-preference)'
wp_styles()->registered[WSD_ANFB_AOS_HANDLE]->args = 'screen';
}
});Hi,
Plugin stopped working for me too. Version 1.2.2 works good but when I upgrade to 1.2.3 no more animations.
I added this to child theme functions but it doesn’t seem to help. Hard refreshed and cleared cache too.
add_action('wp_enqueue_scripts', function() {
if(defined('WSD_ANFB_AOS_HANDLE') && wp_style_is(WSD_ANFB_AOS_HANDLE, 'enqueued')) {
// Override 'screen and (prefers-reduced-motion: no-preference)'
wp_styles()->registered[WSD_ANFB_AOS_HANDLE]->args = 'screen';
}
});Test/under construction site is here: https://new.hearinghealthclinic.com/ password: 111
Thanks for your time.
The animations on your test site work for me, so you also probably have prefers reduced motion enabled on your computer.
I’m not sure why the snippet isn’t having an effect for you though.
But it’s recommended to turn prefers-reduced-motion setting off rather than use the snippet – ask an AI how to do it, it will give you different places to check, depending on your OS and browser. It could also be enabled in Chrome dev tools: https://i.imgur.com/SpnclNP.png
Add this snippet to a Custom HTML block on any page, it will tell you whether the setting is on or off:
<style>
.test-notice {
padding: 1rem;
margin-block: 1rem;
color: white;
border-radius: 4px;
display: none;
}
@media (prefers-reduced-motion: reduce) {
.test-notice[data-enabled=true] {
display: block;
background-color: red;
}
}
@media (prefers-reduced-motion: no-preference) {
.test-notice[data-enabled=false] {
display: block;
background-color: green;
}
}
</style>
<div class="test-notice" data-enabled="true">Reduced motion is enabled, animations won't play.</div>
<div class="test-notice" data-enabled="false">Reduced motion is not enabled, animations will play.</div>Here’s another PHP snippet (for child theme’s
functions.php) that can change the plugin’s default behavior though:add_action('init', function() {
if(defined('WSD_ANFB_AOS_HANDLE')) {
wp_deregister_style(WSD_ANFB_AOS_HANDLE);
wp_register_style(
WSD_ANFB_AOS_HANDLE,
plugins_url('build/aos.css', WSD_ANFB_FILE),
[],
WSD_ANFB_VER,
'screen' // Override 'screen and (prefers-reduced-motion: no-preference)'
);
}
}, 11);Hi,
Thanks, the Custom Html snippet is useful and showed that “Reduced motion is enabled, animations won’t play.”
The 2nd funtion for functions.php worked good. Now with reduced motion enabled the animations are playing for me.
I appreciate the help. One concern from the Client is the animations were not working on their devices so they worried that maybe their public web viewers wouldn’t be able to see the animations either.
Thanks for the quick help.
John
Hi,
animations stopped working for me too on several websites since your last changes to the plugin (Firefox Browser). It’s indeed working again with that snippet:
add_action('wp_enqueue_scripts', function() {
if(defined('WSD_ANFB_AOS_HANDLE') && wp_style_is(WSD_ANFB_AOS_HANDLE, 'enqueued')) {
// Override 'screen and (prefers-reduced-motion: no-preference)'
wp_styles()->registered[WSD_ANFB_AOS_HANDLE]->args = 'screen';
}
});It would be great if the plugin played the animations without a snippet after the update! Maybe checking this in plugin code first for some future releases?
best regards!
Yeah I will probably add some option to override the
prefers-reduced-motion: no-preferencein the next update, some time in the near future.animations stopped working for me too
Just to clarify, they didn’t stop working, they are working as intended, you don’t see them because you prefer to not see the animations. This is your personal system preference, other users who don’t have it enabled will still see animations. But I will make it more clear and add a toggle as well.
-
This reply was modified 6 months, 3 weeks ago by
The topic ‘The plugin stopped working’ is closed to new replies.