Corner nav
Three tiny caps labels in the corners: name, version, index and lab. Each link scrambles on hover.
Part of the style
Teal Haze Lab
6 parts that belong together, with their tokens, type and rules.
https://kitbash.me/components/teal-haze-lab/nav/figma.html?palette=740e7e99ac8487c5
Use the Figma MCP server (https://mcp.figma.com/mcp). Download https://kitbash.me/components/teal-haze-lab/nav/figma.html?palette=740e7e99ac8487c5 and pass that whole HTML document to the html_to_figma tool, so the part "Corner nav" 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 */
:root {
--field: #f6f6f4;
--ink: #32343a;
--night: #2e3035;
--night-ink: #fffffd;
--screen: #5b5d63;
--screen-ink: #fffffd;
--paper: #fffffd;
--ray: #fed0e1;
--glow: #b996a3;
--field-deep: #4d8053;
--field-bright: #84de8e;
--lilac: #bc91a1;
--pink: #7db181;
}
</style>
<header class="nav">
<a class="nav__link nav__brand" href="#" data-scramble>Halloway Signal</a>
<span class="nav__version">Workbook v07</span>
<nav class="nav__menu" aria-label="Main">
<a class="nav__link" href="#" data-scramble>__Index</a>
<a class="nav__link" href="#" data-scramble>The Lab</a>
</nav>
</header>
<style>
.nav {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr);
align-items: start;
gap: var(--gap);
padding: calc(var(--edge) - 13px) var(--edge) 0;
position: relative;
z-index: 2;
color: var(--ink);
}
.nav__link {
display: inline-flex;
align-items: center;
min-height: var(--tap);
text-decoration: none;
white-space: nowrap;
}
.nav__brand {
justify-self: start;
}
.nav__version {
display: flex;
align-items: center;
justify-content: flex-end;
min-height: var(--tap);
}
.nav__menu {
display: flex;
justify-content: flex-end;
gap: var(--space-l);
}
.nav__link:focus-visible {
outline: var(--rule) solid var(--ink);
outline-offset: 2px;
}
@media (max-width: 40rem) {
.nav {
grid-template-columns: minmax(0, 1fr) auto;
}
.nav__version {
display: none;
}
.nav__menu {
gap: var(--space-m);
}
}
</style>
<script>
(() => {
const glyphs = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_/#%';
const still = matchMedia('(prefers-reduced-motion: reduce)');
const stepOf = (element) => parseFloat(getComputedStyle(element).getPropertyValue('--scramble-step')) || 34;
function scramble(link) {
const text = link.dataset.text;
let step = 0;
clearInterval(link.scrambleTimer);
link.scrambleTimer = setInterval(() => {
const settled = Math.floor(step / 1.6);
link.textContent = [...text].map((letter, index) =>
index < settled || letter === ' ' ? letter : glyphs[Math.floor(Math.random() * glyphs.length)]
).join('');
step += 1;
if (settled >= text.length) {
clearInterval(link.scrambleTimer);
link.textContent = text;
}
}, stepOf(link));
}
document.querySelectorAll('.nav').forEach((nav) => {
nav.querySelectorAll('[data-scramble]').forEach((link) => {
link.dataset.text = link.textContent;
link.setAttribute('aria-label', link.textContent);
const start = () => { if (!still.matches) scramble(link); };
link.addEventListener('pointerenter', start);
link.addEventListener('focus', start);
});
});
})();
</script>