Map and motion

Animations

Scroll reveals, stagger, counters and progress bars. For moving and fixed backgrounds see Parallax. Everything is switched on with data attributes. Delete the attribute and the effect is gone.

Setup

Add this to the page <head> (it adds the js class that lets content start hidden, and shows everything again if GSAP does not load or the visitor prefers reduced motion):

<script>document.documentElement.classList.add('js');if(window.matchMedia&&matchMedia('(prefers-reduced-motion: reduce)').matches)document.documentElement.classList.add('anim-off');setTimeout(function(){if(!window.__animReady)document.documentElement.classList.add('anim-off')},4000)</script>

Load the scripts at the end of <body>, in this order:

<script src="../assets/vendor/gsap.min.js" defer></script>
<script src="../assets/vendor/ScrollTrigger.min.js" defer></script>
<script src="assets/js/animations.min.js" defer></script>

Hero entrance

A hero uses the same attributes as the rest of the page. Put data-animate and data-animate-stagger on the box that holds the heading, text and buttons, and they come in one after another. Give the background image its own data-animate="fade-in".

Find a home that feels like yours

Browse verified listings and talk to local agents.

<div class="hero">
  <div class="hero-bg" data-animate="fade-in">...</div>
  <div class="hero-content" data-animate="fade-up" data-animate-stagger="0.15">
    <h1>Heading</h1>
    <p>Text</p>
    <div>Buttons</div>
  </div>
</div>

Scroll effects

Each effect plays once when the element reaches about 85% of the viewport height.

fade-up

fade-up
Scroll to see it

<div data-animate="fade-up">

fade-in

fade-in
Scroll to see it

<div data-animate="fade-in">

fade-down

fade-down
Scroll to see it

<div data-animate="fade-down">

slide-left

slide-left
Scroll to see it

<div data-animate="slide-left">

slide-right

slide-right
Scroll to see it

<div data-animate="slide-right">

zoom-in

zoom-in
Scroll to see it

<div data-animate="zoom-in">

More effects

Every effect below works the same way: change the value of data-animate. These cards replay each time you scroll past them. zoom-out is the soft "settle" used on hero images (it starts slightly larger and shrinks to its size). bounce-in, drop-in and elastic-in also use their own easing.

zoom-out
zoom-in-up
zoom-in-down
zoom-in-left
zoom-in-right
slide-up
slide-down
rotate-in
rotate-left
rotate-right
flip-up
flip-down
flip-left
flip-right
skew-up
skew-left
bounce-in
drop-in
elastic-in

<div data-animate="flip-up"> Effects only move, scale, rotate, skew and fade, so they stay smooth. They also work on a stagger parent.

Delay, duration and repeat

Delay and duration

Delay 0.4s, duration 1.4s

<div data-animate="fade-up" data-animate-delay="0.4" data-animate-duration="1.4"> Defaults: delay 0, duration 0.8 seconds.

Replay every time

Scroll up and down past me

<div data-animate="zoom-in" data-animate-once="false"> By default an effect plays once.

Stagger

Put data-animate-stagger on the parent. Its direct children (cards, for example) each animate when they scroll into view, using the effect set on the parent. Children that appear together play one after another.

One
Two
Three
Four

<div class="row" data-animate="fade-up" data-animate-stagger="0.15">

Attributes

AttributeWherePurpose
data-animateAny elementfade-up, fade-down, fade-in, slide-left, slide-right, slide-up, slide-down, zoom-in, zoom-out, zoom-in-up, zoom-in-down, zoom-in-left, zoom-in-right, rotate-in, rotate-left, rotate-right, flip-up, flip-down, flip-left, flip-right, skew-up, skew-left, bounce-in, drop-in or elastic-in.
data-animate-delaySame elementSeconds to wait. Default 0.
data-animate-durationSame elementSeconds. Default 0.8.
data-animate-staggerParentSeconds between children. Children animate one by one.
data-animate-onceSame elementfalse to replay on every scroll. Default plays once.
data-progressProgress fillFill grows from 0 (width set with --w). See Progress bars.
data-countNumberCounts up from 0. Optional data-count-prefix, -suffix, -decimals.

Only transform and opacity are animated. Animations are skipped for visitors who prefer reduced motion, and content stays visible if JavaScript or GSAP does not load.