Active
Project:
Bootstrap Styles
Version:
1.0.0-alpha1
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Jan 2022 at 10:24 UTC
Updated:
8 Jun 2022 at 18:34 UTC
Jump to comment: Most recent
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.