Image Reveal on Hover
Updated 2026-10-16. 8 effects.
An image hover effect reveals or changes a photo when the pointer rests on a link, list row or card: the picture slides out from a mask, opens in a frame, or swaps for a second view. Animate it with transform and opacity, trigger it on :focus-visible too, and give touch screens a tap or a still layout.
These work best where the words come first and the picture is a preview: a list of projects, a menu of dishes, a set of rooms, a row of products with a second angle. The photo confirms what the link says, so it must match its label exactly, and the link must make sense without it.
Hovering is a desktop habit. On phones each piece here shows its photos in place or opens one on tap, and on a keyboard the reveal follows focus, so nobody misses the pictures. Hover cards that zoom inside their frame, and a list whose photo follows the pointer, live in the hover and cursor collections.
Compare them
| Effect | Built with | Size (gzipped) | Running cost | Browser support |
|---|---|---|---|---|
| Bakery Menu Rows With Rising Photo | CSS only | 2.5 KB | Two transforms and one opacity change per row, with a slow timer for the idle demo that stops off screen. | All current browsers |
| Ceramics Cards Revealed Through Falling Slats | CSS only | 2.4 KB | Five translated strips per card share one cached photo, so a reveal moves five small layers and repaints nothing. | All current browsers |
| Course Rows With A Splitting Photo Band | CSS only | 2.3 KB | Each reveal translates two half-height masks and fades one shade layer, all on the compositor. | All current browsers |
| Flower Words Opening Photo Windows | CSS only | 2.1 KB | Each card is one opacity and transform change plus a translate on its photo; the idle timer pauses off screen. | All current browsers |
| Hotel Room Cards Sliding To A Second View | CSS only | 2.3 KB | Two stacked photos per card move with transform only; the idle timer stops when the section leaves the screen. | All current browsers |
| Project Index With Direction Aware Frame | CSS and a small script | 2.6 KB | One shared frame of four photos; each switch moves two of them with transform and leaves the rest untouched. | All current browsers |
| Tea Cards With A Circle Opening To The Cup | CSS only | 2.6 KB | One scaled circle and one counter-scaled photo per card, so the reveal stays a pair of transforms. | All current browsers |
| Walking Routes With A Postcard Pair | CSS only | 2.5 KB | Two cards and one photo per row change transform and opacity only; the idle timer stops off screen. | All current browsers |
Bakery Menu Rows With Rising Photo
A bakery counter list on warm paper where each row keeps a small window at its right edge. On hover or keyboard focus the window fades in and the loaf rises up through it from below while the name shifts a little to the right. On phones the photos simply sit in every row.
<section class="w8bak">
<div class="w8bak-wrap">
<p class="w8bak-kicker">Fernhill Bakehouse</p>
<h2 class="w8bak-title">Out of the oven this morning</h2>
<p class="w8bak-lead">Point at a loaf to see it. Each row opens the full counter list for that bake.</p>
<ul class="w8bak-list">
<li><a href="#" class="w8bak-row" data-on><span class="w8bak-text"><span class="w8bak-head"><span class="w8bak-name">Country sourdough</span><span class="w8bak-price">$9</span></span><span class="w8bak-note">Two-day ferment, dark crust, open crumb</span></span><span class="w8bak-win"><img class="w8bak-img" src="https://images.pexels.com/photos/28354523/pexels-photo-28354523.jpeg?auto=compress&cs=tinysrgb&w=400" alt="A floured sourdough loaf on a board beside a scoop of wheat grains" width="400" height="267" loading="lazy" decoding="async"></span><span class="w8bak-arrow" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg></span></a></li>
<li><a href="#" class="w8bak-row"><span class="w8bak-text"><span class="w8bak-head"><span class="w8bak-name">Butter croissants</span><span class="w8bak-price">$4</span></span><span class="w8bak-note">Laminated by hand, baked at six</span></span><span class="w8bak-win"><img class="w8bak-img" src="https://images.pexels.com/photos/20002837/pexels-photo-20002837.jpeg?auto=compress&cs=tinysrgb&w=400" alt="Golden croissants cooling on a wire rack" width="400" height="267" loading="lazy" decoding="async"></span><span class="w8bak-arrow" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg></span></a></li>
<li><a href="#" class="w8bak-row"><span class="w8bak-text"><span class="w8bak-head"><span class="w8bak-name">Cinnamon rolls</span><span class="w8bak-price">$5</span></span><span class="w8bak-note">Rolled with brown butter, sugared at nine</span></span><span class="w8bak-win"><img class="w8bak-img" src="https://images.pexels.com/photos/8651023/pexels-photo-8651023.jpeg?auto=compress&cs=tinysrgb&w=400" alt="Cinnamon rolls dusted with sugar on a wooden tray" width="400" height="267" loading="lazy" decoding="async"></span><span class="w8bak-arrow" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg></span></a></li>
<li><a href="#" class="w8bak-row"><span class="w8bak-text"><span class="w8bak-head"><span class="w8bak-name">Long baguettes</span><span class="w8bak-price">$4</span></span><span class="w8bak-note">Thin crackling crust, out twice a day</span></span><span class="w8bak-win"><img class="w8bak-img" src="https://images.pexels.com/photos/30826793/pexels-photo-30826793.jpeg?auto=compress&cs=tinysrgb&w=400" alt="Baguettes standing in paper sleeves in a bakery basket" width="400" height="267" loading="lazy" decoding="async"></span><span class="w8bak-arrow" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg></span></a></li>
</ul>
</div>
</section>
<style>
/* Change these: paper colour, ink colour, accent, photo window width. */
.w8bak { --w8bak-paper: #f4ede1; --w8bak-ink: #2b1d12; --w8bak-accent: #7a3e1d; --w8bak-win: 188px; }
.w8bak { background: var(--w8bak-paper); color: var(--w8bak-ink); padding: 72px 20px; font-family: ui-sans-serif, system-ui, sans-serif; }
.w8bak-wrap { max-width: 48rem; margin: 0 auto; }
.w8bak-kicker { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--w8bak-accent); }
.w8bak-title { margin: 12px 0 0; font: 400 clamp(30px, 4.4vw, 36px)/1.2 ui-serif, Georgia, serif; }
.w8bak-lead { margin: 12px 0 0; max-width: 28rem; font-size: 16px; line-height: 1.5; color: #5c4632; }
.w8bak-list { list-style: none; margin: 40px 0 0; padding: 0; }
.w8bak-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 4px; border-top: 1px solid #d9ccb6; color: inherit; text-decoration: none; outline: none; }
.w8bak-list li:last-child .w8bak-row { border-bottom: 1px solid #d9ccb6; }
.w8bak-text { display: block; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.w8bak-head { display: flex; align-items: baseline; gap: 12px; }
.w8bak-name { font: 400 24px/1.3 ui-serif, Georgia, serif; }
.w8bak-price { font-size: 14px; font-weight: 600; color: var(--w8bak-accent); }
.w8bak-note { display: block; margin-top: 4px; font-size: 14px; color: #5c4632; }
/* The window is the mask: the photo inside starts below it and rises into view. */
.w8bak-win { position: absolute; z-index: 2; right: 64px; top: 50%; margin-top: calc(var(--w8bak-win) / -3); width: var(--w8bak-win); aspect-ratio: 3 / 2; border-radius: 10px; overflow: hidden; background: #e4d8c3; opacity: 0; transform: translateX(24px) rotate(3deg); transition: opacity .35s ease, transform .6s cubic-bezier(.2,.8,.2,1); pointer-events: none; box-shadow: 0 18px 34px -16px rgba(60,40,20,.6); }
.w8bak-img { display: block; width: 100%; height: 100%; object-fit: cover; transform: translateY(100%) scale(1.25); transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.w8bak-arrow { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid #cdbda3; color: var(--w8bak-accent); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.w8bak-row[data-on] .w8bak-win, .w8bak-row:hover .w8bak-win, .w8bak-row:focus-visible .w8bak-win { opacity: 1; transform: rotate(-2deg); }
.w8bak-row[data-on] .w8bak-img, .w8bak-row:hover .w8bak-img, .w8bak-row:focus-visible .w8bak-img { transform: none; }
.w8bak-row[data-on] .w8bak-text, .w8bak-row:hover .w8bak-text, .w8bak-row:focus-visible .w8bak-text { transform: translateX(10px); }
.w8bak-row[data-on] .w8bak-arrow, .w8bak-row:hover .w8bak-arrow, .w8bak-row:focus-visible .w8bak-arrow { transform: rotate(-45deg); }
.w8bak-row:focus-visible { box-shadow: 0 0 0 2px var(--w8bak-paper), 0 0 0 4px var(--w8bak-accent); border-radius: 6px; }
@media (max-width: 640px) {
.w8bak-row { gap: 16px; padding: 16px 0; }
.w8bak-name { font-size: 20px; }
}
/* Phones and reduced motion: every photo sits in its row, nothing moves. */
@media (max-width: 640px), (prefers-reduced-motion: reduce) {
.w8bak-win { position: relative; right: auto; top: auto; margin: 0; flex: none; width: 112px; opacity: 1; transform: none; transition: none; box-shadow: none; }
.w8bak-img { transform: none; transition: none; }
.w8bak-row .w8bak-text { transform: none; transition: none; }
.w8bak-arrow { display: none; }
}
</style>
<script>
(function () {
/* Change this: ms between idle reveals before anyone points or tabs. */
var DELAY = 1800;
var root = document.querySelector(".w8bak");
if (!root || matchMedia("(prefers-reduced-motion: reduce)").matches) return;
var rows = root.querySelectorAll(".w8bak-row"), i = 0, t = 0, vis = true, live = true;
function set(n) { for (var k = 0; k < rows.length; k++) rows[k].toggleAttribute("data-on", k === n); }
function run() {
clearInterval(t); t = 0;
if (live && vis) t = setInterval(function () { i = (i + 1) % rows.length; set(i); }, DELAY);
}
/* a real mouse or keyboard takes over from the idle demo */
function stop() { live = false; set(-1); run(); }
root.addEventListener("pointerenter", function (e) { if (e.pointerType === "mouse") stop(); });
root.addEventListener("focusin", stop);
new IntersectionObserver(function (e) { vis = e[0].isIntersecting; run(); }).observe(root);
run();
})();
</script>
With reduced motion: Every row shows its small photo in place from the start and nothing slides.
Running cost: Two transforms and one opacity change per row, with a slow timer for the idle demo that stops off screen.
- Set `--w8bak-win` to make the photo window wider or narrower.
- Change `DELAY` to slow down or speed up the idle reveal that cycles through the rows.
- Recolour the paper and accent through `--w8bak-paper` and `--w8bak-accent`.
Ceramics Cards Revealed Through Falling Slats
Three pottery cards on terracotta that rest as flat glaze swatches with the range name. Hover or focus one and the photo falls into the card in five vertical strips, each a beat after the last, before a caption fades up with the price. Phones show every piece revealed.
<section class="w8cer">
<div class="w8cer-wrap">
<p class="w8cer-kicker">Kiln Row Pottery</p>
<h2 class="w8cer-title">This month on the shelf</h2>
<p class="w8cer-lead">Each card starts as its glaze colour. Point at one, or tab to it, and the piece drops in strip by strip.</p>
<ul class="w8cer-grid">
<li><a href="#" class="w8cer-card" style="background:#4f2216" data-on>
<span class="w8cer-swatch"><span class="w8cer-tag">Glaze 1</span><span class="w8cer-name">Ember vases</span></span>
<span class="w8cer-slat w8cer-s0"><span class="w8cer-drop"><img src="https://images.pexels.com/photos/28867382/pexels-photo-28867382.jpeg?auto=compress&cs=tinysrgb&w=600" alt="Hand-painted ceramic vases and lidded jars on a dark shelf" width="600" height="800" loading="lazy" decoding="async"></span></span><span class="w8cer-slat w8cer-s1"><span class="w8cer-drop"><img src="https://images.pexels.com/photos/28867382/pexels-photo-28867382.jpeg?auto=compress&cs=tinysrgb&w=600" alt="" width="600" height="800" loading="lazy" decoding="async"></span></span><span class="w8cer-slat w8cer-s2"><span class="w8cer-drop"><img src="https://images.pexels.com/photos/28867382/pexels-photo-28867382.jpeg?auto=compress&cs=tinysrgb&w=600" alt="" width="600" height="800" loading="lazy" decoding="async"></span></span><span class="w8cer-slat w8cer-s3"><span class="w8cer-drop"><img src="https://images.pexels.com/photos/28867382/pexels-photo-28867382.jpeg?auto=compress&cs=tinysrgb&w=600" alt="" width="600" height="800" loading="lazy" decoding="async"></span></span><span class="w8cer-slat w8cer-s4"><span class="w8cer-drop"><img src="https://images.pexels.com/photos/28867382/pexels-photo-28867382.jpeg?auto=compress&cs=tinysrgb&w=600" alt="" width="600" height="800" loading="lazy" decoding="async"></span></span>
<span class="w8cer-cap"><span class="w8cer-name">Ember vases</span><span class="w8cer-meta"><span>Wood-fired, painted lotus glaze</span><span>$64</span></span></span>
</a></li>
<li><a href="#" class="w8cer-card" style="background:#3f5560">
<span class="w8cer-swatch"><span class="w8cer-tag">Glaze 2</span><span class="w8cer-name">Shoreline bowls</span></span>
<span class="w8cer-slat w8cer-s0"><span class="w8cer-drop"><img src="https://images.pexels.com/photos/3847438/pexels-photo-3847438.jpeg?auto=compress&cs=tinysrgb&w=600" alt="Ceramic bowls and plates in white, black and red seen from above" width="600" height="800" loading="lazy" decoding="async"></span></span><span class="w8cer-slat w8cer-s1"><span class="w8cer-drop"><img src="https://images.pexels.com/photos/3847438/pexels-photo-3847438.jpeg?auto=compress&cs=tinysrgb&w=600" alt="" width="600" height="800" loading="lazy" decoding="async"></span></span><span class="w8cer-slat w8cer-s2"><span class="w8cer-drop"><img src="https://images.pexels.com/photos/3847438/pexels-photo-3847438.jpeg?auto=compress&cs=tinysrgb&w=600" alt="" width="600" height="800" loading="lazy" decoding="async"></span></span><span class="w8cer-slat w8cer-s3"><span class="w8cer-drop"><img src="https://images.pexels.com/photos/3847438/pexels-photo-3847438.jpeg?auto=compress&cs=tinysrgb&w=600" alt="" width="600" height="800" loading="lazy" decoding="async"></span></span><span class="w8cer-slat w8cer-s4"><span class="w8cer-drop"><img src="https://images.pexels.com/photos/3847438/pexels-photo-3847438.jpeg?auto=compress&cs=tinysrgb&w=600" alt="" width="600" height="800" loading="lazy" decoding="async"></span></span>
<span class="w8cer-cap"><span class="w8cer-name">Shoreline bowls</span><span class="w8cer-meta"><span>Stoneware, ink and sand glazes</span><span>$38</span></span></span>
</a></li>
<li><a href="#" class="w8cer-card" style="background:#6b5a45">
<span class="w8cer-swatch"><span class="w8cer-tag">Glaze 3</span><span class="w8cer-name">Bisque mugs</span></span>
<span class="w8cer-slat w8cer-s0"><span class="w8cer-drop"><img src="https://images.pexels.com/photos/8063803/pexels-photo-8063803.jpeg?auto=compress&cs=tinysrgb&w=600" alt="Rows of unglazed pale clay mugs on a workshop shelf" width="600" height="800" loading="lazy" decoding="async"></span></span><span class="w8cer-slat w8cer-s1"><span class="w8cer-drop"><img src="https://images.pexels.com/photos/8063803/pexels-photo-8063803.jpeg?auto=compress&cs=tinysrgb&w=600" alt="" width="600" height="800" loading="lazy" decoding="async"></span></span><span class="w8cer-slat w8cer-s2"><span class="w8cer-drop"><img src="https://images.pexels.com/photos/8063803/pexels-photo-8063803.jpeg?auto=compress&cs=tinysrgb&w=600" alt="" width="600" height="800" loading="lazy" decoding="async"></span></span><span class="w8cer-slat w8cer-s3"><span class="w8cer-drop"><img src="https://images.pexels.com/photos/8063803/pexels-photo-8063803.jpeg?auto=compress&cs=tinysrgb&w=600" alt="" width="600" height="800" loading="lazy" decoding="async"></span></span><span class="w8cer-slat w8cer-s4"><span class="w8cer-drop"><img src="https://images.pexels.com/photos/8063803/pexels-photo-8063803.jpeg?auto=compress&cs=tinysrgb&w=600" alt="" width="600" height="800" loading="lazy" decoding="async"></span></span>
<span class="w8cer-cap"><span class="w8cer-name">Bisque mugs</span><span class="w8cer-meta"><span>Thrown in batches, glazed to order</span><span>$26</span></span></span>
</a></li>
</ul>
</div>
</section>
<style>
/* Change these: section colour, text colour, drop time, delay between strips (--w8cer-step). */
.w8cer { --w8cer-bg: #a9482a; --w8cer-text: #f6ece0; --w8cer-time: .7s; --w8cer-step: 70ms; }
.w8cer { background: var(--w8cer-bg); color: var(--w8cer-text); padding: 72px 20px; font-family: ui-sans-serif, system-ui, sans-serif; }
.w8cer-wrap { max-width: 64rem; margin: 0 auto; }
.w8cer-kicker { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: #f3d9c4; }
.w8cer-title { margin: 12px 0 0; font: 400 clamp(30px, 4vw, 36px)/1.2 ui-serif, Georgia, serif; }
.w8cer-lead { margin: 12px 0 0; max-width: 28rem; font-size: 16px; line-height: 1.5; color: #f3dccb; }
.w8cer-grid { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 24px; }
@media (min-width: 640px) { .w8cer-grid { grid-template-columns: repeat(3, 1fr); } }
.w8cer-card { position: relative; display: block; overflow: hidden; aspect-ratio: 3 / 4; border-radius: 6px; color: var(--w8cer-text); text-decoration: none; outline: none; }
.w8cer-card:focus-visible { box-shadow: 0 0 0 3px var(--w8cer-bg), 0 0 0 5px var(--w8cer-text); }
.w8cer-swatch { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 22px; }
.w8cer-tag { font-size: 12px; letter-spacing: .25em; text-transform: uppercase; color: #f3dccb; }
.w8cer-name { display: block; font: 400 24px/1.25 ui-serif, Georgia, serif; }
/* Five strips, each a mask holding the same photo shifted into place; they drop in one after another. */
.w8cer-slat { position: absolute; top: 0; bottom: 0; width: 20%; overflow: hidden; }
.w8cer-s1 { left: 20%; } .w8cer-s2 { left: 40%; } .w8cer-s3 { left: 60%; } .w8cer-s4 { left: 80%; } .w8cer-s0 { left: 0; }
.w8cer-drop { position: absolute; inset: 0; transform: translateY(-101%); transition: transform var(--w8cer-time) cubic-bezier(.7,0,.2,1); }
.w8cer-s1 .w8cer-drop { transition-delay: var(--w8cer-step); } .w8cer-s2 .w8cer-drop { transition-delay: calc(var(--w8cer-step) * 2); }
.w8cer-s3 .w8cer-drop { transition-delay: calc(var(--w8cer-step) * 3); } .w8cer-s4 .w8cer-drop { transition-delay: calc(var(--w8cer-step) * 4); }
.w8cer-drop img { position: absolute; top: 0; width: 500%; height: 100%; max-width: none; object-fit: cover; }
.w8cer-s1 img { left: -100%; } .w8cer-s2 img { left: -200%; } .w8cer-s3 img { left: -300%; } .w8cer-s4 img { left: -400%; } .w8cer-s0 img { left: 0; }
.w8cer-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 22px 20px; background: linear-gradient(to top, rgba(20,10,6,.82), rgba(20,10,6,0)); opacity: 0; transition: opacity .4s ease .25s; }
.w8cer-meta { display: flex; justify-content: space-between; margin-top: 4px; font-size: 14px; color: #f3dccb; }
.w8cer-card[data-on] .w8cer-drop, .w8cer-card:hover .w8cer-drop, .w8cer-card:focus-visible .w8cer-drop { transform: none; }
.w8cer-card[data-on] .w8cer-cap, .w8cer-card:hover .w8cer-cap, .w8cer-card:focus-visible .w8cer-cap { opacity: 1; }
/* Phones and reduced motion: every photo is already in place. */
@media (max-width: 767px), (prefers-reduced-motion: reduce) {
.w8cer-drop { transform: none; transition: none; }
.w8cer-cap { opacity: 1; transition: none; }
}
</style>
<script>
(function () {
/* Change this: ms between idle reveals before anyone points or tabs. */
var DELAY = 2000;
var root = document.querySelector(".w8cer");
if (!root || matchMedia("(prefers-reduced-motion: reduce)").matches) return;
var cards = root.querySelectorAll(".w8cer-card"), i = 0, t = 0, vis = true, live = true;
function set(n) { for (var k = 0; k < cards.length; k++) cards[k].toggleAttribute("data-on", k === n); }
function run() {
clearInterval(t); t = 0;
if (live && vis) t = setInterval(function () { i = (i + 1) % cards.length; set(i); }, DELAY);
}
/* a real mouse or keyboard takes over from the idle demo */
function stop() { live = false; set(-1); run(); }
root.addEventListener("pointerenter", function (e) { if (e.pointerType === "mouse") stop(); });
root.addEventListener("focusin", stop);
new IntersectionObserver(function (e) { vis = e[0].isIntersecting; run(); }).observe(root);
run();
})();
</script>
With reduced motion: Every card shows its photo and caption from the start, with no falling strips.
Running cost: Five translated strips per card share one cached photo, so a reveal moves five small layers and repaints nothing.
- Set `--w8cer-step` for the gap between strips and `--w8cer-time` for how long each fall takes.
- Give each card its own resting colour through the inline `background` on `.w8cer-card`.
- Change `SLATS` in the React version for more or fewer strips; the vanilla file uses five fixed `w8cer-s` classes.
Course Rows With A Splitting Photo Band
A boat club's course list in large type on deep navy. Hover or focus a row and the full-width photo behind it arrives in two halves, one sliding down and one sliding up until they meet, while a dark shade keeps the course name readable. Phones and reduced motion get a thumbnail per row instead.
<section class="w8sea">
<div class="w8sea-wrap">
<p class="w8sea-kicker">Saltmarsh Boat Club</p>
<h2 class="w8sea-title">Pick a way onto the water</h2>
<ul class="w8sea-list">
<li><a href="#" class="w8sea-row" data-on><span class="w8sea-half w8sea-top" aria-hidden="true"><span class="w8sea-slide"><img src="https://images.pexels.com/photos/3686785/pexels-photo-3686785.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="" width="1200" height="800" loading="lazy" decoding="async"></span></span><span class="w8sea-half w8sea-bot" aria-hidden="true"><span class="w8sea-slide"><img src="https://images.pexels.com/photos/3686785/pexels-photo-3686785.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="" width="1200" height="800" loading="lazy" decoding="async"></span></span><span class="w8sea-shade" aria-hidden="true"></span><img class="w8sea-thumb" src="https://images.pexels.com/photos/3686785/pexels-photo-3686785.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="A small sailing boat with a red and yellow sail on a calm grey sea" width="96" height="64" loading="lazy" decoding="async"><span class="w8sea-text"><span class="w8sea-name">Dinghy sailing</span><span class="w8sea-sub">Saturdays, April to September</span></span><span class="w8sea-when">Saturdays, April to September</span></a></li>
<li><a href="#" class="w8sea-row"><span class="w8sea-half w8sea-top" aria-hidden="true"><span class="w8sea-slide"><img src="https://images.pexels.com/photos/5704472/pexels-photo-5704472.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="" width="1200" height="800" loading="lazy" decoding="async"></span></span><span class="w8sea-half w8sea-bot" aria-hidden="true"><span class="w8sea-slide"><img src="https://images.pexels.com/photos/5704472/pexels-photo-5704472.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="" width="1200" height="800" loading="lazy" decoding="async"></span></span><span class="w8sea-shade" aria-hidden="true"></span><img class="w8sea-thumb" src="https://images.pexels.com/photos/5704472/pexels-photo-5704472.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="A kayaker paddling across a dark lake between wooded hills" width="96" height="64" loading="lazy" decoding="async"><span class="w8sea-text"><span class="w8sea-name">Lake kayaking</span><span class="w8sea-sub">Weekday evenings</span></span><span class="w8sea-when">Weekday evenings</span></a></li>
<li><a href="#" class="w8sea-row"><span class="w8sea-half w8sea-top" aria-hidden="true"><span class="w8sea-slide"><img src="https://images.pexels.com/photos/5022032/pexels-photo-5022032.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="" width="1200" height="800" loading="lazy" decoding="async"></span></span><span class="w8sea-half w8sea-bot" aria-hidden="true"><span class="w8sea-slide"><img src="https://images.pexels.com/photos/5022032/pexels-photo-5022032.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="" width="1200" height="800" loading="lazy" decoding="async"></span></span><span class="w8sea-shade" aria-hidden="true"></span><img class="w8sea-thumb" src="https://images.pexels.com/photos/5022032/pexels-photo-5022032.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="An empty white rowing boat with blue seats moored on still blue water" width="96" height="64" loading="lazy" decoding="async"><span class="w8sea-text"><span class="w8sea-name">Rowing for two</span><span class="w8sea-sub">Sunday mornings</span></span><span class="w8sea-when">Sunday mornings</span></a></li>
<li><a href="#" class="w8sea-row"><span class="w8sea-half w8sea-top" aria-hidden="true"><span class="w8sea-slide"><img src="https://images.pexels.com/photos/7426234/pexels-photo-7426234.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="" width="1200" height="800" loading="lazy" decoding="async"></span></span><span class="w8sea-half w8sea-bot" aria-hidden="true"><span class="w8sea-slide"><img src="https://images.pexels.com/photos/7426234/pexels-photo-7426234.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="" width="1200" height="800" loading="lazy" decoding="async"></span></span><span class="w8sea-shade" aria-hidden="true"></span><img class="w8sea-thumb" src="https://images.pexels.com/photos/7426234/pexels-photo-7426234.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="A paddleboarder seen from above on clear turquoise water" width="96" height="64" loading="lazy" decoding="async"><span class="w8sea-text"><span class="w8sea-name">Paddleboarding</span><span class="w8sea-sub">Daily in July and August</span></span><span class="w8sea-when">Daily in July and August</span></a></li>
</ul>
</div>
</section>
<style>
/* Change these: navy background, gold accent, split time, how dark the photo gets behind the words. */
.w8sea { --w8sea-bg: #101b33; --w8sea-gold: #f0c987; --w8sea-time: .75s; --w8sea-shade: .78; }
.w8sea { background: var(--w8sea-bg); color: #eef2f8; padding: 72px 20px; font-family: ui-sans-serif, system-ui, sans-serif; }
.w8sea-wrap { max-width: 64rem; margin: 0 auto; }
.w8sea-kicker { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--w8sea-gold); }
.w8sea-title { margin: 12px 0 0; font-size: clamp(30px, 4vw, 36px); font-weight: 600; letter-spacing: -.02em; }
.w8sea-list { list-style: none; margin: 40px 0 0; padding: 0; border-bottom: 1px solid #2a3a5c; }
.w8sea-text { margin-right: auto; }
.w8sea-name { font-size: clamp(24px, 3.4vw, 36px); font-weight: 600; letter-spacing: -.02em; }
.w8sea-sub { display: none; font-size: 14px; color: #c9d3e3; }
.w8sea-when { font-size: 14px; color: #c9d3e3; }
/* Two half-height masks hold the same photo; the halves slide in from above and below and meet in the middle. */
.w8sea-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 34px 20px; border-top: 1px solid #2a3a5c; color: #eef2f8; text-decoration: none; outline: none; isolation: isolate; }
.w8sea-row:focus-visible { outline: 2px solid var(--w8sea-gold); outline-offset: -2px; }
.w8sea-half { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; z-index: -1; }
.w8sea-top { top: 0; } .w8sea-bot { bottom: 0; }
.w8sea-slide { position: absolute; inset: 0; transition: transform var(--w8sea-time) cubic-bezier(.7,0,.2,1); }
.w8sea-top .w8sea-slide { transform: translateY(-201%); } .w8sea-bot .w8sea-slide { transform: translateY(201%); }
.w8sea-slide img { position: absolute; left: 0; width: 100%; height: 200%; max-width: none; object-fit: cover; }
.w8sea-top img { top: 0; } .w8sea-bot img { top: -100%; }
.w8sea-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(10,18,36,var(--w8sea-shade)), rgba(10,18,36,.25)); opacity: 0; transition: opacity .5s ease .15s; }
.w8sea-name { display: inline-block; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.w8sea-row[data-on] .w8sea-slide, .w8sea-row:hover .w8sea-slide, .w8sea-row:focus-visible .w8sea-slide { transform: none; }
.w8sea-row[data-on] .w8sea-shade, .w8sea-row:hover .w8sea-shade, .w8sea-row:focus-visible .w8sea-shade { opacity: 1; }
.w8sea-row[data-on] .w8sea-name, .w8sea-row:hover .w8sea-name, .w8sea-row:focus-visible .w8sea-name { transform: translateX(12px); }
.w8sea-thumb { display: none; }
@media (max-width: 767px), (prefers-reduced-motion: reduce) {
.w8sea-half, .w8sea-shade { display: none; }
.w8sea-name { transform: none !important; transition: none; }
.w8sea-row { justify-content: flex-start; padding: 16px 0; }
.w8sea-thumb { display: block; flex: none; width: 96px; height: 64px; object-fit: cover; border-radius: 6px; }
}
@media (max-width: 767px) { .w8sea-sub { display: block; } .w8sea-when { display: none; } }
</style>
<script>
(function () {
/* Change this: ms between idle reveals before anyone points or tabs. */
var DELAY = 1900;
var root = document.querySelector(".w8sea");
if (!root || matchMedia("(prefers-reduced-motion: reduce)").matches) return;
var rows = root.querySelectorAll(".w8sea-row"), i = 0, t = 0, vis = true, live = true;
function set(n) { for (var k = 0; k < rows.length; k++) rows[k].toggleAttribute("data-on", k === n); }
function run() {
clearInterval(t); t = 0;
if (live && vis) t = setInterval(function () { i = (i + 1) % rows.length; set(i); }, DELAY);
}
/* a real mouse or keyboard takes over from the idle demo */
function stop() { live = false; set(-1); run(); }
root.addEventListener("pointerenter", function (e) { if (e.pointerType === "mouse") stop(); });
root.addEventListener("focusin", stop);
new IntersectionObserver(function (e) { vis = e[0].isIntersecting; run(); }).observe(root);
run();
})();
</script>
With reduced motion: Rows show a small photo beside each course name and the band behind the words never opens.
Running cost: Each reveal translates two half-height masks and fades one shade layer, all on the compositor.
- Change `--w8sea-time` to slow the two halves down or speed them up.
- Raise or lower `--w8sea-shade` for a darker or lighter photo under the words.
- Swap `--w8sea-gold` to recolour the label and the focus outline.
Flower Words Opening Photo Windows
A florist's weekly stock written as one large serif sentence on deep green. The three flower names are underlined links, and resting on one, or tabbing to it, lifts a cream card above the word with that flower rising into it. Phones skip the cards and show the photos in a strip below.
<section class="w8flo">
<div class="w8flo-wrap">
<p class="w8flo-kicker">Mossgate Flowers, Tuesday stock</p>
<h2 class="w8flo-line">This week the counter holds <span class="w8flo-hold" data-on><a href="#" class="w8flo-word">peonies</a><span class="w8flo-pop" aria-hidden="true"><span class="w8flo-mask"><img class="w8flo-img" src="https://images.pexels.com/photos/36399727/pexels-photo-36399727.jpeg?auto=compress&cs=tinysrgb&w=400" alt="" width="400" height="300" loading="lazy" decoding="async"></span></span></span> wrapped in black paper, <span class="w8flo-hold"><a href="#" class="w8flo-word">eucalyptus</a><span class="w8flo-pop" aria-hidden="true"><span class="w8flo-mask"><img class="w8flo-img" src="https://images.pexels.com/photos/1026237/pexels-photo-1026237.jpeg?auto=compress&cs=tinysrgb&w=400" alt="" width="400" height="300" loading="lazy" decoding="async"></span></span></span> cut by the bunch, and <span class="w8flo-hold"><a href="#" class="w8flo-word">ranunculus</a><span class="w8flo-pop" aria-hidden="true"><span class="w8flo-mask"><img class="w8flo-img" src="https://images.pexels.com/photos/7409746/pexels-photo-7409746.jpeg?auto=compress&cs=tinysrgb&w=400" alt="" width="400" height="300" loading="lazy" decoding="async"></span></span></span> in tin pails.</h2>
<div class="w8flo-strip">
<figure><img src="https://images.pexels.com/photos/36399727/pexels-photo-36399727.jpeg?auto=compress&cs=tinysrgb&w=400" alt="A bunch of pink peonies wrapped in black paper" width="400" height="300" loading="lazy" decoding="async"><figcaption>peonies</figcaption></figure>
<figure><img src="https://images.pexels.com/photos/1026237/pexels-photo-1026237.jpeg?auto=compress&cs=tinysrgb&w=400" alt="Round silver-green eucalyptus leaves on their branches" width="400" height="300" loading="lazy" decoding="async"><figcaption>eucalyptus</figcaption></figure>
<figure><img src="https://images.pexels.com/photos/7409746/pexels-photo-7409746.jpeg?auto=compress&cs=tinysrgb&w=400" alt="Pale pink ranunculus gathered in a grey metal pail" width="400" height="300" loading="lazy" decoding="async"><figcaption>ranunculus</figcaption></figure>
</div>
<p class="w8flo-note">Each name links to the stems on the counter and the colours they come in.</p>
</div>
</section>
<style>
/* Change these: background, text, gold underline, photo window width. */
.w8flo { --w8flo-bg: #1f2f27; --w8flo-text: #e6dcc6; --w8flo-gold: #c9a96a; --w8flo-pop: 176px; }
.w8flo { background: var(--w8flo-bg); color: var(--w8flo-text); padding: 192px 20px 64px; font-family: ui-sans-serif, system-ui, sans-serif; }
.w8flo-wrap { max-width: 48rem; margin: 0 auto; }
.w8flo-kicker { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--w8flo-gold); }
.w8flo-line { margin: 20px 0 0; font: 400 clamp(30px, 5vw, 48px)/1.25 ui-serif, Georgia, serif; }
.w8flo-hold { position: relative; display: inline-block; }
.w8flo-word { color: #f3ead7; font-style: italic; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; text-decoration-color: var(--w8flo-gold); border-radius: 4px; outline: none; }
.w8flo-word:focus-visible { outline: 2px solid var(--w8flo-gold); outline-offset: 4px; }
/* The card fades and lifts; the photo inside rises through the card's rounded mask. */
.w8flo-pop { position: absolute; z-index: 3; left: 50%; bottom: calc(100% + 12px); width: var(--w8flo-pop); margin-left: calc(var(--w8flo-pop) / -2); padding: 6px; border-radius: 12px; background: #f3ead7; opacity: 0; transform: translateY(14px) scale(.94); transform-origin: 50% 100%; transition: opacity .3s ease, transform .55s cubic-bezier(.2,.9,.25,1.15); pointer-events: none; box-shadow: 0 24px 40px -18px rgba(0,0,0,.6); }
.w8flo-mask { display: block; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 8px; background: #2c4236; }
.w8flo-img { display: block; width: 100%; height: 100%; object-fit: cover; transform: translateY(100%) scale(1.2); transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.w8flo-hold[data-on] .w8flo-pop, .w8flo-hold:hover .w8flo-pop, .w8flo-hold:focus-within .w8flo-pop { opacity: 1; transform: none; }
.w8flo-hold[data-on] .w8flo-img, .w8flo-hold:hover .w8flo-img, .w8flo-hold:focus-within .w8flo-img { transform: none; }
.w8flo-strip { display: none; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 32px; }
.w8flo-strip figure { margin: 0; }
.w8flo-strip img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
.w8flo-strip figcaption { margin-top: 8px; font-size: 14px; color: #cfc4ab; }
.w8flo-note { margin: 40px 0 0; max-width: 28rem; font-size: 16px; line-height: 1.5; color: #cfc4ab; }
/* Phones and reduced motion: the photos sit in a strip under the sentence. */
@media (max-width: 767px) { .w8flo { padding-top: 64px; } .w8flo-pop { display: none; } .w8flo-strip { display: grid; } }
@media (prefers-reduced-motion: reduce) { .w8flo-pop { display: none; } .w8flo-strip { display: grid; } }
</style>
<script>
(function () {
/* Change this: ms between idle reveals before anyone points or tabs. */
var DELAY = 1900;
var root = document.querySelector(".w8flo");
if (!root || matchMedia("(prefers-reduced-motion: reduce)").matches) return;
var holds = root.querySelectorAll(".w8flo-hold"), i = 0, t = 0, vis = true, live = true;
function set(n) { for (var k = 0; k < holds.length; k++) holds[k].toggleAttribute("data-on", k === n); }
function run() {
clearInterval(t); t = 0;
if (live && vis) t = setInterval(function () { i = (i + 1) % holds.length; set(i); }, DELAY);
}
/* a real mouse or keyboard takes over from the idle demo */
function stop() { live = false; set(-1); run(); }
root.addEventListener("pointerenter", function (e) { if (e.pointerType === "mouse") stop(); });
root.addEventListener("focusin", stop);
new IntersectionObserver(function (e) { vis = e[0].isIntersecting; run(); }).observe(root);
run();
})();
</script>
With reduced motion: The small cards stay closed and the three photos sit in a captioned strip under the sentence.
Running cost: Each card is one opacity and transform change plus a translate on its photo; the idle timer pauses off screen.
- Set `--w8flo-pop` to make the floating card wider; its height follows the 4 by 3 frame.
- Change `--w8flo-gold` to recolour the underline and focus ring together.
- Edit the `stems` array in the React version to swap words and photos in one place.
Hotel Room Cards Sliding To A Second View
Two guest-house room cards on white, each holding a second photo just outside its frame. Hovering a card pushes the room aside as the balcony or valley slides in, and a small label rolls over to name the new view. A real button on every card does the same swap for touch and keyboard users.
<section class="w8rom">
<div class="w8rom-wrap">
<p class="w8rom-kicker">Larkspur House</p>
<div class="w8rom-top">
<h2 class="w8rom-title">Two rooms, two outlooks</h2>
<p class="w8rom-lead">Hover a room, or press its view button, to see what lies past the window.</p>
</div>
<div class="w8rom-grid">
<article class="w8rom-card" data-on>
<div class="w8rom-frame">
<img class="w8rom-img w8rom-a" src="https://images.pexels.com/photos/2899687/pexels-photo-2899687.jpeg?auto=compress&cs=tinysrgb&w=800" alt="A hotel room with sheer curtains open onto a terrace and palm trees" width="800" height="600" loading="lazy" decoding="async">
<img class="w8rom-img w8rom-b" src="https://images.pexels.com/photos/3225561/pexels-photo-3225561.jpeg?auto=compress&cs=tinysrgb&w=800" alt="Glass doors opening onto a balcony with chairs and palm trees outside" width="800" height="600" loading="lazy" decoding="async">
<span class="w8rom-chip" aria-hidden="true"><span>The room</span><span>The balcony</span></span>
</div>
<div class="w8rom-body">
<div>
<h3 class="w8rom-name"><a href="#" class="w8rom-link">Shore Room</a></h3>
<p class="w8rom-note">Queen bed, sheer curtains, a step out to the terrace</p>
<p class="w8rom-rate">From $210 a night</p>
</div>
<button type="button" class="w8rom-btn" aria-pressed="true">Show room</button>
</div>
</article>
<article class="w8rom-card">
<div class="w8rom-frame">
<img class="w8rom-img w8rom-a" src="https://images.pexels.com/photos/2346091/pexels-photo-2346091.jpeg?auto=compress&cs=tinysrgb&w=800" alt="A dim bedroom whose window looks out on mountains at sunset" width="800" height="600" loading="lazy" decoding="async">
<img class="w8rom-img w8rom-b" src="https://images.pexels.com/photos/18311189/pexels-photo-18311189.jpeg?auto=compress&cs=tinysrgb&w=800" alt="A green alpine valley below snowy mountain peaks" width="800" height="600" loading="lazy" decoding="async">
<span class="w8rom-chip" aria-hidden="true"><span>The room</span><span>The valley</span></span>
</div>
<div class="w8rom-body">
<div>
<h3 class="w8rom-name"><a href="#" class="w8rom-link">Ridge Room</a></h3>
<p class="w8rom-note">Low bed, reading chair, a west window for the evening light</p>
<p class="w8rom-rate">From $180 a night</p>
</div>
<button type="button" class="w8rom-btn" aria-pressed="false">Show view</button>
</div>
</article>
</div>
</div>
</section>
<style>
/* Change these: ink colour, muted text, how far the first photo is pushed (--w8rom-push), slide time. */
.w8rom { --w8rom-ink: #0f172a; --w8rom-muted: #475569; --w8rom-push: -35%; --w8rom-time: .8s; }
.w8rom { background: #fff; color: var(--w8rom-ink); padding: 72px 20px; font-family: ui-sans-serif, system-ui, sans-serif; }
.w8rom-wrap { max-width: 64rem; margin: 0 auto; }
.w8rom-kicker { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .25em; text-transform: uppercase; color: #64748b; }
.w8rom-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 12px; }
.w8rom-title { margin: 0; font-size: clamp(30px, 4vw, 36px); font-weight: 600; letter-spacing: -.02em; }
.w8rom-lead { margin: 0; max-width: 24rem; font-size: 16px; line-height: 1.5; color: var(--w8rom-muted); }
.w8rom-grid { display: grid; gap: 32px; margin-top: 40px; }
@media (min-width: 768px) { .w8rom-grid { grid-template-columns: 1fr 1fr; } }
.w8rom-frame { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 14px; background: #cbd5e1; }
.w8rom-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--w8rom-time) cubic-bezier(.65,0,.2,1); }
.w8rom-b { transform: translateX(100%); }
.w8rom-chip { position: absolute; left: 14px; bottom: 14px; height: 30px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--w8rom-ink); font-size: 13px; font-weight: 600; }
.w8rom-chip span { display: block; height: 30px; line-height: 30px; padding: 0 12px; transition: transform .6s cubic-bezier(.65,0,.2,1); }
.w8rom-card[data-on] .w8rom-a { transform: translateX(var(--w8rom-push)); }
.w8rom-card[data-on] .w8rom-b { transform: none; }
.w8rom-card[data-on] .w8rom-chip span { transform: translateY(-100%); }
@media (hover: hover) and (pointer: fine) {
.w8rom-card:hover .w8rom-a { transform: translateX(var(--w8rom-push)); }
.w8rom-card:hover .w8rom-b { transform: none; }
.w8rom-card:hover .w8rom-chip span { transform: translateY(-100%); }
}
.w8rom-body { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-top: 20px; }
.w8rom-name { margin: 0; font-size: 20px; font-weight: 600; }
.w8rom-link { color: inherit; text-decoration: none; border-radius: 4px; }
.w8rom-note { margin: 4px 0 0; font-size: 14px; color: var(--w8rom-muted); }
.w8rom-rate { margin: 8px 0 0; font-size: 14px; font-weight: 500; color: #1e293b; }
.w8rom-btn { flex: none; height: 40px; padding: 0 16px; border: 1px solid #cbd5e1; border-radius: 999px; background: #fff; color: #1e293b; font: 500 14px/1 inherit; font-family: inherit; cursor: pointer; }
.w8rom-btn:hover { background: #f8fafc; }
.w8rom-btn:focus-visible, .w8rom-link:focus-visible { outline: 2px solid var(--w8rom-ink); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .w8rom-img, .w8rom-chip span { transition: none; } }
</style>
<script>
(function () {
/* Change this: ms between idle swaps before anyone points, taps or tabs. */
var DELAY = 2200;
var root = document.querySelector(".w8rom");
if (!root) return;
var cards = root.querySelectorAll(".w8rom-card"), live = true, vis = true, t = 0, step = 0;
function set(card, on) {
card.toggleAttribute("data-on", on);
var b = card.querySelector(".w8rom-btn");
b.setAttribute("aria-pressed", on); b.textContent = on ? "Show room" : "Show view";
}
cards.forEach(function (c) {
c.querySelector(".w8rom-btn").addEventListener("click", function () { live = false; run(); set(c, !c.hasAttribute("data-on")); });
});
var still = matchMedia("(prefers-reduced-motion: reduce)").matches;
function run() {
clearInterval(t); t = 0;
if (live && vis && !still) t = setInterval(function () { step = (step + 1) % 4; set(cards[0], step === 0); set(cards[1], step === 2); }, DELAY);
}
/* a real mouse or the keyboard takes over from the idle demo */
function stop() { if (!live) return; live = false; run(); cards.forEach(function (c) { set(c, false); }); }
root.addEventListener("pointerenter", function (e) { if (e.pointerType === "mouse") stop(); });
root.addEventListener("focusin", stop);
new IntersectionObserver(function (e) { vis = e[0].isIntersecting; run(); }).observe(root);
run();
})();
</script>
With reduced motion: The photos swap instantly when the button is pressed, with no sliding.
Running cost: Two stacked photos per card move with transform only; the idle timer stops when the section leaves the screen.
- Change `--w8rom-push` to set how far the first photo drifts while the second one arrives.
- Slow or quicken the slide with `--w8rom-time`.
- Edit the two label spans in each `.w8rom-chip` when the second photo shows something else.
Project Index With Direction Aware Frame
An architecture studio index on graphite: a numbered list of buildings beside one tall frame. Moving down the list pushes the next photo up from below, moving up brings it down from above, so the frame seems to scroll with your eye. On phones the frame goes away and each row carries its own small photo.
<section class="w8arc">
<div class="w8arc-wrap">
<div>
<p class="w8arc-kicker">Okafor Lund Studio</p>
<h2 class="w8arc-title">Selected buildings</h2>
<p class="w8arc-lead">Four recent projects, from a one-room cabin to a public library. Each name leads to drawings and notes.</p>
<ul class="w8arc-list">
<li><a href="#" class="w8arc-row" data-on><span class="w8arc-num">01</span><img class="w8arc-thumb" src="https://images.pexels.com/photos/13041129/pexels-photo-13041129.jpeg?auto=compress&cs=tinysrgb&w=800" alt="" width="72" height="90" loading="lazy" decoding="async"><span><span class="w8arc-name">Linden Court House</span><span class="w8arc-sub">Private house, 2025</span></span><span class="w8arc-year">Private house, 2025</span></a></li>
<li><a href="#" class="w8arc-row"><span class="w8arc-num">02</span><img class="w8arc-thumb" src="https://images.pexels.com/photos/10849919/pexels-photo-10849919.jpeg?auto=compress&cs=tinysrgb&w=800" alt="" width="72" height="90" loading="lazy" decoding="async"><span><span class="w8arc-name">Birch Hollow Cabin</span><span class="w8arc-sub">Holiday cabin, 2024</span></span><span class="w8arc-year">Holiday cabin, 2024</span></a></li>
<li><a href="#" class="w8arc-row"><span class="w8arc-num">03</span><img class="w8arc-thumb" src="https://images.pexels.com/photos/35378714/pexels-photo-35378714.jpeg?auto=compress&cs=tinysrgb&w=800" alt="" width="72" height="90" loading="lazy" decoding="async"><span><span class="w8arc-name">Westgate Reading Room</span><span class="w8arc-sub">Public library, 2023</span></span><span class="w8arc-year">Public library, 2023</span></a></li>
<li><a href="#" class="w8arc-row"><span class="w8arc-num">04</span><img class="w8arc-thumb" src="https://images.pexels.com/photos/34916272/pexels-photo-34916272.jpeg?auto=compress&cs=tinysrgb&w=800" alt="" width="72" height="90" loading="lazy" decoding="async"><span><span class="w8arc-name">Quarry Lane Flats</span><span class="w8arc-sub">Housing, 2022</span></span><span class="w8arc-year">Housing, 2022</span></a></li>
</ul>
</div>
<div class="w8arc-side">
<div class="w8arc-frame">
<img class="w8arc-img" src="https://images.pexels.com/photos/13041129/pexels-photo-13041129.jpeg?auto=compress&cs=tinysrgb&w=800" alt="A pale concrete house with a tall glass wall beside a planted garden path" width="800" height="1000" loading="lazy" decoding="async">
<img class="w8arc-img" src="https://images.pexels.com/photos/10849919/pexels-photo-10849919.jpeg?auto=compress&cs=tinysrgb&w=800" alt="A small timber cabin with an open porch standing among birch trees" width="800" height="1000" loading="lazy" decoding="async">
<img class="w8arc-img" src="https://images.pexels.com/photos/35378714/pexels-photo-35378714.jpeg?auto=compress&cs=tinysrgb&w=800" alt="A library hall with long curved wooden bookshelves under warm light" width="800" height="1000" loading="lazy" decoding="async">
<img class="w8arc-img" src="https://images.pexels.com/photos/34916272/pexels-photo-34916272.jpeg?auto=compress&cs=tinysrgb&w=800" alt="A grey concrete apartment block with an outdoor steel staircase and trees" width="800" height="1000" loading="lazy" decoding="async">
</div>
<p class="w8arc-count" aria-hidden="true">01 / 04</p>
</div>
</div>
</section>
<style>
/* Change these: background, text, accent, frame width, slide time. */
.w8arc { --w8arc-bg: #1c1d20; --w8arc-text: #f2f0eb; --w8arc-accent: #e8c37a; --w8arc-frame: 340px; --w8arc-time: .8s; }
.w8arc { background: var(--w8arc-bg); color: var(--w8arc-text); padding: 72px 20px; font-family: ui-sans-serif, system-ui, sans-serif; }
.w8arc-wrap { display: grid; gap: 48px; align-items: start; max-width: 64rem; margin: 0 auto; }
@media (min-width: 768px) { .w8arc-wrap { grid-template-columns: 1fr var(--w8arc-frame); } .w8arc-side { position: sticky; top: 32px; } }
.w8arc-kicker { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--w8arc-accent); }
.w8arc-title { margin: 12px 0 0; font-size: clamp(30px, 4vw, 36px); font-weight: 600; letter-spacing: -.02em; }
.w8arc-lead { margin: 12px 0 0; max-width: 28rem; font-size: 16px; line-height: 1.5; color: #b9bcc2; }
.w8arc-list { list-style: none; margin: 40px 0 0; padding: 0; border-bottom: 1px solid #3a3d42; }
.w8arc-frame { position: relative; overflow: hidden; aspect-ratio: 4 / 5; border-radius: 4px; background: #2a2c30; }
.w8arc-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: translateY(100%); transition: transform var(--w8arc-time) cubic-bezier(.7,0,.2,1); }
.w8arc-img:first-child { transform: none; z-index: 2; }
.w8arc-img[data-z="2"] { z-index: 2; } .w8arc-img[data-z="1"] { z-index: 1; } .w8arc-img[data-z="0"] { z-index: 0; }
.w8arc-count { margin: 12px 0 0; text-align: right; font-size: 14px; color: #8d9198; font-variant-numeric: tabular-nums; }
.w8arc-row { display: grid; grid-template-columns: 2.5rem 1fr auto; align-items: baseline; gap: 12px; padding: 18px 8px; border-top: 1px solid #3a3d42; color: #a7abb2; text-decoration: none; outline: none; transition: color .3s; }
.w8arc-num { font-size: 14px; color: #8d9198; font-variant-numeric: tabular-nums; }
.w8arc-name { display: inline-block; font-size: 24px; font-weight: 500; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.w8arc-sub { display: none; font-size: 14px; color: #a7abb2; }
.w8arc-year { font-size: 14px; color: #a7abb2; }
.w8arc-row[data-on] { color: var(--w8arc-text); }
.w8arc-row[data-on] .w8arc-name { transform: translateX(8px); }
.w8arc-row:focus-visible { outline: 2px solid var(--w8arc-accent); outline-offset: 2px; border-radius: 4px; }
.w8arc-thumb { display: none; }
/* Phones: no shared frame; every row carries its own photo. */
@media (max-width: 767px) {
.w8arc-side { display: none; }
.w8arc-row { grid-template-columns: 72px 1fr; align-items: center; color: var(--w8arc-text); }
.w8arc-num, .w8arc-year { display: none; }
.w8arc-name { font-size: 20px; transform: none !important; }
.w8arc-sub { display: block; }
.w8arc-thumb { display: block; width: 72px; height: 90px; object-fit: cover; border-radius: 3px; }
}
@media (prefers-reduced-motion: reduce) { .w8arc-img, .w8arc-name, .w8arc-row { transition: none; } }
</style>
<script>
(function () {
/* Change these: ms between idle switches, % the old photo drifts away. */
var DELAY = 2000, PUSH = 25;
var root = document.querySelector(".w8arc");
if (!root) return;
var imgs = root.querySelectorAll(".w8arc-img"), rows = root.querySelectorAll(".w8arc-row"), count = root.querySelector(".w8arc-count");
var cur = 0, t = 0, vis = true, live = !matchMedia("(prefers-reduced-motion: reduce)").matches;
function show(n) {
if (n === cur) return;
var dir = n > cur ? 1 : -1, inc = imgs[n], out = imgs[cur];
imgs.forEach(function (im) { im.dataset.z = "0"; });
out.dataset.z = "1"; inc.dataset.z = "2";
/* moving down the list: the new photo enters from below; moving up: from above */
inc.style.transition = "none";
inc.style.transform = "translateY(" + dir * 100 + "%)";
void inc.offsetWidth;
inc.style.transition = ""; inc.style.transform = "none";
out.style.transform = "translateY(" + -dir * PUSH + "%)";
rows.forEach(function (r, k) { r.toggleAttribute("data-on", k === n); });
count.textContent = "0" + (n + 1) + " / 0" + imgs.length;
cur = n;
}
function run() {
clearInterval(t); t = 0;
if (live && vis) t = setInterval(function () { show((cur + 1) % imgs.length); }, DELAY);
}
function stop() { live = false; run(); }
rows.forEach(function (r, i) {
function pick() { stop(); show(i); }
r.addEventListener("pointerenter", pick); r.addEventListener("focus", pick);
});
root.addEventListener("pointerenter", function (e) { if (e.pointerType === "mouse") stop(); });
new IntersectionObserver(function (e) { vis = e[0].isIntersecting; run(); }).observe(root);
run();
})();
</script>
With reduced motion: The frame changes photo at once with no slide, and the idle cycling is off.
Running cost: One shared frame of four photos; each switch moves two of them with transform and leaves the rest untouched.
- Change `PUSH` in the script for how far the outgoing photo drifts under the new one.
- Set `--w8arc-frame` to widen the frame column and `--w8arc-time` for the slide length.
- Swap `--w8arc-accent` to recolour the label and focus ring.
Tea Cards With A Circle Opening To The Cup
Three loose-leaf tea cards on warm sand, each showing the dry leaf at rest. Hover a card and a circle opens from its centre to show the same tea brewed, while a corner tag rolls from Dry leaf to In the cup. A small dark button on each card makes the same swap for taps and keys.
<section class="w8tea">
<div class="w8tea-wrap">
<p class="w8tea-kicker">Oldmill Tea Room</p>
<h2 class="w8tea-title">From the tin to the cup</h2>
<p class="w8tea-lead">Each card shows the dry leaf. Hover it, or press the cup button, to see how it pours.</p>
<div class="w8tea-grid">
<article class="w8tea-card" data-on>
<div class="w8tea-frame">
<img class="w8tea-base" src="https://images.pexels.com/photos/8329977/pexels-photo-8329977.jpeg?auto=compress&cs=tinysrgb&w=600" alt="Dark twisted green tea leaves in a glass jar with a wooden scoop" width="600" height="600" loading="lazy" decoding="async">
<span class="w8tea-lens"><img src="https://images.pexels.com/photos/5946681/pexels-photo-5946681.jpeg?auto=compress&cs=tinysrgb&w=600" alt="Green tea poured into a small celadon cup on a saucer" width="600" height="600" loading="lazy" decoding="async"></span>
<span class="w8tea-tag" aria-hidden="true"><span>Dry leaf</span><span>In the cup</span></span>
</div>
<div class="w8tea-body">
<div>
<h3 class="w8tea-name"><a href="#" class="w8tea-link">Sencha</a></h3>
<p class="w8tea-note">Steamed green, light and grassy</p>
<p class="w8tea-price">$14 / 50 g</p>
</div>
<button type="button" class="w8tea-btn" aria-pressed="true">Show leaf</button>
</div>
</article>
<article class="w8tea-card">
<div class="w8tea-frame">
<img class="w8tea-base" src="https://images.pexels.com/photos/8329983/pexels-photo-8329983.jpeg?auto=compress&cs=tinysrgb&w=600" alt="Loose black tea leaves spilling from a tipped glass jar" width="600" height="600" loading="lazy" decoding="async">
<span class="w8tea-lens"><img src="https://images.pexels.com/photos/1493080/pexels-photo-1493080.jpeg?auto=compress&cs=tinysrgb&w=600" alt="Deep red black tea steaming in a tulip glass on a saucer" width="600" height="600" loading="lazy" decoding="async"></span>
<span class="w8tea-tag" aria-hidden="true"><span>Dry leaf</span><span>In the cup</span></span>
</div>
<div class="w8tea-body">
<div>
<h3 class="w8tea-name"><a href="#" class="w8tea-link">Highland black</a></h3>
<p class="w8tea-note">Malty, dark, good with milk</p>
<p class="w8tea-price">$12 / 50 g</p>
</div>
<button type="button" class="w8tea-btn" aria-pressed="false">Show cup</button>
</div>
</article>
<article class="w8tea-card">
<div class="w8tea-frame">
<img class="w8tea-base" src="https://images.pexels.com/photos/8330328/pexels-photo-8330328.jpeg?auto=compress&cs=tinysrgb&w=600" alt="A scattered pile of curled green tea leaves on linen" width="600" height="600" loading="lazy" decoding="async">
<span class="w8tea-lens"><img src="https://images.pexels.com/photos/7138780/pexels-photo-7138780.jpeg?auto=compress&cs=tinysrgb&w=600" alt="Golden tea in a glass cup beside fresh white jasmine flowers" width="600" height="600" loading="lazy" decoding="async"></span>
<span class="w8tea-tag" aria-hidden="true"><span>Dry leaf</span><span>In the cup</span></span>
</div>
<div class="w8tea-body">
<div>
<h3 class="w8tea-name"><a href="#" class="w8tea-link">Jasmine green</a></h3>
<p class="w8tea-note">Green leaf layered with blossom</p>
<p class="w8tea-price">$16 / 50 g</p>
</div>
<button type="button" class="w8tea-btn" aria-pressed="false">Show cup</button>
</div>
</article>
</div>
</div>
</section>
<style>
/* Change these: sand background, ink colour, accent, how long the circle takes to open. */
.w8tea { --w8tea-bg: #ece3d3; --w8tea-ink: #2f2a22; --w8tea-accent: #7d5b2e; --w8tea-time: .8s; }
.w8tea { background: var(--w8tea-bg); color: var(--w8tea-ink); padding: 72px 20px; font-family: ui-sans-serif, system-ui, sans-serif; }
.w8tea-wrap { max-width: 64rem; margin: 0 auto; }
.w8tea-kicker { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--w8tea-accent); }
.w8tea-title { margin: 12px 0 0; font: 400 clamp(30px, 4vw, 36px)/1.2 ui-serif, Georgia, serif; }
.w8tea-lead { margin: 12px 0 0; max-width: 28rem; font-size: 16px; line-height: 1.5; color: #5a5042; }
.w8tea-grid { display: grid; gap: 32px; margin-top: 40px; }
@media (min-width: 640px) { .w8tea-grid { grid-template-columns: repeat(3, 1fr); } }
/* The lens is a circle drawn at full size and scaled; the cup photo inside is scaled the other way so it never stretches. */
.w8tea-frame { position: relative; overflow: hidden; aspect-ratio: 1 / 1; border-radius: 18px; background: #d9ccb4; }
.w8tea-base { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.w8tea-lens { position: absolute; left: -25%; top: -25%; width: 150%; height: 150%; border-radius: 50%; overflow: hidden; opacity: 0; transform: scale(.08); transition: transform var(--w8tea-time) cubic-bezier(.65,0,.25,1), opacity .25s ease; }
.w8tea-lens img { position: absolute; left: 16.667%; top: 16.667%; width: 66.667%; height: 66.667%; max-width: none; object-fit: cover; transform: scale(12.5); transition: transform var(--w8tea-time) cubic-bezier(.65,0,.25,1); }
.w8tea-tag { position: absolute; right: 12px; top: 12px; height: 28px; overflow: hidden; border-radius: 999px; background: rgba(250,246,238,.92); color: var(--w8tea-ink); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.w8tea-tag span { display: block; height: 28px; line-height: 28px; padding: 0 11px; transition: transform .5s cubic-bezier(.65,0,.25,1); }
.w8tea-card[data-on] .w8tea-lens { opacity: 1; transform: none; }
.w8tea-card[data-on] .w8tea-lens img { transform: none; }
.w8tea-card[data-on] .w8tea-tag span { transform: translateY(-100%); }
@media (hover: hover) and (pointer: fine) {
.w8tea-card:hover .w8tea-lens { opacity: 1; transform: none; }
.w8tea-card:hover .w8tea-lens img { transform: none; }
.w8tea-card:hover .w8tea-tag span { transform: translateY(-100%); }
}
.w8tea-btn:focus-visible, .w8tea-link:focus-visible { outline: 2px solid var(--w8tea-ink); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .w8tea-lens, .w8tea-lens img, .w8tea-tag span { transition: none; } }
.w8tea-body { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 16px; }
.w8tea-name { margin: 0; font: 400 20px/1.3 ui-serif, Georgia, serif; }
.w8tea-link { color: inherit; text-decoration: none; border-radius: 4px; }
.w8tea-note { margin: 4px 0 0; font-size: 14px; color: #5a5042; }
.w8tea-price { margin: 4px 0 0; font-size: 14px; font-weight: 500; }
.w8tea-btn { flex: none; height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--w8tea-ink); color: #f6efe2; font: 500 14px/1 ui-sans-serif, system-ui, sans-serif; cursor: pointer; }
.w8tea-btn:hover { background: #463e33; }
</style>
<script>
(function () {
/* Change this: ms between idle swaps before anyone points, taps or tabs. */
var DELAY = 2100;
var root = document.querySelector(".w8tea");
if (!root) return;
var cards = root.querySelectorAll(".w8tea-card"), live = true, vis = true, t = 0, step = 0;
var still = matchMedia("(prefers-reduced-motion: reduce)").matches;
function set(card, on) {
card.toggleAttribute("data-on", on);
var b = card.querySelector(".w8tea-btn");
b.setAttribute("aria-pressed", on); b.textContent = on ? "Show leaf" : "Show cup";
}
function run() {
clearInterval(t); t = 0;
if (live && vis && !still) t = setInterval(function () {
step = (step + 1) % (cards.length * 2);
cards.forEach(function (c, k) { set(c, step === k * 2); });
}, DELAY);
}
cards.forEach(function (c) {
c.querySelector(".w8tea-btn").addEventListener("click", function () { live = false; run(); set(c, !c.hasAttribute("data-on")); });
});
/* a real mouse or the keyboard takes over from the idle demo */
function stop() { if (!live) return; live = false; run(); cards.forEach(function (c) { set(c, false); }); }
root.addEventListener("pointerenter", function (e) { if (e.pointerType === "mouse") stop(); });
root.addEventListener("focusin", stop);
new IntersectionObserver(function (e) { vis = e[0].isIntersecting; run(); }).observe(root);
run();
})();
</script>
With reduced motion: The cup photo replaces the leaf at once when the button is pressed, with no growing circle.
Running cost: One scaled circle and one counter-scaled photo per card, so the reveal stays a pair of transforms.
- Set `--w8tea-time` to change how long the circle takes to open.
- The circle starts at `scale(.08)` and the photo inside at `scale(12.5)`; keep the two values reciprocal if you change one.
- Recolour the button and focus ring through `--w8tea-ink`.
Walking Routes With A Postcard Pair
A walking guide's weekend routes in big serif on pale stone. Resting on a route, or tabbing to it, fans out two cards from behind the row: a cream note with the route number and time, then a white-bordered postcard whose photo settles into its frame. Phones show the postcard as a small tilted thumbnail.
<section class="w8wlk">
<div class="w8wlk-wrap">
<p class="w8wlk-kicker">Fieldnote Walks</p>
<h2 class="w8wlk-title">Three routes for this weekend</h2>
<p class="w8wlk-lead">Each route opens a printable map with the turns, water stops and the bus home.</p>
<ul class="w8wlk-list">
<li><a href="#" class="w8wlk-row" data-on>
<img class="w8wlk-thumb" src="https://images.pexels.com/photos/5865768/pexels-photo-5865768.jpeg?auto=compress&cs=tinysrgb&w=500" alt="Dark wooden huts in a misty meadow below a pine forest" width="92" height="70" loading="lazy" decoding="async">
<span class="w8wlk-text"><span class="w8wlk-name">Fog meadow huts</span><span class="w8wlk-sub">9 km, 320 m climb</span></span>
<span class="w8wlk-fan" aria-hidden="true"><span class="w8wlk-card w8wlk-back"><b>Route 1</b><span>9 km · 3 hours</span></span><span class="w8wlk-card w8wlk-front"><span class="w8wlk-mask"><img src="https://images.pexels.com/photos/5865768/pexels-photo-5865768.jpeg?auto=compress&cs=tinysrgb&w=500" alt="" width="500" height="380" loading="lazy" decoding="async"></span></span></span>
<span class="w8wlk-time">3 hours</span>
</a></li>
<li><a href="#" class="w8wlk-row">
<img class="w8wlk-thumb" src="https://images.pexels.com/photos/5736585/pexels-photo-5736585.jpeg?auto=compress&cs=tinysrgb&w=500" alt="A white lighthouse on a wooded headland above rocks and surf" width="92" height="70" loading="lazy" decoding="async">
<span class="w8wlk-text"><span class="w8wlk-name">Headland lighthouse</span><span class="w8wlk-sub">12 km, 180 m climb</span></span>
<span class="w8wlk-fan" aria-hidden="true"><span class="w8wlk-card w8wlk-back"><b>Route 2</b><span>12 km · 4 hours</span></span><span class="w8wlk-card w8wlk-front"><span class="w8wlk-mask"><img src="https://images.pexels.com/photos/5736585/pexels-photo-5736585.jpeg?auto=compress&cs=tinysrgb&w=500" alt="" width="500" height="380" loading="lazy" decoding="async"></span></span></span>
<span class="w8wlk-time">4 hours</span>
</a></li>
<li><a href="#" class="w8wlk-row">
<img class="w8wlk-thumb" src="https://images.pexels.com/photos/18587007/pexels-photo-18587007.jpeg?auto=compress&cs=tinysrgb&w=500" alt="A narrow street curving between old houses with red tiled roofs" width="92" height="70" loading="lazy" decoding="async">
<span class="w8wlk-text"><span class="w8wlk-name">Old town lanes</span><span class="w8wlk-sub">5 km, 60 m climb</span></span>
<span class="w8wlk-fan" aria-hidden="true"><span class="w8wlk-card w8wlk-back"><b>Route 3</b><span>5 km · 2 hours</span></span><span class="w8wlk-card w8wlk-front"><span class="w8wlk-mask"><img src="https://images.pexels.com/photos/18587007/pexels-photo-18587007.jpeg?auto=compress&cs=tinysrgb&w=500" alt="" width="500" height="380" loading="lazy" decoding="async"></span></span></span>
<span class="w8wlk-time">2 hours</span>
</a></li>
</ul>
</div>
</section>
<style>
/* Change these: stone background, moss accent, postcard width, starting tilt of the pair. */
.w8wlk { --w8wlk-bg: #e9e7df; --w8wlk-moss: #4b5d2e; --w8wlk-card: 168px; --w8wlk-tilt: -12deg; }
.w8wlk { background: var(--w8wlk-bg); color: #23261f; padding: 72px 20px; font-family: ui-sans-serif, system-ui, sans-serif; }
.w8wlk-wrap { max-width: 56rem; margin: 0 auto; }
.w8wlk-kicker { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--w8wlk-moss); }
.w8wlk-title { margin: 12px 0 0; font: 400 clamp(30px, 4vw, 36px)/1.2 ui-serif, Georgia, serif; }
.w8wlk-lead { margin: 12px 0 0; max-width: 28rem; font-size: 16px; line-height: 1.5; color: #4f5446; }
.w8wlk-list { list-style: none; margin: 40px 0 0; padding: 0; border-bottom: 1px solid #c9c6b6; }
.w8wlk-text { margin-right: auto; }
.w8wlk-name { font: 400 clamp(24px, 3.6vw, 36px)/1.2 ui-serif, Georgia, serif; }
.w8wlk-sub { display: block; margin-top: 4px; font-size: 14px; color: #4f5446; }
.w8wlk-time { font-size: 14px; color: #4f5446; }
.w8wlk-back b { font-weight: 600; }
/* Two cards wait behind the row: a route note and a photo postcard. They fan out a beat apart. */
.w8wlk-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 30px 4px; border-top: 1px solid #c9c6b6; color: #23261f; text-decoration: none; outline: none; }
.w8wlk-row:focus-visible { outline: 2px solid var(--w8wlk-moss); outline-offset: 2px; border-radius: 6px; }
.w8wlk-name { display: inline-block; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.w8wlk-fan { position: absolute; z-index: 2; right: 170px; top: 50%; width: var(--w8wlk-card); height: 128px; margin-top: -64px; pointer-events: none; }
.w8wlk-card { position: absolute; inset: 0; border-radius: 4px; opacity: 0; transform: translate(-40px, 24px) rotate(var(--w8wlk-tilt)) scale(.9); transition: opacity .3s ease, transform .65s cubic-bezier(.2,.9,.3,1.1); }
.w8wlk-back { background: #f7f4ea; box-shadow: 0 10px 24px -14px rgba(30,30,20,.6); padding: 12px 14px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end; text-align: right; font-size: 12px; color: #3c4234; }
.w8wlk-front { background: #fff; padding: 6px; box-shadow: 0 16px 30px -14px rgba(30,30,20,.65); transition-delay: .06s; }
.w8wlk-mask { display: block; width: 100%; height: 100%; overflow: hidden; border-radius: 2px; }
.w8wlk-mask img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.3) translateX(-12%); transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.w8wlk-row[data-on] .w8wlk-back, .w8wlk-row:hover .w8wlk-back, .w8wlk-row:focus-visible .w8wlk-back { opacity: 1; transform: translate(96px, -8px) rotate(8deg); }
.w8wlk-row[data-on] .w8wlk-front, .w8wlk-row:hover .w8wlk-front, .w8wlk-row:focus-visible .w8wlk-front { opacity: 1; transform: translateX(-24px) rotate(-5deg); }
.w8wlk-row[data-on] .w8wlk-mask img, .w8wlk-row:hover .w8wlk-mask img, .w8wlk-row:focus-visible .w8wlk-mask img { transform: none; }
.w8wlk-row[data-on] .w8wlk-name, .w8wlk-row:hover .w8wlk-name, .w8wlk-row:focus-visible .w8wlk-name { transform: translateX(10px); }
.w8wlk-thumb { display: none; }
@media (max-width: 767px), (prefers-reduced-motion: reduce) {
.w8wlk-fan { display: none; }
.w8wlk-name { transform: none !important; transition: none; }
.w8wlk-row { justify-content: flex-start; padding: 16px 0; }
.w8wlk-thumb { display: block; flex: none; width: 92px; height: 70px; object-fit: cover; border: 4px solid #fff; border-radius: 3px; transform: rotate(-3deg); box-shadow: 0 6px 14px -8px rgba(30,30,20,.6); }
}
@media (max-width: 767px) { .w8wlk-time { display: none; } }
</style>
<script>
(function () {
/* Change this: ms between idle reveals before anyone points or tabs. */
var DELAY = 2000;
var root = document.querySelector(".w8wlk");
if (!root || matchMedia("(prefers-reduced-motion: reduce)").matches) return;
var rows = root.querySelectorAll(".w8wlk-row"), i = 0, t = 0, vis = true, live = true;
function set(n) { for (var k = 0; k < rows.length; k++) rows[k].toggleAttribute("data-on", k === n); }
function run() {
clearInterval(t); t = 0;
if (live && vis) t = setInterval(function () { i = (i + 1) % rows.length; set(i); }, DELAY);
}
/* a real mouse or keyboard takes over from the idle demo */
function stop() { live = false; set(-1); run(); }
root.addEventListener("pointerenter", function (e) { if (e.pointerType === "mouse") stop(); });
root.addEventListener("focusin", stop);
new IntersectionObserver(function (e) { vis = e[0].isIntersecting; run(); }).observe(root);
run();
})();
</script>
With reduced motion: Each route shows a small tilted postcard photo beside its name and no cards fan out.
Running cost: Two cards and one photo per row change transform and opacity only; the idle timer stops off screen.
- Set `--w8wlk-card` to size both cards together.
- Change `--w8wlk-tilt` for a steeper or flatter starting angle before the pair fans out.
- Edit the `walks` array to change names, distances and photos in one place.
Performance notes
Every reveal moves a photo that is already laid out, through an overflow-hidden mask, with translate and scale, so the browser recomposites a layer instead of repainting. Clip paths, filters and sizes stay fixed throughout.
Photos for the reveals are sized to the frame they open into and loaded lazily, and they are decoded before the first hover so the image never appears half drawn. Lists with many rows share one floating frame instead of keeping a picture per row on top of the page.
Questions
How do I reveal an image on hover with CSS?
Put the image inside a wrapper with overflow: hidden, shift the image out of view with translate, and transition it back to zero when the parent matches :hover or :focus-within. The wrapper acts as the mask.
Why animate transform instead of clip-path?
Transform and opacity are the two properties browsers can reliably animate on the compositor without repainting. A translate through an overflow mask gives the same edge as a clip-path wipe while staying on that cheap path in every browser.
How do image hover effects work on touch screens?
There is no hover, so the first tap would either do nothing or follow the link. The pieces here show the photo in the layout on small screens, or open it on the first tap and follow the link on the second where that is clearer.
Do hover images need alt text?
If the picture adds information, yes. If it only repeats what the link text already says, give it empty alt text so screen readers do not read the same thing twice.
More collections: CSS Hover Effects and Magnetic Buttons, Expanding Cards and Image Panels, Custom Cursor Effects in CSS and JavaScript. All galleries and carousels. Build your site free to have a full site built around them.
Product
Who It's For
- For Agencies
- For Freelancers
- For Hosting Providers
- For SaaS Platforms
- For Startups
- For Financial Services
- For Healthcare
Features
Resources
- Blog
- Help Center
- Free Business Tools
- Free UI Components
- Website Templates
- Template Collections
- Website Examples
- Guides
- Comparisons
- Alternatives
- Best Lists
- Reviews
- Pricing Guides
- Use Cases
- Glossary & Guides
- Integrations
- Developers
- Benchmark
- Windows App