Demonstrates how to use AOS (Animate On Scroll) attributes in HBStack/Hugo content blocks, headings, and banners.
1markup:
2 goldmark:
3 parser:
4 attribute:
5 block: true
6 title: true
config/_default/module.yaml:1imports:
2 - path: github.com/hbstack/header/modules/banner
3 - path: github.com/hugomods/aos
You can add AOS attributes to any block element by appending { data-aos="fade-up" } or other AOS attributes.
1# Animated Heading { data-aos="fade-up" data-aos-delay="100" }
1This paragraph will animate on scroll. { data-aos="fade-right" data-aos-delay="200" }
Add attributes in front matter or content:
1header:
2 banner:
3 title: |
4 Animated Banner Title
5 { data-aos="fade-down" }
6 description: |
7 This description fades in with a delay.
8 { data-aos="fade-up" data-aos-delay="300" }
9 img: /images/banners/black.jpg
This paragraph will animate from the right as you scroll. { data-aos=“fade-right” data-aos-delay=“200” }
{ data-aos=“zoom-in” data-aos-delay=“400” }
If using the header banner module, set attributes in front matter as shown above.
data-aos: Animation type (e.g., fade-up, fade-right, zoom-in, etc.)data-aos-delay: Delay in ms before animation startsdata-aos-duration: Duration of animation in msdata-aos-easing: Easing functiondata-aos-anchor: Anchor elementSee AOS documentation for more options.
References: