Problem/Motivation
It would've been nice to have options to change duration of animation. All animations at the moment plays with one speed, duration is not configurable. But we want to set different animation duration sometimes to reach better visual effect.
aos.js library easily support changing of animation duration by adding data-aos-duration data attribute. But there is no way to configure animation duration in the Bootstrap Styles module.
Thank you in advance.
(P.S. Please tell if i'm wrong and this is possible somehow at the moment)
Issue fork bootstrap_styles-3259093
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
flyke commentedI see that if you select an animation, it will use the option value as value which will be added to the 'data-aos' attribute.
In the code there is nothing that allows for a data-aos-duration attribute.
bootstrap_styles/src/Plugin/BootstrapStyles/Style/ScrollEffects.php:
I see that when editing a section, there is a Settings tab where you can add attributes (YAML) for the Container, Row and Column.
There you could add
data-aos-duration: 900for example.But I am trying to figure out myself how to add the data attribute element via code.
I was able to alter the Animation settings (where you select the desired animation) and add a 'Animation duration' number input field via a custom mymodule_form_layout_builder_update_block_alter, with a default value of 400. I can edit and save my custom value there thanks to a custom submit handler I added, but still figuring out how to use that value in my custom submit handler to actually set it as data attribute on the correct element.