Hanging rail
Six equal tiles in one row on white, a framed print alternating with a close crop of it; pointing at a tile swaps the caption pinned at the bottom.
Part of the style
Night Water Footnote
7 parts that belong together, with their tokens, type and rules.
https://kitbash.me/components/night-water-footnote/rail/figma.html?type=soft-pill-console
Use the Figma MCP server (https://mcp.figma.com/mcp). Download https://kitbash.me/components/night-water-footnote/rail/figma.html?type=soft-pill-console and pass that whole HTML document to the html_to_figma tool, so the part "Hanging rail" lands as editable layers in my open Figma file. Fonts come from Google Fonts: if a face is missing in Figma, pick the closest one.
Code
<style>
/* Goes after the pack's base.css */
@import url("https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400;14..32,500;14..32,600&display=swap");
:root {
--font-serif: "Inter", system-ui, sans-serif;
--font-grotesk: "Inter", system-ui, sans-serif;
}
</style>
<section class="rail" aria-label="Selected work">
<ul class="rail__row">
<li class="rail__item">
<a class="rail__tile rail__tile--framed" href="#" data-work="0" aria-label="Slack Water, installed">
<span class="rail__frame"><img class="rail__img" src="assets/breaking-wave.jpg" alt="Albumen print of waves breaking on dark rocks under a heavy sky" width="650" height="800" loading="lazy"></span>
</a>
</li>
<li class="rail__item">
<a class="rail__tile rail__tile--crop" href="#" data-work="0" aria-label="Slack Water, detail">
<img class="rail__img" src="assets/breaking-wave.jpg" alt="Close crop of white surf on the same print" width="650" height="800" loading="lazy" style="--crop-x: 70%; --crop-y: 72%;">
</a>
</li>
<li class="rail__item">
<a class="rail__tile rail__tile--framed" href="#" data-work="1" aria-label="Sky Held Still, installed">
<span class="rail__frame"><img class="rail__img" src="assets/cloud-music.jpg" alt="Silver print of tall clouds over a dark hill" width="649" height="800" loading="lazy"></span>
</a>
</li>
<li class="rail__item">
<a class="rail__tile rail__tile--crop" href="#" data-work="1" aria-label="Sky Held Still, detail">
<img class="rail__img" src="assets/cloud-music.jpg" alt="Close crop of cloud edges on the same print" width="649" height="800" loading="lazy" style="--crop-x: 35%; --crop-y: 30%;">
</a>
</li>
<li class="rail__item">
<a class="rail__tile rail__tile--framed" href="#" data-work="2" aria-label="Two Boats, Leaving, installed">
<span class="rail__frame"><img class="rail__img" src="assets/brig.jpg" alt="Sepia print of a wide grey sea with a small sailing boat" width="800" height="634" loading="lazy"></span>
</a>
</li>
<li class="rail__item">
<a class="rail__tile rail__tile--crop" href="#" data-work="2" aria-label="Two Boats, Leaving, detail">
<img class="rail__img" src="assets/brig.jpg" alt="Close crop of the sail and the light on the water" width="800" height="634" loading="lazy" style="--crop-x: 58%; --crop-y: 66%;">
</a>
</li>
</ul>
<div class="rail__captions" aria-live="polite">
<div class="rail__caption is-current" data-work="0">
<p class="rail__title"><em>Slack Water</em>, 2026</p>
<p class="rail__detail">Silver gelatin print on baryta paper, white oak frame<br>16 x 20 x 1.5 in</p>
</div>
<div class="rail__caption" data-work="1">
<p class="rail__title"><em>Sky Held Still</em>, 2024</p>
<p class="rail__detail">Platinum print, hand-coated, pale ash frame<br>11 x 14 x 1.25 in</p>
</div>
<div class="rail__caption" data-work="2">
<p class="rail__title"><em>Two Boats, Leaving</em>, 2024–2026</p>
<p class="rail__detail">Pigment print mounted on aluminium, float frame<br>Various dimensions</p>
</div>
</div>
</section>
<style>
.rail {
display: grid;
grid-template-rows: 1fr auto 1fr auto;
min-height: clamp(560px, 50vw, 720px);
padding: var(--space-l) var(--edge) var(--edge);
background: var(--day);
color: var(--ink);
}
.rail__row {
grid-row: 2;
display: grid;
grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
gap: var(--gap);
margin: 0;
padding: 0;
list-style: none;
}
.rail__tile {
position: relative;
display: grid;
place-items: center;
aspect-ratio: 4 / 5;
overflow: hidden;
background: var(--wall);
}
.rail__tile:focus-visible {
outline: var(--line) solid var(--ink);
outline-offset: 4px;
}
.rail__frame {
display: block;
width: 62%;
padding: 9%;
background: var(--mat);
border: 4px solid var(--day);
box-shadow: var(--shadow-print);
transition: transform var(--fade) var(--ease);
}
.rail__frame .rail__img {
width: 100%;
height: auto;
object-fit: contain;
}
.rail__tile--crop .rail__img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: var(--crop-x, 50%) var(--crop-y, 50%);
transform: scale(1.9);
transform-origin: var(--crop-x, 50%) var(--crop-y, 50%);
transition: transform var(--slow) var(--ease);
}
.rail__tile--crop:hover .rail__img,
.rail__tile--crop:focus-visible .rail__img {
transform: scale(2.1);
}
.rail__tile--framed:hover .rail__frame,
.rail__tile--framed:focus-visible .rail__frame {
transform: translateY(-3px);
}
.rail__row.is-pointing .rail__tile:not(.is-current) {
opacity: 0.55;
}
.rail__tile {
transition: opacity var(--fade) var(--ease);
}
.rail__captions {
grid-row: 4;
display: grid;
}
.rail__caption {
grid-area: 1 / 1;
display: grid;
grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
gap: var(--gap);
opacity: 0;
transition: opacity var(--fade) var(--ease);
}
.rail__caption.is-current {
opacity: 1;
}
.rail__title,
.rail__detail {
margin: 0;
font-size: var(--text-m);
line-height: var(--leading);
}
.rail__detail {
grid-column: 2 / span 3;
}
@media (max-width: 48rem) {
.rail__row {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.rail {
grid-template-rows: auto auto;
gap: var(--space-l);
padding-top: var(--space-l);
}
.rail__row { grid-row: 1; }
.rail__captions { grid-row: 2; }
.rail__caption {
grid-template-columns: minmax(0, 1fr);
gap: var(--space-xs);
}
.rail__detail {
grid-column: 1;
color: var(--ink-soft);
}
}
</style>
<script>
(() => {
document.querySelectorAll('.rail').forEach((root) => {
const row = root.querySelector('.rail__row');
const tiles = [...root.querySelectorAll('.rail__tile')];
const captions = [...root.querySelectorAll('.rail__caption')];
let resting = '0';
const show = (work, pointing) => {
captions.forEach((c) => c.classList.toggle('is-current', c.dataset.work === work));
tiles.forEach((t) => t.classList.toggle('is-current', pointing && t.dataset.work === work));
row.classList.toggle('is-pointing', pointing);
};
tiles.forEach((tile) => {
tile.addEventListener('pointerenter', () => show(tile.dataset.work, true));
tile.addEventListener('focus', () => show(tile.dataset.work, true));
tile.addEventListener('click', (event) => {
event.preventDefault();
resting = tile.dataset.work;
show(resting, true);
});
});
row.addEventListener('pointerleave', () => show(resting, false));
row.addEventListener('focusout', (event) => {
if (!row.contains(event.relatedTarget)) show(resting, false);
});
});
})();
</script>