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
- Use the transparent header so the image shows behind the menu.
- Height is the screen height, up to 900px. On phones it is the full screen height.
- Keep the stat bar below (
.stat-bar-wrap) if you use one. The hero already leaves space for its 64px overlap. - Use landscape images at least 1920px wide. Both images must have the same framing.
- The dark gradient (
.cmp-fs-shade) keeps white text readable. Remove it if your images are dark.
Classes and attributes
| Name | Purpose |
|---|---|
.cmp-fs | Hero section. Holds the slider, shade, text and hint. |
.cmp-fs-shade | Gradient for text contrast. Ignores clicks. |
.cmp-fs-content | Text and buttons at the bottom. Ignores clicks except on buttons. |
.cmp-tabs / .cmp-tab-grid | Project tabs with a slider in each pane (used under the hero). |
.cmp-duo | Two tall sliders side by side. |
.cmp-steps | Four numbered step cards. |