Full-Screen Menus and Menu Reveals
Updated 2026-10-16. 8 effects.
A full-screen menu opens a navigation overlay that covers the page, usually with large staggered links. It needs a real button with aria-expanded, a focus trap so Tab stays inside, Escape to close, focus returned to the button afterwards, and the page behind made inert. Each overlay below does all of that and animates only transform and opacity.
A full-screen menu suits sites with few top-level pages and a strong visual voice: studios, restaurants, hotels, portfolios. With large type and space around each link it becomes part of the brand. Sites with deep navigation do better with a drawer or a mega menu that keeps more links visible at once.
The reveal is where these differ: a curtain that drops, panels that slide in from the side, a circle that grows from the menu button, links that rise one by one. Pick one and keep it under half a second to open, faster to close. For the menu button icon on its own, see the hamburger icon set linked below.
Compare them
| Effect | Built with | Size (gzipped) | Running cost | Browser support |
|---|---|---|---|---|
| Clay Blind Slats That Unroll Into a Menu | CSS and a small script | 2.9 KB | Six thin layers scale in once each; no script runs during the motion. | All current browsers |
| Forest Panels That Slide In Layer by Layer | CSS and a small script | 3.1 KB | Three transformed layers and a text stagger, all CSS transitions that run only while the menu opens or closes. | All current browsers |
| Graphite Split Halves That Close Over the Page | CSS and a small script | 2.9 KB | Two transformed halves and a short text stagger, finished in well under a second and idle afterwards. | All current browsers |
| Ink Overlay With Numbered Rows That Draw Their Rules | CSS and a small script | 3 KB | Pure CSS transitions on rules and text spans; nothing runs once the rows have settled. | All current browsers |
| Navy Circle That Grows From the Menu Button | CSS and a small script | 2.9 KB | One large pre-drawn circle is scaled on the compositor, so opening costs a single layer animation and no repaint per frame. | All current browsers |
| Paper Menu With a Photo Preview That Follows Focus | CSS and a small script | 3.5 KB | Opacity and transform on four stacked images; the idle timer does nothing while the piece is off screen or in use. | All current browsers |
| Slate Page That Shrinks Aside to Uncover the Menu | CSS and a small script | 2.9 KB | One transform on the page layer plus a pre-drawn shadow whose opacity fades, so the shadow is never repainted. | All current browsers |
| Terracotta Curtain Menu That Drops With Rising Links | CSS and a small script | 3.1 KB | Two CSS transitions on layers that already exist; the script only flips a class and runs nothing per frame. | All current browsers |
Clay Blind Slats That Unroll Into a Menu
Six clay-coloured slats unroll from the top of a ceramics studio page one under the other, like a slatted blind being let down, and once the last one lands the page names fade up over the stripes. Alternate slats are a shade darker so the blind keeps a faint texture behind the type.
<div class="w7bld">
<header class="w7bld-bar">
<p class="w7bld-brand">Studio Marl</p>
<button class="w7bld-btn" type="button" aria-expanded="false" aria-controls="w7bld-menu">
<span class="w7bld-word">Menu</span><span class="w7bld-icon" aria-hidden="true"><i></i><i></i></span>
</button>
</header>
<div class="w7bld-page">
<div class="w7bld-pots" aria-hidden="true"><i></i><i></i><i></i></div>
<div class="w7bld-copy">
<p class="w7bld-eye">Stoneware made in small firings</p>
<h2 class="w7bld-title">Cups, bowls and jugs for every day.</h2>
<a class="w7bld-cta" href="#">Shop the latest firing</a>
</div>
</div>
<div class="w7bld-menu" id="w7bld-menu" inert>
<div class="w7bld-slats" aria-hidden="true"><i style="--i:0"></i><i style="--i:1"></i><i style="--i:2"></i><i style="--i:3"></i><i style="--i:4"></i><i style="--i:5"></i></div>
<div class="w7bld-in">
<nav class="w7bld-nav" aria-label="Main">
<ul>
<li style="--i:0"><a href="#" aria-current="page"><span>Shop</span></a></li>
<li style="--i:1"><a href="#"><span>Classes</span></a></li>
<li style="--i:2"><a href="#"><span>Commissions</span></a></li>
<li style="--i:3"><a href="#"><span>About the studio</span></a></li>
<li style="--i:4"><a href="#"><span>Visit</span></a></li>
</ul>
</nav>
<p class="w7bld-note">Next open studio: first Saturday of the month.</p>
</div>
</div>
</div>
<style>
/* Change these: sand page colour, clay slat colour, text on the slats, accent, delay between slats. */
.w7bld { --w7bld-bg: #ece2d2; --w7bld-ink: #2e221a; --w7bld-clay: #6b4632; --w7bld-cream: #f6eee3; --w7bld-acc: #e7b48d; --w7bld-step: .05s; --w7bld-out: .55s; }
.w7bld { position: relative; height: 600px; overflow: hidden; background: var(--w7bld-bg); color: var(--w7bld-ink); font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.w7bld *, .w7bld *::before, .w7bld *::after { box-sizing: border-box; }
.w7bld-bar { position: absolute; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px clamp(16px, 4vw, 48px); pointer-events: none; }
.w7bld-bar > * { pointer-events: auto; }
.w7bld-brand { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.w7bld-btn { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 18px; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.w7bld-icon { position: relative; width: 18px; height: 10px; }
.w7bld-icon i { position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform .35s ease; }
.w7bld-icon i:first-child { top: 0; } .w7bld-icon i:last-child { bottom: 0; }
.w7bld-open .w7bld-icon i:first-child { transform: translateY(4px) rotate(45deg); }
.w7bld-open .w7bld-icon i:last-child { transform: translateY(-4px) rotate(-45deg); }
.w7bld a:focus-visible, .w7bld-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.w7bld-menu { visibility: hidden; transition: visibility 0s var(--w7bld-out, .5s); }
.w7bld-open .w7bld-menu { visibility: visible; transition: visibility 0s; }
.w7bld-nav ul { margin: 0; padding: 0; list-style: none; }
.w7bld-nav a { color: inherit; text-decoration: none; }
.w7bld-page { display: grid; align-items: center; gap: 24px; height: 100%; padding: 84px clamp(16px, 4vw, 48px) 32px; }
@media (min-width: 760px) { .w7bld-page { grid-template-columns: 1fr 1.1fr; } .w7bld-copy { order: 2; } }
.w7bld-eye { margin: 0; font-size: 13px; font-weight: 600; color: #7a4f36; }
.w7bld-title { margin: 12px 0 0; max-width: 14ch; font-size: clamp(30px, 4.8vw, 54px); font-weight: 600; line-height: 1.05; letter-spacing: -.03em; }
.w7bld-cta { display: inline-flex; align-items: center; min-height: 44px; margin-top: 22px; padding: 0 22px; border-radius: 999px; background: var(--w7bld-clay); color: var(--w7bld-cream); font-size: 15px; font-weight: 600; text-decoration: none; }
.w7bld-pots { display: flex; align-items: flex-end; justify-content: center; gap: 18px; height: 300px; }
.w7bld-pots i { display: block; background: radial-gradient(circle at 35% 30%, #e3d3bd, #b99c7c 60%, #8f7258); box-shadow: 0 26px 30px -22px rgba(60, 35, 20, .7); }
.w7bld-pots i:nth-child(1) { width: 110px; height: 150px; border-radius: 40% 40% 30% 30% / 30% 30% 20% 20%; }
.w7bld-pots i:nth-child(2) { width: 150px; height: 230px; border-radius: 30% 30% 40% 40% / 20% 20% 30% 30%; background: radial-gradient(circle at 35% 30%, #6e5547, #4a372c 60%, #33251d); }
.w7bld-pots i:nth-child(3) { width: 130px; height: 80px; border-radius: 10% 10% 50% 50% / 10% 10% 60% 60%; }
@media (max-width: 759px) { .w7bld-pots { height: 150px; transform: scale(.55); margin: -40px 0; } }
.w7bld-open .w7bld-bar { color: var(--w7bld-cream); }
.w7bld-menu { position: absolute; z-index: 20; inset: 0; color: var(--w7bld-cream); }
/* Six slats, each a sixth of the height, unroll downward one after another with scaleY. */
.w7bld-slats { position: absolute; inset: 0; display: grid; grid-template-rows: repeat(6, 1fr); }
.w7bld-slats i { display: block; margin-bottom: -1px; background: var(--w7bld-clay); transform: scaleY(0); transform-origin: top; transition: transform .3s cubic-bezier(.6, 0, .4, 1) calc((5 - var(--i)) * .03s); }
.w7bld-slats i:nth-child(even) { background: #634130; }
.w7bld-open .w7bld-slats i { transform: none; transition: transform .45s cubic-bezier(.6, 0, .2, 1) calc(var(--i) * var(--w7bld-step)); }
.w7bld-in { position: relative; display: flex; flex-direction: column; justify-content: center; height: 100%; padding: 84px clamp(16px, 4vw, 48px) 32px; }
.w7bld-nav a { display: inline-flex; align-items: center; min-height: 48px; font-size: clamp(28px, 4.8vw, 54px); font-weight: 600; letter-spacing: -.03em; }
.w7bld-nav li { opacity: 0; transition: opacity .15s; }
.w7bld-open .w7bld-nav li { opacity: 1; transition: opacity .3s calc(.35s + var(--i) * .04s); }
.w7bld-nav a span { display: inline-block; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.w7bld-nav a[aria-current="page"] { color: var(--w7bld-acc); }
@media (hover: hover) { .w7bld-nav a:hover span { transform: translateX(12px); } }
.w7bld-nav a:focus-visible span { transform: translateX(12px); }
.w7bld-note { margin: 22px 0 0; font-size: 14px; color: #e6d6c4; opacity: 0; transition: opacity .15s; }
.w7bld-open .w7bld-note { opacity: 1; transition: opacity .3s .5s; }
@media (prefers-reduced-motion: reduce) { .w7bld-slats i, .w7bld-nav li, .w7bld-nav a span, .w7bld-note, .w7bld-icon i { transition: none !important; } }
</style>
<script>
(function () {
/* Change this: when the demo opens the menu by itself (ms). Set 0 on a real site. */
var AUTO_OPEN = 500;
var root = document.querySelector(".w7bld");
if (!root) return;
var btn = root.querySelector(".w7bld-btn"), word = root.querySelector(".w7bld-word"),
menu = root.querySelector(".w7bld-menu"), page = root.querySelector(".w7bld-page"), used = false;
function isOpen() { return root.classList.contains("w7bld-open"); }
function set(open, moveFocus) {
root.classList.toggle("w7bld-open", open);
btn.setAttribute("aria-expanded", open);
word.textContent = open ? "Close" : "Menu";
menu.inert = !open;
page.inert = open; /* on a real page, make main and footer inert instead */
if (moveFocus) (open ? menu.querySelector("a") : btn).focus();
}
function touch() { used = true; }
btn.addEventListener("click", function () { touch(); set(!isOpen(), true); });
root.addEventListener("pointerdown", touch);
root.addEventListener("focusin", touch);
root.addEventListener("keydown", function (e) {
if (!isOpen()) return;
if (e.key === "Escape") { e.preventDefault(); set(false, true); return; }
if (e.key !== "Tab") return;
/* focus trap: the button plus everything in the menu */
var f = [btn].concat([].slice.call(menu.querySelectorAll("a[href], button"))), i = f.indexOf(document.activeElement);
if (e.shiftKey && i <= 0) { e.preventDefault(); f[f.length - 1].focus(); }
else if (!e.shiftKey && i === f.length - 1) { e.preventDefault(); f[0].focus(); }
});
menu.addEventListener("click", function (e) {
var a = e.target.closest("a");
if (!a) return;
e.preventDefault(); /* remove on a real site so the link navigates */
if (a.closest("nav")) { menu.querySelectorAll("[aria-current]").forEach(function (x) { x.removeAttribute("aria-current"); }); a.setAttribute("aria-current", "page"); }
set(false, true);
});
if (AUTO_OPEN) setTimeout(function () { if (!used) set(true, false); }, AUTO_OPEN);
})();
</script>
With reduced motion: The blind is already down and every link visible the moment the menu opens.
Running cost: Six thin layers scale in once each; no script runs during the motion.
- Change `--w7bld-clay` and the darker even slat colour in `.w7bld-slats i:nth-child(even)`.
- Raise `--w7bld-step` for a slower, more visible cascade of slats.
- Change the slat count by editing the number of `<i>` elements and `repeat(6, 1fr)` together.
Forest Panels That Slide In Layer by Layer
Three sheets of green, light to dark, sweep in from the right edge of a plant nursery page one just behind the other, so the menu arrives as a layered wipe. The deepest green carries the links, which slide sideways into place, and a column of collection days and directions sits beside them on wider screens.
<div class="w7pnl">
<header class="w7pnl-bar">
<p class="w7pnl-brand">Fernhill Nursery</p>
<button class="w7pnl-btn" type="button" aria-expanded="false" aria-controls="w7pnl-menu">
<span class="w7pnl-word">Menu</span><span class="w7pnl-icon" aria-hidden="true"><i></i><i></i></span>
</button>
</header>
<div class="w7pnl-page">
<div class="w7pnl-copy">
<p class="w7pnl-eye">Plant nursery and glasshouse</p>
<h2 class="w7pnl-title">Seedlings, shrubs and slow-grown hedging.</h2>
<p class="w7pnl-text">Grown outdoors on the hill so they arrive used to wind and frost. Open for collection on Fridays and Saturdays.</p>
<a class="w7pnl-cta" href="#">See what is ready now</a>
</div>
<div class="w7pnl-pic"><img src="https://images.pexels.com/photos/6508425/pexels-photo-6508425.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="Rows of potted plants on long benches inside a glasshouse with hanging baskets above" width="1200" height="800" loading="lazy"></div>
</div>
<div class="w7pnl-menu" id="w7pnl-menu" inert>
<span class="w7pnl-sl w7pnl-s1" aria-hidden="true"></span><span class="w7pnl-sl w7pnl-s2" aria-hidden="true"></span><span class="w7pnl-sl w7pnl-s3" aria-hidden="true"></span>
<div class="w7pnl-in">
<nav class="w7pnl-nav" aria-label="Main">
<ul>
<li style="--i:0"><a href="#" aria-current="page"><span>Home</span></a></li>
<li style="--i:1"><a href="#"><span>Plants in stock</span></a></li>
<li style="--i:2"><a href="#"><span>Hedging by the metre</span></a></li>
<li style="--i:3"><a href="#"><span>Growing notes</span></a></li>
<li style="--i:4"><a href="#"><span>Visit the nursery</span></a></li>
</ul>
</nav>
<div class="w7pnl-side">
<p class="w7pnl-k">Collection days</p>
<p>Friday and Saturday, 9 until 4</p>
<p class="w7pnl-k">Find us</p>
<p>Top Lane, Fernhill</p>
<a href="#">Order by email</a>
</div>
</div>
</div>
</div>
<style>
/* Change these: page colour, the three panel greens, text colour, stagger between panels. */
.w7pnl { --w7pnl-bg: #eef1ea; --w7pnl-ink: #1d2a20; --w7pnl-g1: #8fa98a; --w7pnl-g2: #4f6f52; --w7pnl-g3: #1f3a28; --w7pnl-cream: #f1f4ec; --w7pnl-step: .09s; --w7pnl-out: .7s; }
.w7pnl { position: relative; height: 600px; overflow: hidden; background: var(--w7pnl-bg); color: var(--w7pnl-ink); font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.w7pnl *, .w7pnl *::before, .w7pnl *::after { box-sizing: border-box; }
.w7pnl-bar { position: absolute; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px clamp(16px, 4vw, 48px); pointer-events: none; }
.w7pnl-bar > * { pointer-events: auto; }
.w7pnl-brand { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.w7pnl-btn { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 18px; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.w7pnl-icon { position: relative; width: 18px; height: 10px; }
.w7pnl-icon i { position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform .35s ease; }
.w7pnl-icon i:first-child { top: 0; } .w7pnl-icon i:last-child { bottom: 0; }
.w7pnl-open .w7pnl-icon i:first-child { transform: translateY(4px) rotate(45deg); }
.w7pnl-open .w7pnl-icon i:last-child { transform: translateY(-4px) rotate(-45deg); }
.w7pnl a:focus-visible, .w7pnl-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.w7pnl-menu { visibility: hidden; transition: visibility 0s var(--w7pnl-out, .5s); }
.w7pnl-open .w7pnl-menu { visibility: visible; transition: visibility 0s; }
.w7pnl-nav ul { margin: 0; padding: 0; list-style: none; }
.w7pnl-nav a { color: inherit; text-decoration: none; }
.w7pnl-page { display: grid; height: 100%; }
.w7pnl-copy { align-self: center; padding: 84px clamp(16px, 4vw, 48px) 24px; }
.w7pnl-eye { margin: 0; font-size: 13px; font-weight: 600; color: #3d5a41; }
.w7pnl-title { margin: 12px 0 0; max-width: 15ch; font-size: clamp(30px, 4.6vw, 52px); font-weight: 600; line-height: 1.06; letter-spacing: -.025em; }
.w7pnl-text { margin: 16px 0 0; max-width: 36ch; font-size: 16px; line-height: 1.6; color: #44544a; }
.w7pnl-cta { display: inline-flex; align-items: center; min-height: 44px; margin-top: 22px; padding: 0 20px; border-radius: 8px; background: var(--w7pnl-g3); color: var(--w7pnl-cream); font-size: 15px; font-weight: 600; text-decoration: none; }
.w7pnl-pic { display: none; overflow: hidden; }
.w7pnl-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 760px) { .w7pnl-page { grid-template-columns: 1fr 1fr; } .w7pnl-pic { display: block; } }
.w7pnl-open .w7pnl-bar { color: var(--w7pnl-cream); }
.w7pnl-menu { position: absolute; z-index: 20; inset: 0; color: var(--w7pnl-cream); }
/* Three full-size panels: each slides in from the right a moment after the last. */
.w7pnl-sl { position: absolute; inset: 0; transform: translateX(101%); transition: transform .45s cubic-bezier(.7, 0, .3, 1) calc((2 - var(--n)) * var(--w7pnl-step)); }
.w7pnl-s1 { --n: 0; background: var(--w7pnl-g1); } .w7pnl-s2 { --n: 1; background: var(--w7pnl-g2); } .w7pnl-s3 { --n: 2; background: var(--w7pnl-g3); }
.w7pnl-open .w7pnl-sl { transform: none; transition: transform .6s cubic-bezier(.7, 0, .2, 1) calc(var(--n) * var(--w7pnl-step)); }
.w7pnl-in { position: relative; display: grid; gap: 24px; align-content: center; height: 100%; padding: 84px clamp(16px, 4vw, 48px) 24px; }
@media (min-width: 760px) { .w7pnl-in { grid-template-columns: 1.6fr 1fr; align-items: end; padding-bottom: 56px; } }
.w7pnl-nav li { border-top: 1px solid rgba(241, 244, 236, .2); }
.w7pnl-nav a { display: flex; align-items: center; min-height: 52px; overflow: hidden; font-size: clamp(24px, 3.6vw, 40px); font-weight: 600; letter-spacing: -.02em; }
.w7pnl-nav a span { display: inline-block; transform: translateX(-24px); opacity: 0; transition: transform .2s, opacity .2s; }
.w7pnl-open .w7pnl-nav a span { transform: none; opacity: 1; transition: transform .55s cubic-bezier(.2, .8, .2, 1), opacity .4s; transition-duration: .4s; transition-delay: calc(.3s + var(--i) * .04s); }
.w7pnl-nav a[aria-current="page"] { color: #b9d3a8; }
@media (hover: hover) { .w7pnl-nav a:hover span { transform: translateX(10px); } }
.w7pnl-side { font-size: 14px; line-height: 1.5; opacity: 0; transition: opacity .2s; }
.w7pnl-open .w7pnl-side { opacity: 1; transition: opacity .3s .5s; }
.w7pnl-side p { margin: 0 0 4px; } .w7pnl-k { margin-top: 12px !important; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #b9d3a8; }
.w7pnl-side a { display: inline-flex; align-items: center; min-height: 40px; margin-top: 8px; color: inherit; }
@media (max-width: 759px) { .w7pnl-side { display: none; } }
@media (prefers-reduced-motion: reduce) { .w7pnl-sl, .w7pnl-nav a span, .w7pnl-side, .w7pnl-icon i { transition: none !important; } }
</style>
<script>
(function () {
/* Change this: when the demo opens the menu by itself (ms). Set 0 on a real site. */
var AUTO_OPEN = 500;
var root = document.querySelector(".w7pnl");
if (!root) return;
var btn = root.querySelector(".w7pnl-btn"), word = root.querySelector(".w7pnl-word"),
menu = root.querySelector(".w7pnl-menu"), page = root.querySelector(".w7pnl-page"), used = false;
function isOpen() { return root.classList.contains("w7pnl-open"); }
function set(open, moveFocus) {
root.classList.toggle("w7pnl-open", open);
btn.setAttribute("aria-expanded", open);
word.textContent = open ? "Close" : "Menu";
menu.inert = !open;
page.inert = open; /* on a real page, make main and footer inert instead */
if (moveFocus) (open ? menu.querySelector("a") : btn).focus();
}
function touch() { used = true; }
btn.addEventListener("click", function () { touch(); set(!isOpen(), true); });
root.addEventListener("pointerdown", touch);
root.addEventListener("focusin", touch);
root.addEventListener("keydown", function (e) {
if (!isOpen()) return;
if (e.key === "Escape") { e.preventDefault(); set(false, true); return; }
if (e.key !== "Tab") return;
/* focus trap: the button plus everything in the menu */
var f = [btn].concat([].slice.call(menu.querySelectorAll("a[href], button"))), i = f.indexOf(document.activeElement);
if (e.shiftKey && i <= 0) { e.preventDefault(); f[f.length - 1].focus(); }
else if (!e.shiftKey && i === f.length - 1) { e.preventDefault(); f[0].focus(); }
});
menu.addEventListener("click", function (e) {
var a = e.target.closest("a");
if (!a) return;
e.preventDefault(); /* remove on a real site so the link navigates */
if (a.closest("nav")) { menu.querySelectorAll("[aria-current]").forEach(function (x) { x.removeAttribute("aria-current"); }); a.setAttribute("aria-current", "page"); }
set(false, true);
});
if (AUTO_OPEN) setTimeout(function () { if (!used) set(true, false); }, AUTO_OPEN);
})();
</script>
With reduced motion: The dark panel appears at once with its links in place, with no sliding.
Running cost: Three transformed layers and a text stagger, all CSS transitions that run only while the menu opens or closes.
- Swap the three greens in `--w7pnl-g1`, `--w7pnl-g2` and `--w7pnl-g3`; the last one is the menu background.
- Make the layers trail further apart by raising `--w7pnl-step`.
- Edit the link labels in the nav list; each `--i` value sets its place in the stagger.
Graphite Split Halves That Close Over the Page
Two graphite halves close over an architecture practice page like a pair of sliding doors, one dropping from the top and one rising from the bottom, until they meet at a seam across the middle. Large page names rise inside the upper half and the studio address appears under the seam once the doors are shut.
<div class="w7spl">
<header class="w7spl-bar">
<p class="w7spl-brand">Okafor Lane Architects</p>
<button class="w7spl-btn" type="button" aria-expanded="false" aria-controls="w7spl-menu">
<span class="w7spl-word">Menu</span><span class="w7spl-icon" aria-hidden="true"><i></i><i></i></span>
</button>
</header>
<div class="w7spl-page">
<p class="w7spl-eye">Architecture and interiors</p>
<h2 class="w7spl-title">Buildings that keep their shape for a long time.</h2>
<div class="w7spl-grid" aria-hidden="true"><i></i><i></i><i></i><i></i></div>
<p class="w7spl-text">A practice of nine working on homes, small schools and workshop conversions, mostly within a day's drive of the studio.</p>
</div>
<div class="w7spl-menu" id="w7spl-menu" inert>
<div class="w7spl-half w7spl-top">
<nav class="w7spl-nav" aria-label="Main">
<ul>
<li style="--i:0"><a href="#" aria-current="page"><span>Projects</span></a></li>
<li style="--i:1"><a href="#"><span>Practice</span></a></li>
<li style="--i:2"><a href="#"><span>Journal</span></a></li>
<li style="--i:3"><a href="#"><span>Contact</span></a></li>
</ul>
</nav>
</div>
<div class="w7spl-half w7spl-bot">
<div class="w7spl-info">
<p><span class="w7spl-k">Studio</span>4 Tanner Yard, second floor</p>
<p><span class="w7spl-k">New work</span><a href="#">Send us a brief</a></p>
</div>
</div>
</div>
</div>
<style>
/* Change these: page colour, upper half, lower half, text colour, accent, slide time. */
.w7spl { --w7spl-bg: #e9e7e3; --w7spl-ink: #1f2023; --w7spl-up: #26272b; --w7spl-low: #34363b; --w7spl-pale: #ecebe8; --w7spl-acc: #d4c3a3; --w7spl-speed: .6s; --w7spl-out: .5s; }
.w7spl { position: relative; height: 600px; overflow: hidden; background: var(--w7spl-bg); color: var(--w7spl-ink); font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.w7spl *, .w7spl *::before, .w7spl *::after { box-sizing: border-box; }
.w7spl-bar { position: absolute; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px clamp(16px, 4vw, 48px); pointer-events: none; }
.w7spl-bar > * { pointer-events: auto; }
.w7spl-brand { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.w7spl-btn { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 18px; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.w7spl-icon { position: relative; width: 18px; height: 10px; }
.w7spl-icon i { position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform .35s ease; }
.w7spl-icon i:first-child { top: 0; } .w7spl-icon i:last-child { bottom: 0; }
.w7spl-open .w7spl-icon i:first-child { transform: translateY(4px) rotate(45deg); }
.w7spl-open .w7spl-icon i:last-child { transform: translateY(-4px) rotate(-45deg); }
.w7spl a:focus-visible, .w7spl-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.w7spl-menu { visibility: hidden; transition: visibility 0s var(--w7spl-out, .5s); }
.w7spl-open .w7spl-menu { visibility: visible; transition: visibility 0s; }
.w7spl-nav ul { margin: 0; padding: 0; list-style: none; }
.w7spl-nav a { color: inherit; text-decoration: none; }
.w7spl-page { display: flex; flex-direction: column; justify-content: center; height: 100%; padding: 84px clamp(16px, 4vw, 48px) 32px; }
.w7spl-eye { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: #5c5a55; }
.w7spl-title { margin: 14px 0 0; max-width: 18ch; font-size: clamp(30px, 5vw, 60px); font-weight: 500; line-height: 1.04; letter-spacing: -.035em; }
.w7spl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 560px; margin-top: 28px; }
.w7spl-grid i { height: 64px; border: 1px solid #b9b5ad; background: linear-gradient(135deg, transparent 49.5%, #c9c5bd 50%, transparent 50.5%); }
.w7spl-text { margin: 24px 0 0; max-width: 46ch; font-size: 15px; line-height: 1.6; color: #4b4a46; }
.w7spl-open .w7spl-bar { color: var(--w7spl-pale); }
.w7spl-menu { position: absolute; z-index: 20; inset: 0; color: var(--w7spl-pale); }
/* Two halves: the upper one comes down, the lower one comes up, and they meet at the middle line. */
.w7spl-half { position: absolute; left: 0; right: 0; height: 50%; display: flex; padding: 0 clamp(16px, 4vw, 48px); transition: transform var(--w7spl-out) cubic-bezier(.7, 0, .3, 1); }
.w7spl-top { top: 0; align-items: flex-end; padding-bottom: 20px; background: var(--w7spl-up); transform: translateY(-100%); }
.w7spl-bot { bottom: 0; align-items: flex-start; padding-top: 22px; background: var(--w7spl-low); transform: translateY(100%); }
.w7spl-open .w7spl-half { transform: none; transition: transform var(--w7spl-speed) cubic-bezier(.7, 0, .2, 1); }
.w7spl-nav ul { display: flex; flex-wrap: wrap; gap: 0 clamp(16px, 3.5vw, 48px); }
.w7spl-nav li { overflow: hidden; }
.w7spl-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; font-size: clamp(30px, 6vw, 72px); font-weight: 500; letter-spacing: -.04em; line-height: 1.1; }
.w7spl-nav a span { display: inline-block; transform: translateY(105%); transition: transform .2s; }
.w7spl-open .w7spl-nav a span { transform: none; transition: transform .4s cubic-bezier(.2, .8, .2, 1) calc(var(--w7spl-speed) * .5 + var(--i) * .04s); }
.w7spl-nav a[aria-current="page"] { color: var(--w7spl-acc); }
@media (hover: hover) { .w7spl-nav a:hover { color: var(--w7spl-acc); } }
.w7spl-info { display: flex; flex-wrap: wrap; gap: 12px 48px; font-size: 15px; line-height: 1.5; opacity: 0; transform: translateY(-10px); transition: opacity .2s, transform .2s; }
.w7spl-open .w7spl-info { opacity: 1; transform: none; transition: opacity .3s, transform .3s; transition-delay: calc(var(--w7spl-speed) * .8); }
.w7spl-info p { margin: 0; } .w7spl-k { display: block; margin-bottom: 4px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: #b3b0a9; }
.w7spl-info a { display: inline-flex; align-items: center; min-height: 40px; color: inherit; }
@media (max-width: 600px) { .w7spl-nav ul { flex-direction: column; } .w7spl-nav a { min-height: 40px; } }
@media (prefers-reduced-motion: reduce) { .w7spl-half, .w7spl-nav a span, .w7spl-info, .w7spl-icon i { transition: none !important; } }
</style>
<script>
(function () {
/* Change this: when the demo opens the menu by itself (ms). Set 0 on a real site. */
var AUTO_OPEN = 500;
var root = document.querySelector(".w7spl");
if (!root) return;
var btn = root.querySelector(".w7spl-btn"), word = root.querySelector(".w7spl-word"),
menu = root.querySelector(".w7spl-menu"), page = root.querySelector(".w7spl-page"), used = false;
function isOpen() { return root.classList.contains("w7spl-open"); }
function set(open, moveFocus) {
root.classList.toggle("w7spl-open", open);
btn.setAttribute("aria-expanded", open);
word.textContent = open ? "Close" : "Menu";
menu.inert = !open;
page.inert = open; /* on a real page, make main and footer inert instead */
if (moveFocus) (open ? menu.querySelector("a") : btn).focus();
}
function touch() { used = true; }
btn.addEventListener("click", function () { touch(); set(!isOpen(), true); });
root.addEventListener("pointerdown", touch);
root.addEventListener("focusin", touch);
root.addEventListener("keydown", function (e) {
if (!isOpen()) return;
if (e.key === "Escape") { e.preventDefault(); set(false, true); return; }
if (e.key !== "Tab") return;
/* focus trap: the button plus everything in the menu */
var f = [btn].concat([].slice.call(menu.querySelectorAll("a[href], button"))), i = f.indexOf(document.activeElement);
if (e.shiftKey && i <= 0) { e.preventDefault(); f[f.length - 1].focus(); }
else if (!e.shiftKey && i === f.length - 1) { e.preventDefault(); f[0].focus(); }
});
menu.addEventListener("click", function (e) {
var a = e.target.closest("a");
if (!a) return;
e.preventDefault(); /* remove on a real site so the link navigates */
if (a.closest("nav")) { menu.querySelectorAll("[aria-current]").forEach(function (x) { x.removeAttribute("aria-current"); }); a.setAttribute("aria-current", "page"); }
set(false, true);
});
if (AUTO_OPEN) setTimeout(function () { if (!used) set(true, false); }, AUTO_OPEN);
})();
</script>
With reduced motion: Both halves are already closed when the menu opens, with the links and address showing, and nothing slides.
Running cost: Two transformed halves and a short text stagger, finished in well under a second and idle afterwards.
- Tone the two halves separately with `--w7spl-up` and `--w7spl-low`, or set them equal for a single dark sheet.
- Shorten or lengthen the door movement with `--w7spl-speed`; the closing time is `--w7spl-out`.
- Put up to five short page names in the nav list; on phones the row becomes a column.
Ink Overlay With Numbered Rows That Draw Their Rules
An ink-dark sheet fades over a bookbinder's page, a hairline rule draws across from the left for each row, and then a small gold number and a large serif page name lift out of each line in turn. A short gold underline marks the current page and follows hover and keyboard focus.
<div class="w7num">
<header class="w7num-bar">
<p class="w7num-brand">Hollis & Reed Bindery</p>
<button class="w7num-btn" type="button" aria-expanded="false" aria-controls="w7num-menu">
<span class="w7num-word">Menu</span><span class="w7num-icon" aria-hidden="true"><i></i><i></i></span>
</button>
</header>
<div class="w7num-page">
<div class="w7num-copy">
<p class="w7num-eye">Hand bookbinding and repair</p>
<h2 class="w7num-title">Old books, sewn back together.</h2>
<p class="w7num-text">We rebind family bibles, recipe notebooks and thesis copies in cloth or leather, by hand, at a bench in a converted dairy.</p>
</div>
<div class="w7num-books" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i><i></i></div>
</div>
<div class="w7num-menu" id="w7num-menu" inert>
<nav class="w7num-nav" aria-label="Main">
<ul>
<li style="--i:0"><a href="#" aria-current="page"><small>01</small><span>Home</span></a></li>
<li style="--i:1"><a href="#"><small>02</small><span>Repairs</span></a></li>
<li style="--i:2"><a href="#"><small>03</small><span>New bindings</span></a></li>
<li style="--i:3"><a href="#"><small>04</small><span>Workshops</span></a></li>
<li style="--i:4"><a href="#"><small>05</small><span>Get a quote</span></a></li>
</ul>
</nav>
</div>
</div>
<style>
/* Change these: page paper, overlay ink, text on the ink, rule and number accent, row stagger. */
.w7num { --w7num-bg: #f5f2ec; --w7num-ink: #1b1915; --w7num-dark: #171512; --w7num-paper: #f1ece2; --w7num-acc: #c9a46a; --w7num-step: .04s; --w7num-out: .4s; }
.w7num { position: relative; height: 600px; overflow: hidden; background: var(--w7num-bg); color: var(--w7num-ink); font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.w7num *, .w7num *::before, .w7num *::after { box-sizing: border-box; }
.w7num-bar { position: absolute; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px clamp(16px, 4vw, 48px); pointer-events: none; }
.w7num-bar > * { pointer-events: auto; }
.w7num-brand { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.w7num-btn { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 18px; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.w7num-icon { position: relative; width: 18px; height: 10px; }
.w7num-icon i { position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform .35s ease; }
.w7num-icon i:first-child { top: 0; } .w7num-icon i:last-child { bottom: 0; }
.w7num-open .w7num-icon i:first-child { transform: translateY(4px) rotate(45deg); }
.w7num-open .w7num-icon i:last-child { transform: translateY(-4px) rotate(-45deg); }
.w7num a:focus-visible, .w7num-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.w7num-menu { visibility: hidden; transition: visibility 0s var(--w7num-out, .5s); }
.w7num-open .w7num-menu { visibility: visible; transition: visibility 0s; }
.w7num-nav ul { margin: 0; padding: 0; list-style: none; }
.w7num-nav a { color: inherit; text-decoration: none; }
.w7num-brand { font-family: ui-serif, Georgia, "Times New Roman", serif; font-weight: 400; font-size: 19px; }
.w7num-page { display: grid; align-items: center; gap: 32px; height: 100%; padding: 84px clamp(16px, 4vw, 48px) 32px; }
@media (min-width: 760px) { .w7num-page { grid-template-columns: 1.2fr 1fr; } }
.w7num-eye { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: #6f5a38; }
.w7num-title { margin: 14px 0 0; max-width: 13ch; font: 400 clamp(34px, 5.4vw, 66px)/1 ui-serif, Georgia, "Times New Roman", serif; letter-spacing: -.02em; }
.w7num-text { margin: 18px 0 0; max-width: 40ch; font-size: 16px; line-height: 1.6; color: #575148; }
.w7num-books { display: flex; align-items: flex-end; gap: 6px; height: 260px; justify-self: center; }
.w7num-books i { width: 34px; border-radius: 2px 2px 0 0; box-shadow: inset -6px 0 0 rgba(0, 0, 0, .12); }
.w7num-books i:nth-child(1) { height: 78%; background: #5b3a29; } .w7num-books i:nth-child(2) { height: 92%; background: #23384a; } .w7num-books i:nth-child(3) { height: 70%; background: #8a6a3b; }
.w7num-books i:nth-child(4) { height: 100%; background: #2f3f30; } .w7num-books i:nth-child(5) { height: 84%; background: #6d2f2a; } .w7num-books i:nth-child(6) { height: 64%; width: 26px; background: #b7a27c; }
@media (max-width: 759px) { .w7num-books { display: none; } }
.w7num-open .w7num-bar { color: var(--w7num-paper); }
.w7num-menu { position: absolute; z-index: 20; inset: 0; display: flex; align-items: center; padding: 84px clamp(16px, 4vw, 48px) 32px; background: var(--w7num-dark); color: var(--w7num-paper);
opacity: 0; transition: opacity var(--w7num-out) ease, visibility 0s var(--w7num-out); }
.w7num-open .w7num-menu { opacity: 1; transition: opacity .35s ease, visibility 0s; }
.w7num-nav { width: 100%; }
.w7num-nav li { position: relative; }
/* Each row's rule draws from the left with scaleX, then its words lift out of a mask. */
.w7num-nav li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: #4a443b; transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.w7num-open .w7num-nav li::before { transform: none; transition: transform .5s cubic-bezier(.6, 0, .2, 1) calc(.1s + var(--i) * var(--w7num-step)); }
.w7num-nav a { display: flex; align-items: baseline; gap: clamp(14px, 3vw, 40px); min-height: 52px; overflow: hidden; padding: 8px 0; }
.w7num-nav small, .w7num-nav span { display: inline-block; transform: translateY(110%); transition: transform .2s; }
.w7num-open .w7num-nav small, .w7num-open .w7num-nav span { transform: none; transition: transform .45s cubic-bezier(.2, .8, .2, 1) calc(.25s + var(--i) * var(--w7num-step)); }
.w7num-nav small { width: 2.2em; font: 500 13px/1 ui-monospace, Menlo, monospace; color: var(--w7num-acc); }
.w7num-nav span { font: 400 clamp(28px, 5vw, 58px)/1.05 ui-serif, Georgia, "Times New Roman", serif; }
.w7num-nav a::after { content: ""; position: absolute; left: calc(2.2em + clamp(14px, 3vw, 40px)); right: 0; bottom: 6px; height: 2px; background: var(--w7num-acc); transform: scaleX(0); transform-origin: left; transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.w7num-nav a:focus-visible::after, .w7num-nav a[aria-current="page"]::after { transform: scaleX(.18); }
@media (hover: hover) { .w7num-nav a:hover::after { transform: scaleX(.18); } }
@media (prefers-reduced-motion: reduce) { .w7num-menu, .w7num-open .w7num-menu, .w7num-nav li::before, .w7num-nav small, .w7num-nav span, .w7num-nav a::after, .w7num-icon i { transition: none !important; } }
</style>
<script>
(function () {
/* Change this: when the demo opens the menu by itself (ms). Set 0 on a real site. */
var AUTO_OPEN = 500;
var root = document.querySelector(".w7num");
if (!root) return;
var btn = root.querySelector(".w7num-btn"), word = root.querySelector(".w7num-word"),
menu = root.querySelector(".w7num-menu"), page = root.querySelector(".w7num-page"), used = false;
function isOpen() { return root.classList.contains("w7num-open"); }
function set(open, moveFocus) {
root.classList.toggle("w7num-open", open);
btn.setAttribute("aria-expanded", open);
word.textContent = open ? "Close" : "Menu";
menu.inert = !open;
page.inert = open; /* on a real page, make main and footer inert instead */
if (moveFocus) (open ? menu.querySelector("a") : btn).focus();
}
function touch() { used = true; }
btn.addEventListener("click", function () { touch(); set(!isOpen(), true); });
root.addEventListener("pointerdown", touch);
root.addEventListener("focusin", touch);
root.addEventListener("keydown", function (e) {
if (!isOpen()) return;
if (e.key === "Escape") { e.preventDefault(); set(false, true); return; }
if (e.key !== "Tab") return;
/* focus trap: the button plus everything in the menu */
var f = [btn].concat([].slice.call(menu.querySelectorAll("a[href], button"))), i = f.indexOf(document.activeElement);
if (e.shiftKey && i <= 0) { e.preventDefault(); f[f.length - 1].focus(); }
else if (!e.shiftKey && i === f.length - 1) { e.preventDefault(); f[0].focus(); }
});
menu.addEventListener("click", function (e) {
var a = e.target.closest("a");
if (!a) return;
e.preventDefault(); /* remove on a real site so the link navigates */
if (a.closest("nav")) { menu.querySelectorAll("[aria-current]").forEach(function (x) { x.removeAttribute("aria-current"); }); a.setAttribute("aria-current", "page"); }
set(false, true);
});
if (AUTO_OPEN) setTimeout(function () { if (!used) set(true, false); }, AUTO_OPEN);
})();
</script>
With reduced motion: The dark sheet shows at once with the rules drawn and every number and name in place.
Running cost: Pure CSS transitions on rules and text spans; nothing runs once the rows have settled.
- Set `--w7num-dark` for the sheet and `--w7num-acc` for the numbers and underline.
- Spread the rows out in time with `--w7num-step`.
- Change the numbers in each `<small>` if your pages are not in a fixed order, or remove them.
Navy Circle That Grows From the Menu Button
Pressing Menu on this sailing school page grows a deep navy disc outward from the button itself until it fills the frame, and the right-aligned links drop in from that same corner. The disc is drawn at full size first and only scaled, so the reveal stays smooth even on modest phones.
<div class="w7cir">
<header class="w7cir-bar">
<p class="w7cir-brand">Harbourline Sailing</p>
<button class="w7cir-btn" type="button" aria-expanded="false" aria-controls="w7cir-menu">
<span class="w7cir-word">Menu</span><span class="w7cir-icon" aria-hidden="true"><i></i><i></i></span>
</button>
</header>
<div class="w7cir-page">
<div class="w7cir-pic"><img src="https://images.pexels.com/photos/15305793/pexels-photo-15305793.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="A single white sailboat far out on deep blue open water" width="1200" height="801" loading="lazy"></div>
<div class="w7cir-copy">
<p class="w7cir-eye">Dinghy and keelboat courses</p>
<h2 class="w7cir-title">Learn to sail in the shelter of the bay.</h2>
<a class="w7cir-cta" href="#">See summer courses</a>
</div>
</div>
<div class="w7cir-menu" id="w7cir-menu" inert>
<span class="w7cir-disc" aria-hidden="true"></span>
<div class="w7cir-in">
<nav class="w7cir-nav" aria-label="Main">
<ul>
<li style="--i:0"><a href="#" aria-current="page"><span>Home</span></a></li>
<li style="--i:1"><a href="#"><span>Courses</span></a></li>
<li style="--i:2"><a href="#"><span>Boats and kit</span></a></li>
<li style="--i:3"><a href="#"><span>Tides and weather</span></a></li>
<li style="--i:4"><a href="#"><span>Contact the club</span></a></li>
</ul>
</nav>
<p class="w7cir-note">Slipway open from 8 each morning, tide permitting.</p>
</div>
</div>
</div>
<style>
/* Change these: page colour, circle colour, text on the circle, accent, how long the circle takes. */
.w7cir { --w7cir-bg: #f2f5f8; --w7cir-ink: #10213a; --w7cir-sea: #0f2847; --w7cir-foam: #eef3f8; --w7cir-acc: #f2b25c; --w7cir-speed: .65s; --w7cir-out: .5s; }
.w7cir { position: relative; height: 600px; overflow: hidden; background: var(--w7cir-bg); color: var(--w7cir-ink); font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.w7cir *, .w7cir *::before, .w7cir *::after { box-sizing: border-box; }
.w7cir-bar { position: absolute; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px clamp(16px, 4vw, 48px); pointer-events: none; }
.w7cir-bar > * { pointer-events: auto; }
.w7cir-brand { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.w7cir-btn { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 18px; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.w7cir-icon { position: relative; width: 18px; height: 10px; }
.w7cir-icon i { position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform .35s ease; }
.w7cir-icon i:first-child { top: 0; } .w7cir-icon i:last-child { bottom: 0; }
.w7cir-open .w7cir-icon i:first-child { transform: translateY(4px) rotate(45deg); }
.w7cir-open .w7cir-icon i:last-child { transform: translateY(-4px) rotate(-45deg); }
.w7cir a:focus-visible, .w7cir-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.w7cir-menu { visibility: hidden; transition: visibility 0s var(--w7cir-out, .5s); }
.w7cir-open .w7cir-menu { visibility: visible; transition: visibility 0s; }
.w7cir-nav ul { margin: 0; padding: 0; list-style: none; }
.w7cir-nav a { color: inherit; text-decoration: none; }
.w7cir-page { position: relative; height: 100%; }
.w7cir-pic { position: absolute; inset: 0; }
.w7cir-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.w7cir-pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 22, 42, .78), rgba(8, 22, 42, .2) 70%); }
.w7cir-copy { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; padding: 84px clamp(16px, 4vw, 48px) 48px; color: var(--w7cir-foam); }
.w7cir-eye { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--w7cir-acc); }
.w7cir-title { margin: 12px 0 0; max-width: 14ch; font-size: clamp(32px, 5vw, 58px); font-weight: 700; line-height: 1.02; letter-spacing: -.03em; }
.w7cir-cta { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; margin-top: 24px; padding: 0 22px; border-radius: 999px; background: var(--w7cir-foam); color: var(--w7cir-sea); font-size: 15px; font-weight: 700; text-decoration: none; }
.w7cir-bar { color: var(--w7cir-foam); }
.w7cir-btn { background: rgba(8, 22, 42, .35); }
.w7cir-menu { position: absolute; z-index: 20; inset: 0; color: var(--w7cir-foam); }
/* A circle sized to cover the whole box, centred on the button and scaled up from nothing. */
.w7cir-disc { position: absolute; width: 3400px; height: 3400px; top: calc(36px - 1700px); right: calc(clamp(16px, 4vw, 48px) + 52px - 1700px); border-radius: 50%; background: var(--w7cir-sea);
transform: scale(0); transition: transform var(--w7cir-out) cubic-bezier(.6, 0, .4, 1); }
.w7cir-open .w7cir-disc { transform: scale(1); transition: transform var(--w7cir-speed) cubic-bezier(.55, 0, .2, 1); }
.w7cir-in { position: relative; display: flex; flex-direction: column; justify-content: center; height: 100%; padding: 84px clamp(16px, 4vw, 48px) 32px; text-align: right; }
.w7cir-nav a { display: inline-flex; align-items: center; min-height: 48px; font-size: clamp(30px, 5vw, 56px); font-weight: 700; letter-spacing: -.03em; }
.w7cir-nav li { opacity: 0; transform: translate(20px, -12px) scale(.96); transform-origin: right top; transition: opacity .15s, transform .2s; }
.w7cir-open .w7cir-nav li { opacity: 1; transform: none; transition: opacity .4s, transform .6s cubic-bezier(.2, .8, .2, 1); transition-duration: .4s; transition-delay: calc(var(--w7cir-speed) * .4 + var(--i) * .04s); }
.w7cir-nav a[aria-current="page"] span { border-bottom: 3px solid var(--w7cir-acc); }
@media (hover: hover) { .w7cir-nav a:hover { color: var(--w7cir-acc); } }
.w7cir-note { margin: 20px 0 0; font-size: 14px; color: #b8c6d8; opacity: 0; transition: opacity .2s; }
.w7cir-open .w7cir-note { opacity: 1; transition: opacity .3s calc(var(--w7cir-speed) * .8); }
@media (prefers-reduced-motion: reduce) { .w7cir-disc, .w7cir-nav li, .w7cir-note, .w7cir-icon i { transition: none !important; } }
</style>
<script>
(function () {
/* Change this: when the demo opens the menu by itself (ms). Set 0 on a real site. */
var AUTO_OPEN = 500;
var root = document.querySelector(".w7cir");
if (!root) return;
var btn = root.querySelector(".w7cir-btn"), word = root.querySelector(".w7cir-word"),
menu = root.querySelector(".w7cir-menu"), page = root.querySelector(".w7cir-page"), used = false;
function isOpen() { return root.classList.contains("w7cir-open"); }
function set(open, moveFocus) {
root.classList.toggle("w7cir-open", open);
btn.setAttribute("aria-expanded", open);
word.textContent = open ? "Close" : "Menu";
menu.inert = !open;
page.inert = open; /* on a real page, make main and footer inert instead */
if (moveFocus) (open ? menu.querySelector("a") : btn).focus();
}
function touch() { used = true; }
btn.addEventListener("click", function () { touch(); set(!isOpen(), true); });
root.addEventListener("pointerdown", touch);
root.addEventListener("focusin", touch);
root.addEventListener("keydown", function (e) {
if (!isOpen()) return;
if (e.key === "Escape") { e.preventDefault(); set(false, true); return; }
if (e.key !== "Tab") return;
/* focus trap: the button plus everything in the menu */
var f = [btn].concat([].slice.call(menu.querySelectorAll("a[href], button"))), i = f.indexOf(document.activeElement);
if (e.shiftKey && i <= 0) { e.preventDefault(); f[f.length - 1].focus(); }
else if (!e.shiftKey && i === f.length - 1) { e.preventDefault(); f[0].focus(); }
});
menu.addEventListener("click", function (e) {
var a = e.target.closest("a");
if (!a) return;
e.preventDefault(); /* remove on a real site so the link navigates */
if (a.closest("nav")) { menu.querySelectorAll("[aria-current]").forEach(function (x) { x.removeAttribute("aria-current"); }); a.setAttribute("aria-current", "page"); }
set(false, true);
});
if (AUTO_OPEN) setTimeout(function () { if (!used) set(true, false); }, AUTO_OPEN);
})();
</script>
With reduced motion: The navy cover and links appear instantly in their final places, with no growing circle.
Running cost: One large pre-drawn circle is scaled on the compositor, so opening costs a single layer animation and no repaint per frame.
- Change `--w7cir-sea` for the disc and `--w7cir-acc` for the underline under the current page.
- If you move the button, update the `top` and `right` offsets on `.w7cir-disc` so the circle still starts under it.
- Use `--w7cir-speed` for the opening time and `--w7cir-out` for the closing time.
Paper Menu With a Photo Preview That Follows Focus
A warm paper sheet fades over a small guesthouse page with four serif links on one side and a framed photograph on the other. Pointing at a link or tabbing onto it brings up its own picture with a slow settle, and while nobody touches it the preview steps through the rooms, breakfast, terrace and coast path by itself.
<div class="w7img">
<header class="w7img-bar">
<p class="w7img-brand">The Saltmarsh Rooms</p>
<button class="w7img-btn" type="button" aria-expanded="false" aria-controls="w7img-menu">
<span class="w7img-word">Menu</span><span class="w7img-icon" aria-hidden="true"><i></i><i></i></span>
</button>
</header>
<div class="w7img-page">
<p class="w7img-eye">Six rooms by the estuary</p>
<h2 class="w7img-title">A quiet house at the end of the lane.</h2>
<p class="w7img-text">Breakfast in the kitchen, boots by the door, and the coast path ten minutes from the gate.</p>
<a class="w7img-cta" href="#">Check dates</a>
</div>
<div class="w7img-menu" id="w7img-menu" inert>
<nav class="w7img-nav" aria-label="Main">
<ul>
<li style="--i:0"><a href="#" data-n="0" aria-current="page"><span>Rooms</span><small>01</small></a></li>
<li style="--i:1"><a href="#" data-n="1"><span>Breakfast</span><small>02</small></a></li>
<li style="--i:2"><a href="#" data-n="2"><span>The terrace</span><small>03</small></a></li>
<li style="--i:3"><a href="#" data-n="3"><span>The coast path</span><small>04</small></a></li>
</ul>
</nav>
<div class="w7img-fig" aria-hidden="true">
<img class="w7img-ph" data-n="0" src="https://images.pexels.com/photos/34636330/pexels-photo-34636330.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="Rolled white towels on a made bed with a dark headboard" width="1200" height="800" decoding="async">
<img class="w7img-ph" data-n="1" src="https://images.pexels.com/photos/18654566/pexels-photo-18654566.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="A bowl and cup on a wooden table by a chair in warm morning light" width="1200" height="800" decoding="async">
<img class="w7img-ph" data-n="2" src="https://images.pexels.com/photos/30280895/pexels-photo-30280895.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="Green metal garden chairs on a flagstone terrace against a stone wall" width="1200" height="800" decoding="async">
<img class="w7img-ph" data-n="3" src="https://images.pexels.com/photos/6725997/pexels-photo-6725997.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="Waves breaking white against dark rocky cliffs under a bright sky" width="1200" height="800" decoding="async">
</div>
</div>
</div>
<style>
/* Change these: page colour, menu colour, ink, accent, how often the demo moves to the next photo. */
.w7img { --w7img-bg: #f6f1e8; --w7img-ink: #2a241d; --w7img-sheet: #efe6d7; --w7img-acc: #8c5a2b; --w7img-out: .45s; }
.w7img { position: relative; height: 600px; overflow: hidden; background: var(--w7img-bg); color: var(--w7img-ink); font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.w7img *, .w7img *::before, .w7img *::after { box-sizing: border-box; }
.w7img-bar { position: absolute; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px clamp(16px, 4vw, 48px); pointer-events: none; }
.w7img-bar > * { pointer-events: auto; }
.w7img-brand { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.w7img-btn { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 18px; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.w7img-icon { position: relative; width: 18px; height: 10px; }
.w7img-icon i { position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform .35s ease; }
.w7img-icon i:first-child { top: 0; } .w7img-icon i:last-child { bottom: 0; }
.w7img-open .w7img-icon i:first-child { transform: translateY(4px) rotate(45deg); }
.w7img-open .w7img-icon i:last-child { transform: translateY(-4px) rotate(-45deg); }
.w7img a:focus-visible, .w7img-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.w7img-menu { visibility: hidden; transition: visibility 0s var(--w7img-out, .5s); }
.w7img-open .w7img-menu { visibility: visible; transition: visibility 0s; }
.w7img-nav ul { margin: 0; padding: 0; list-style: none; }
.w7img-nav a { color: inherit; text-decoration: none; }
.w7img-page { display: flex; flex-direction: column; justify-content: center; height: 100%; padding: 84px clamp(16px, 4vw, 48px) 32px; }
.w7img-brand { font-family: ui-serif, Georgia, "Times New Roman", serif; font-weight: 400; font-size: 19px; }
.w7img-eye { margin: 0; font-size: 13px; font-style: italic; color: var(--w7img-acc); }
.w7img-title { margin: 12px 0 0; max-width: 16ch; font: 400 clamp(32px, 5vw, 60px)/1.05 ui-serif, Georgia, "Times New Roman", serif; }
.w7img-text { margin: 18px 0 0; max-width: 40ch; font-size: 16px; line-height: 1.6; color: #5a4f43; }
.w7img-cta { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; margin-top: 22px; padding: 0 22px; border: 1px solid var(--w7img-ink); border-radius: 2px; color: inherit; font-size: 15px; text-decoration: none; }
.w7img-menu { position: absolute; z-index: 20; inset: 0; display: grid; align-items: center; gap: 32px; padding: 84px clamp(16px, 4vw, 48px) 32px; background: var(--w7img-sheet);
opacity: 0; transition: opacity var(--w7img-out) ease, visibility 0s var(--w7img-out); }
.w7img-open .w7img-menu { opacity: 1; transition: opacity .4s ease, visibility 0s; }
@media (min-width: 760px) { .w7img-menu { grid-template-columns: 1fr 1fr; } }
.w7img-nav li { border-bottom: 1px solid #d6c9b4; transform: translateY(18px); opacity: 0; transition: transform .2s, opacity .2s; }
.w7img-open .w7img-nav li { transform: none; opacity: 1; transition: transform .6s cubic-bezier(.2, .8, .2, 1), opacity .4s; transition-duration: .45s; transition-delay: calc(.1s + var(--i) * .07s); }
.w7img-nav a { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; min-height: 56px; padding: 10px 0; font: 400 clamp(28px, 4.4vw, 50px)/1.1 ui-serif, Georgia, "Times New Roman", serif; }
.w7img-nav small { font: 500 12px/1 ui-sans-serif, system-ui, sans-serif; color: #75654f; }
.w7img-nav a span { transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.w7img-nav a[aria-current="page"] small { color: var(--w7img-acc); }
/* The link whose photo is showing shifts right a little. */
.w7img[data-show="0"] [data-n="0"] span, .w7img[data-show="1"] [data-n="1"] span, .w7img[data-show="2"] [data-n="2"] span, .w7img[data-show="3"] [data-n="3"] span { transform: translateX(14px); font-style: italic; }
.w7img-fig { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 3px; background: #ddd0bb; box-shadow: 0 30px 60px -36px rgba(60, 40, 20, .6); transform: scale(.96); transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.w7img-open .w7img-fig { transform: none; }
.w7img-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity .5s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.w7img[data-show="0"] .w7img-ph[data-n="0"], .w7img[data-show="1"] .w7img-ph[data-n="1"], .w7img[data-show="2"] .w7img-ph[data-n="2"], .w7img[data-show="3"] .w7img-ph[data-n="3"] { opacity: 1; transform: none; }
@media (max-width: 759px) { .w7img-fig { display: none; } }
@media (prefers-reduced-motion: reduce) { .w7img-menu, .w7img-open .w7img-menu, .w7img-nav li, .w7img-nav a span, .w7img-fig, .w7img-ph, .w7img-icon i { transition: none !important; } }
</style>
<script>
(function () {
/* Change this: when the demo opens the menu by itself (ms). Set 0 on a real site. */
var AUTO_OPEN = 500;
var root = document.querySelector(".w7img");
if (!root) return;
var btn = root.querySelector(".w7img-btn"), word = root.querySelector(".w7img-word"),
menu = root.querySelector(".w7img-menu"), page = root.querySelector(".w7img-page"), used = false;
function isOpen() { return root.classList.contains("w7img-open"); }
function set(open, moveFocus) {
root.classList.toggle("w7img-open", open);
btn.setAttribute("aria-expanded", open);
word.textContent = open ? "Close" : "Menu";
menu.inert = !open;
page.inert = open; /* on a real page, make main and footer inert instead */
if (moveFocus) (open ? menu.querySelector("a") : btn).focus();
}
function touch() { used = true; }
btn.addEventListener("click", function () { touch(); set(!isOpen(), true); });
root.addEventListener("pointerdown", touch);
root.addEventListener("focusin", touch);
root.addEventListener("keydown", function (e) {
if (!isOpen()) return;
if (e.key === "Escape") { e.preventDefault(); set(false, true); return; }
if (e.key !== "Tab") return;
/* focus trap: the button plus everything in the menu */
var f = [btn].concat([].slice.call(menu.querySelectorAll("a[href], button"))), i = f.indexOf(document.activeElement);
if (e.shiftKey && i <= 0) { e.preventDefault(); f[f.length - 1].focus(); }
else if (!e.shiftKey && i === f.length - 1) { e.preventDefault(); f[0].focus(); }
});
menu.addEventListener("click", function (e) {
var a = e.target.closest("a");
if (!a) return;
e.preventDefault(); /* remove on a real site so the link navigates */
if (a.closest("nav")) { menu.querySelectorAll("[aria-current]").forEach(function (x) { x.removeAttribute("aria-current"); }); a.setAttribute("aria-current", "page"); }
set(false, true);
});
/* Change this: ms between photos while the demo runs on its own. */
var CYCLE = 2600, shown = 0, seen = true, rm = matchMedia("(prefers-reduced-motion: reduce)").matches;
function show(n) { shown = +n; root.setAttribute("data-show", shown); }
show(0);
function follow(e) { var a = e.target.closest("[data-n]"); if (a && a.closest("nav")) show(a.getAttribute("data-n")); }
menu.addEventListener("pointerover", follow);
menu.addEventListener("focusin", follow);
/* idle demo: steps through the photos while nobody is using the piece and it is on screen */
new IntersectionObserver(function (en) { seen = en[0].isIntersecting; }).observe(root);
if (!rm) setInterval(function () { if (!used && seen && isOpen()) show((shown + 1) % 4); }, CYCLE);
if (AUTO_OPEN) setTimeout(function () { if (!used) set(true, false); }, AUTO_OPEN);
})();
</script>
With reduced motion: The sheet and first photo appear without fading, photos swap instantly on hover or focus, and the automatic cycle stays off.
Running cost: Opacity and transform on four stacked images; the idle timer does nothing while the piece is off screen or in use.
- Each link's `data-n` matches the photo with the same `data-n`; add a fifth pair and extend the `[data-show]` rules.
- Set `CYCLE` for how long each photo holds during the idle demo.
- Recolour the sheet with `--w7img-sheet` and the numbers and current page with `--w7img-acc`.
Slate Page That Shrinks Aside to Uncover the Menu
Here the menu never moves: the bicycle workshop page itself shrinks into a rounded card and slides off to the left, uncovering the links that were lying underneath on a pale slate ground. A soft shadow fades in under the shifted page so it reads as a sheet lifted off the menu.
<div class="w7psh">
<header class="w7psh-bar">
<p class="w7psh-brand">Northbank Cycle Works</p>
<button class="w7psh-btn" type="button" aria-expanded="false" aria-controls="w7psh-menu">
<span class="w7psh-word">Menu</span><span class="w7psh-icon" aria-hidden="true"><i></i><i></i></span>
</button>
</header>
<div class="w7psh-menu" id="w7psh-menu" inert>
<nav class="w7psh-nav" aria-label="Main">
<ul>
<li style="--i:0"><a href="#" aria-current="page"><span>Home</span></a></li>
<li style="--i:1"><a href="#"><span>Servicing</span></a></li>
<li style="--i:2"><a href="#"><span>Wheel builds</span></a></li>
<li style="--i:3"><a href="#"><span>Bike fitting</span></a></li>
<li style="--i:4"><a href="#"><span>Book a slot</span></a></li>
</ul>
</nav>
<p class="w7psh-note">Workshop open Tuesday to Saturday.<br><a href="#">Ask about a repair</a></p>
</div>
<div class="w7psh-page">
<div class="w7psh-copy">
<p class="w7psh-eye">Repairs, servicing and wheel builds</p>
<h2 class="w7psh-title">Bring it in on Monday, ride it home on Wednesday.</h2>
<a class="w7psh-cta" href="#">Book a service</a>
</div>
<div class="w7psh-pic"><img src="https://images.pexels.com/photos/34185192/pexels-photo-34185192.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="Two mechanics in blue overalls working on a bicycle in a workshop" width="1200" height="833" loading="lazy"></div>
</div>
</div>
<style>
/* Change these: menu colour under the page, ink, accent, how far the page moves, how small it gets. */
.w7psh { --w7psh-bg: #dfe5ec; --w7psh-ink: #17212c; --w7psh-card: #ffffff; --w7psh-acc: #2d6fb3; --w7psh-shift: -58%; --w7psh-shrink: .86; --w7psh-out: .55s; }
.w7psh { position: relative; height: 600px; overflow: hidden; background: var(--w7psh-bg); color: var(--w7psh-ink); font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.w7psh *, .w7psh *::before, .w7psh *::after { box-sizing: border-box; }
.w7psh-bar { position: absolute; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px clamp(16px, 4vw, 48px); pointer-events: none; }
.w7psh-bar > * { pointer-events: auto; }
.w7psh-brand { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.w7psh-btn { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 18px; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.w7psh-icon { position: relative; width: 18px; height: 10px; }
.w7psh-icon i { position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform .35s ease; }
.w7psh-icon i:first-child { top: 0; } .w7psh-icon i:last-child { bottom: 0; }
.w7psh-open .w7psh-icon i:first-child { transform: translateY(4px) rotate(45deg); }
.w7psh-open .w7psh-icon i:last-child { transform: translateY(-4px) rotate(-45deg); }
.w7psh a:focus-visible, .w7psh-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.w7psh-menu { visibility: hidden; transition: visibility 0s var(--w7psh-out, .5s); }
.w7psh-open .w7psh-menu { visibility: visible; transition: visibility 0s; }
.w7psh-nav ul { margin: 0; padding: 0; list-style: none; }
.w7psh-nav a { color: inherit; text-decoration: none; }
.w7psh-page { position: absolute; z-index: 10; inset: 0; display: grid; align-items: center; gap: 24px; padding: 84px clamp(16px, 4vw, 48px) 32px; background: var(--w7psh-card);
transform-origin: 50% 50%; transition: transform var(--w7psh-out) cubic-bezier(.7, 0, .3, 1); }
.w7psh-page::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 40px 80px -30px rgba(15, 25, 40, .45); opacity: 0; transition: opacity .4s; pointer-events: none; }
.w7psh-open .w7psh-page { transform: translateX(var(--w7psh-shift)) scale(var(--w7psh-shrink)); border-radius: 14px; transition: transform .7s cubic-bezier(.7, 0, .2, 1); }
.w7psh-open .w7psh-page::after { opacity: 1; }
@media (min-width: 760px) { .w7psh-page { grid-template-columns: 1fr 1fr; } }
.w7psh-eye { margin: 0; font-size: 13px; font-weight: 600; color: var(--w7psh-acc); }
.w7psh-title { margin: 12px 0 0; max-width: 16ch; font-size: clamp(28px, 4.4vw, 50px); font-weight: 700; line-height: 1.05; letter-spacing: -.03em; }
.w7psh-cta { display: inline-flex; align-items: center; min-height: 44px; margin-top: 22px; padding: 0 22px; border-radius: 8px; background: var(--w7psh-ink); color: #fff; font-size: 15px; font-weight: 600; text-decoration: none; }
.w7psh-pic { overflow: hidden; border-radius: 10px; aspect-ratio: 4 / 3; }
.w7psh-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 759px) { .w7psh-pic { max-height: 180px; } }
.w7psh-bar { z-index: 30; }
.w7psh-btn { background: var(--w7psh-card); }
.w7psh-menu { position: absolute; z-index: 1; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 84px clamp(16px, 4vw, 48px) 32px 46%; }
@media (max-width: 759px) { .w7psh-menu { padding-left: 34%; } .w7psh { --w7psh-shift: -74%; } }
.w7psh-nav a { display: inline-flex; align-items: center; min-height: 46px; font-size: clamp(24px, 3.8vw, 44px); font-weight: 700; letter-spacing: -.03em; }
.w7psh-nav li { transform: translateX(40px); opacity: 0; transition: transform .2s, opacity .2s; }
.w7psh-open .w7psh-nav li { transform: none; opacity: 1; transition: transform .6s cubic-bezier(.2, .8, .2, 1), opacity .4s; transition-duration: .4s; transition-delay: calc(.2s + var(--i) * .04s); }
.w7psh-nav a[aria-current="page"] { color: var(--w7psh-acc); }
@media (hover: hover) { .w7psh-nav a:hover { color: var(--w7psh-acc); } }
.w7psh-note { margin: 20px 0 0; font-size: 14px; line-height: 1.6; color: #3d4a58; opacity: 0; transition: opacity .2s; }
.w7psh-open .w7psh-note { opacity: 1; transition: opacity .3s .5s; }
.w7psh-note a { display: inline-flex; align-items: center; min-height: 40px; color: var(--w7psh-acc); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .w7psh-page, .w7psh-open .w7psh-page, .w7psh-page::after, .w7psh-nav li, .w7psh-note, .w7psh-icon i { transition: none !important; } }
</style>
<script>
(function () {
/* Change this: when the demo opens the menu by itself (ms). Set 0 on a real site. */
var AUTO_OPEN = 500;
var root = document.querySelector(".w7psh");
if (!root) return;
var btn = root.querySelector(".w7psh-btn"), word = root.querySelector(".w7psh-word"),
menu = root.querySelector(".w7psh-menu"), page = root.querySelector(".w7psh-page"), used = false;
function isOpen() { return root.classList.contains("w7psh-open"); }
function set(open, moveFocus) {
root.classList.toggle("w7psh-open", open);
btn.setAttribute("aria-expanded", open);
word.textContent = open ? "Close" : "Menu";
menu.inert = !open;
page.inert = open; /* on a real page, make main and footer inert instead */
if (moveFocus) (open ? menu.querySelector("a") : btn).focus();
}
function touch() { used = true; }
btn.addEventListener("click", function () { touch(); set(!isOpen(), true); });
root.addEventListener("pointerdown", touch);
root.addEventListener("focusin", touch);
root.addEventListener("keydown", function (e) {
if (!isOpen()) return;
if (e.key === "Escape") { e.preventDefault(); set(false, true); return; }
if (e.key !== "Tab") return;
/* focus trap: the button plus everything in the menu */
var f = [btn].concat([].slice.call(menu.querySelectorAll("a[href], button"))), i = f.indexOf(document.activeElement);
if (e.shiftKey && i <= 0) { e.preventDefault(); f[f.length - 1].focus(); }
else if (!e.shiftKey && i === f.length - 1) { e.preventDefault(); f[0].focus(); }
});
menu.addEventListener("click", function (e) {
var a = e.target.closest("a");
if (!a) return;
e.preventDefault(); /* remove on a real site so the link navigates */
if (a.closest("nav")) { menu.querySelectorAll("[aria-current]").forEach(function (x) { x.removeAttribute("aria-current"); }); a.setAttribute("aria-current", "page"); }
set(false, true);
});
if (AUTO_OPEN) setTimeout(function () { if (!used) set(true, false); }, AUTO_OPEN);
})();
</script>
With reduced motion: The page jumps straight to its shifted position with the menu visible, without sliding or scaling.
Running cost: One transform on the page layer plus a pre-drawn shadow whose opacity fades, so the shadow is never repainted.
- Set how far the page travels with `--w7psh-shift` and how small it gets with `--w7psh-shrink`; the phone value of the shift is in the small-screen rule.
- Keep the left padding of `.w7psh-menu` clear of the shifted page if you change those two values.
- Colour the ground under the page with `--w7psh-bg` and the links with `--w7psh-acc`.
Terracotta Curtain Menu That Drops With Rising Links
A terracotta curtain falls from the top of a trattoria page and settles over it, then five serif links climb out of their own slots one after another, with the address and a phone link fading in along the bottom edge. It suits a restaurant or cafe whose navigation is short enough to read in one glance.
<div class="w7cur">
<header class="w7cur-bar">
<p class="w7cur-brand">Osteria Calce</p>
<button class="w7cur-btn" type="button" aria-expanded="false" aria-controls="w7cur-menu">
<span class="w7cur-word">Menu</span><span class="w7cur-icon" aria-hidden="true"><i></i><i></i></span>
</button>
</header>
<div class="w7cur-page">
<div class="w7cur-copy">
<p class="w7cur-eye">Trattoria in the old bakery</p>
<h2 class="w7cur-title">Pasta rolled by hand every morning.</h2>
<p class="w7cur-text">Forty seats, one wood oven and a short list that follows the market. Lunch from noon, dinner until the last plate.</p>
<a class="w7cur-cta" href="#">Book a table</a>
</div>
<div class="w7cur-pic"><img src="https://images.pexels.com/photos/3184191/pexels-photo-3184191.jpeg?auto=compress&cs=tinysrgb&w=1200" alt="A long wooden table seen from above, set with plates of pasta, bread and salads" width="1200" height="801" loading="lazy"></div>
</div>
<div class="w7cur-menu" id="w7cur-menu" inert>
<nav class="w7cur-nav" aria-label="Main">
<ul>
<li style="--i:0"><a href="#" aria-current="page"><span>Home</span></a></li>
<li style="--i:1"><a href="#"><span>Dinner menu</span></a></li>
<li style="--i:2"><a href="#"><span>Wine list</span></a></li>
<li style="--i:3"><a href="#"><span>Private room</span></a></li>
<li style="--i:4"><a href="#"><span>Find us</span></a></li>
</ul>
</nav>
<div class="w7cur-side">
<p>Via del Forno 14<br>Open Tuesday to Sunday</p>
<p><a href="#">Call the restaurant</a></p>
</div>
</div>
</div>
<style>
/* Change these: page colour, curtain colour, text on the curtain, accent, curtain speed. */
.w7cur { --w7cur-paper: #f4ece2; --w7cur-curtain: #9a4426; --w7cur-cream: #fbf3ea; --w7cur-ink: #2b1d16; --w7cur-speed: .6s; }
.w7cur { position: relative; height: 600px; overflow: hidden; background: var(--w7cur-paper); color: var(--w7cur-ink); font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.w7cur *, .w7cur *::before, .w7cur *::after { box-sizing: border-box; }
.w7cur-bar { position: absolute; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px clamp(16px, 4vw, 48px); }
.w7cur-brand { margin: 0; font-family: ui-serif, Georgia, "Times New Roman", serif; font-size: 20px; letter-spacing: .01em; }
.w7cur-btn { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 18px; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.w7cur-icon { position: relative; width: 18px; height: 10px; }
.w7cur-icon i { position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform .35s ease; }
.w7cur-icon i:first-child { top: 0; } .w7cur-icon i:last-child { bottom: 0; }
.w7cur-open .w7cur-icon i:first-child { transform: translateY(4px) rotate(45deg); }
.w7cur-open .w7cur-icon i:last-child { transform: translateY(-4px) rotate(-45deg); }
.w7cur-open .w7cur-bar { color: var(--w7cur-cream); }
.w7cur a:focus-visible, .w7cur-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.w7cur-page { display: grid; gap: 24px; height: 100%; padding: 84px clamp(16px, 4vw, 48px) 28px; align-content: center; }
.w7cur-eye { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: #8a3a1f; }
.w7cur-title { margin: 12px 0 0; max-width: 14ch; font: 400 clamp(32px, 5vw, 56px)/1.05 ui-serif, Georgia, "Times New Roman", serif; letter-spacing: -.01em; }
.w7cur-text { margin: 16px 0 0; max-width: 34ch; font-size: 16px; line-height: 1.6; color: #5b4537; }
.w7cur-cta { display: inline-flex; align-items: center; min-height: 44px; margin-top: 22px; padding: 0 22px; border-radius: 999px; background: var(--w7cur-curtain); color: var(--w7cur-cream); font-size: 15px; font-weight: 600; text-decoration: none; }
.w7cur-pic { overflow: hidden; border-radius: 6px; aspect-ratio: 16 / 9; box-shadow: 0 24px 50px -28px rgba(60, 30, 15, .55); }
.w7cur-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 760px) { .w7cur-page { grid-template-columns: 1fr 1.05fr; align-items: center; gap: 48px; } .w7cur-pic { aspect-ratio: 4 / 5; max-height: 440px; } }
@media (max-width: 759px) { .w7cur-text { display: none; } .w7cur-pic { max-height: 170px; } }
/* The curtain: a full-size layer that drops from above with transform only. */
.w7cur-menu { position: absolute; z-index: 20; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 92px clamp(16px, 4vw, 48px) 32px; background: var(--w7cur-curtain); color: var(--w7cur-cream);
visibility: hidden; transform: translateY(-100%); transition: transform calc(var(--w7cur-speed) * .8) cubic-bezier(.7, 0, .3, 1), visibility 0s calc(var(--w7cur-speed) * .8); }
.w7cur-menu::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 10px; background: linear-gradient(rgba(0, 0, 0, .18), transparent); transform: translateY(100%); }
.w7cur-open .w7cur-menu { visibility: visible; transform: none; transition: transform var(--w7cur-speed) cubic-bezier(.7, 0, .2, 1), visibility 0s; }
.w7cur-nav ul { margin: 0; padding: 0; list-style: none; }
.w7cur-nav a { display: block; overflow: hidden; padding: 2px 4px; margin-left: -4px; color: inherit; text-decoration: none; font: 400 clamp(34px, 6.4vw, 64px)/1.12 ui-serif, Georgia, "Times New Roman", serif; letter-spacing: -.01em; }
.w7cur-nav a span { display: inline-block; transform: translateY(110%); transition: transform .25s ease-in; }
.w7cur-open .w7cur-nav a span { transform: none; transition: transform .45s cubic-bezier(.2, .8, .2, 1) calc(var(--w7cur-speed) * .4 + var(--i) * .04s); }
.w7cur-nav a[aria-current="page"] span::before { content: ""; display: inline-block; width: .3em; height: .3em; margin: 0 .3em .18em 0; border-radius: 50%; background: #f0b892; }
@media (hover: hover) { .w7cur-nav a:hover span { font-style: italic; } }
.w7cur-side { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; border-top: 1px solid rgba(251, 243, 234, .35); padding-top: 16px; font-size: 14px; line-height: 1.55; opacity: 0; transition: opacity .2s; }
.w7cur-open .w7cur-side { opacity: 1; transition: opacity .3s ease calc(var(--w7cur-speed) * .9); }
.w7cur-side p { margin: 0; } .w7cur-side a { display: inline-flex; align-items: center; min-height: 40px; color: inherit; }
@media (prefers-reduced-motion: reduce) {
.w7cur-menu, .w7cur-open .w7cur-menu, .w7cur-nav a span, .w7cur-side, .w7cur-icon i { transition: none !important; }
}
</style>
<script>
(function () {
/* Change this: when the demo opens the menu by itself (ms). Set 0 on a real site. */
var AUTO_OPEN = 500;
var root = document.querySelector(".w7cur");
if (!root) return;
var btn = root.querySelector(".w7cur-btn"), word = root.querySelector(".w7cur-word"),
menu = root.querySelector(".w7cur-menu"), page = root.querySelector(".w7cur-page"), used = false;
function isOpen() { return root.classList.contains("w7cur-open"); }
function set(open, moveFocus) {
root.classList.toggle("w7cur-open", open);
btn.setAttribute("aria-expanded", open);
word.textContent = open ? "Close" : "Menu";
menu.inert = !open;
page.inert = open; /* on a real page, make main and footer inert instead */
if (!moveFocus) return;
if (open) menu.querySelector("a").focus();
else btn.focus();
}
function touch() { used = true; }
btn.addEventListener("click", function () { touch(); set(!isOpen(), true); });
root.addEventListener("pointerdown", touch);
root.addEventListener("focusin", touch);
root.addEventListener("keydown", function (e) {
if (!isOpen()) return;
if (e.key === "Escape") { e.preventDefault(); set(false, true); return; }
if (e.key !== "Tab") return;
/* focus trap: the button plus everything in the menu */
var f = [btn].concat([].slice.call(menu.querySelectorAll("a[href], button"))), i = f.indexOf(document.activeElement);
if (e.shiftKey && i <= 0) { e.preventDefault(); f[f.length - 1].focus(); }
else if (!e.shiftKey && i === f.length - 1) { e.preventDefault(); f[0].focus(); }
});
menu.addEventListener("click", function (e) {
var a = e.target.closest("a");
if (!a) return;
e.preventDefault(); /* remove on a real site so the link navigates */
if (a.closest("nav")) { menu.querySelectorAll("[aria-current]").forEach(function (x) { x.removeAttribute("aria-current"); }); a.setAttribute("aria-current", "page"); }
set(false, true);
});
if (AUTO_OPEN) setTimeout(function () { if (!used) set(true, false); }, AUTO_OPEN);
})();
</script>
With reduced motion: The curtain appears in place at once with every link already showing, and closes the same way.
Running cost: Two CSS transitions on layers that already exist; the script only flips a class and runs nothing per frame.
- Change `--w7cur-curtain` and `--w7cur-cream` for the curtain colour and the text on it.
- Slow or speed the whole reveal with `--w7cur-speed`; the link stagger is the `.04s` step in the `.w7cur-open .w7cur-nav a span` rule.
- Set `AUTO_OPEN` to 0 so the menu stays shut until someone presses the button.
Performance notes
The overlay is always in the page but hidden with visibility and transform, so opening it only animates layers that already exist. Links rise with a staggered transition delay set in CSS; no script runs per frame.
Opening the menu stops the page behind from scrolling by toggling a class on the root, and the inert attribute, which MDN lists in every current browser, takes the page out of the tab order and the accessibility tree until the menu closes.
Questions
How do I make a full-screen menu in CSS?
Position an overlay with position: fixed and inset: 0, hide it with visibility: hidden and a transform, then show it when a class or aria-expanded state changes on the button. Inside a section or a preview frame, use position: absolute in a relative container instead.
How do I trap focus in a menu overlay?
When the menu opens, move focus to its first link, listen for Tab on the overlay and wrap from the last focusable element to the first and back, and set inert on the rest of the page. When it closes, return focus to the menu button.
Should a full-screen menu close on Escape?
Yes. Escape should close it and return focus to the button that opened it, just like a dialog. Each menu here also closes when a link is chosen.
Is a dialog element a good base for a full-screen menu?
It can be. A dialog opened with showModal() makes the rest of the page inert and closes on Escape by itself, and MDN lists it in all current browsers. You still style the open animation and return focus where you want it.
Also in the gallery: CSS Hamburger Menu Collection with 12 Animated Icons and an Accessible Mobile Nav, Responsive React Navbar with Mega Menu, Animated Hamburger and Sticky Shrink on Scroll.
More collections: Page Transitions With the View Transitions API, Big-Type Footer Designs, CSS Hover Effects and Magnetic Buttons. All navbars. 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