Map and motion

Compare hero

A hero where the image comparison slider fills the whole first screen.

Structure

A full-screen hero where the whole image area is the slider. Drag anywhere on the hero. The heading and buttons sit on top and do not block dragging. See index-compare-hero.html for the live page.

<header class="site-header is-transparent" data-sticky>...</header>
<main id="main">
  <section class="cmp-fs" aria-label="Before and after hero">
    <div class="compare-slider" data-compare data-compare-start="50">...same markup as Image compare slider...</div>
    <div class="cmp-fs-shade"></div>
    <div class="cmp-fs-content">
      <div class="container">
        <div><h1 data-animate="fade-up">Slide from <em>day</em> to dusk</h1><p data-animate="fade-up" data-animate-delay="0.15">Short text.</p></div>
        <div class="cmp-fs-actions" data-animate="fade-up" data-animate-delay="0.3"><a class="btn btn-accent btn-lg" href="#">View homes</a></div>
      </div>
    </div>
  </section>
  <div class="stat-bar-wrap">...optional stat bar overlapping the hero...</div>

Instructions

Classes and attributes

NamePurpose
.cmp-fsHero section. Holds the slider, shade, text and hint.
.cmp-fs-shadeGradient for text contrast. Ignores clicks.
.cmp-fs-contentText and buttons at the bottom. Ignores clicks except on buttons.
.cmp-tabs / .cmp-tab-gridProject tabs with a slider in each pane (used under the hero).
.cmp-duoTwo tall sliders side by side.
.cmp-stepsFour numbered step cards.