Hero with device panel
Floating top bar (live mini dial, product name with a muted suffix, glossy buy pill with the price) that gains a frosted capsule on scroll, an announcement pill, a two-line headline with a muted second line, and a dark rounded stage drawn in SVG: a display on a desk at night showing the dial with glowing orange numerals, a swinging needle and beat dots, with a phone beside it.
Part of the style
Quiet Instrument
7 parts that belong together, with their tokens, type and rules.
https://kitbash.me/components/quiet-instrument/hero/figma.html
Use the Figma MCP server (https://mcp.figma.com/mcp). Download https://kitbash.me/components/quiet-instrument/hero/figma.html and pass that whole HTML document to the html_to_figma tool, so the part "Hero with device panel" 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
<header class="hero">
<span class="hero__sentinel" aria-hidden="true"></span>
<div class="hero__bar">
<a class="hero__brand" href="#" aria-label="Quiet Tempo, home">
<svg class="hero__mark" viewBox="0 0 72 72" aria-hidden="true" focusable="false">
<circle class="hero__mark-ticks" cx="36" cy="36" r="29" pathLength="120" />
<circle class="hero__mark-marks" cx="36" cy="36" r="29" pathLength="120" />
<line class="hero__mark-needle" x1="36" y1="45" x2="36" y2="9" />
<circle class="hero__mark-pivot" cx="36" cy="36" r="2.6" />
</svg>
<span class="hero__name">Quiet Tempo <span class="hero__name-soft">for Mac</span></span>
</a>
<a class="hero__buy" href="#">
<svg class="hero__buy-icon" viewBox="0 0 20 20" aria-hidden="true" focusable="false">
<path d="M10 2.5v9.5m0 0L6 8m4 4 4-4M3.5 14.5v1a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1" />
</svg>
<span>Buy<span class="hero__buy-more"> now</span> · $12</span>
</a>
</div>
<a class="hero__badge" href="#">
<span class="hero__badge-dot" aria-hidden="true"></span>
New in version 2: night glow
<svg class="hero__badge-arrow" viewBox="0 0 8 12" aria-hidden="true" focusable="false"><path d="m1.5 1.5 4.5 4.5-4.5 4.5" /></svg>
</a>
<h1 class="hero__title">
<span class="hero__title-line">Keep time, quietly.</span>
<span class="hero__title-line hero__title-line--soft">Tempo worth watching.</span>
</h1>
<div class="hero__stage">
<svg class="hero__scene" viewBox="0 0 1200 540" preserveAspectRatio="xMidYMid slice" role="img" aria-label="A dark room. A display on a desk shows a metronome dial with glowing orange numerals and a swinging needle. A phone beside it shows 72 beats per minute.">
<defs>
<linearGradient id="hero-wall" x1="0" y1="0" x2="0" y2="1">
<stop class="hero__stop-wall-top" offset="0" />
<stop class="hero__stop-wall-low" offset="1" />
</linearGradient>
<linearGradient id="hero-desk" x1="0" y1="0" x2="0" y2="1">
<stop class="hero__stop-desk-top" offset="0" />
<stop class="hero__stop-desk-low" offset="1" />
</linearGradient>
<linearGradient id="hero-metal" x1="0" y1="0" x2="1" y2="0">
<stop class="hero__stop-metal-edge" offset="0" />
<stop class="hero__stop-metal-lit" offset="0.5" />
<stop class="hero__stop-metal-edge" offset="1" />
</linearGradient>
<filter id="hero-haze" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="48" /></filter>
<filter id="hero-pool" x="-50%" y="-200%" width="200%" height="500%"><feGaussianBlur stdDeviation="16" /></filter>
<filter id="hero-glow" x="-20%" y="-20%" width="140%" height="140%">
<feGaussianBlur stdDeviation="7" result="halo" />
<feMerge><feMergeNode in="halo" /><feMergeNode in="SourceGraphic" /></feMerge>
</filter>
<g id="hero-marker"><rect x="255.5" y="28" width="9" height="36" rx="4.5" /></g>
</defs>
<rect class="hero__wall" width="1200" height="540" />
<ellipse class="hero__haze" cx="600" cy="190" rx="390" ry="230" filter="url(#hero-haze)" />
<rect class="hero__frame" x="108" y="48" width="184" height="236" rx="3" />
<rect class="hero__frame hero__frame--inner" x="134" y="74" width="132" height="184" rx="2" />
<rect class="hero__frame" x="936" y="62" width="168" height="124" rx="3" />
<rect class="hero__frame hero__frame--inner" x="956" y="82" width="128" height="84" rx="2" />
<rect class="hero__desk" y="416" width="1200" height="124" />
<rect class="hero__desk-edge" y="416" width="1200" height="1.5" />
<ellipse class="hero__pool" cx="600" cy="440" rx="330" ry="22" filter="url(#hero-pool)" />
<rect class="hero__book" x="236" y="402" width="150" height="16" rx="3" />
<rect class="hero__book hero__book--top" x="252" y="389" width="118" height="13" rx="3" />
<polygon class="hero__neck" points="577,334 623,334 631,414 569,414" />
<rect class="hero__foot" x="505" y="410" width="190" height="9" rx="4.5" />
<rect class="hero__bezel" x="380" y="34" width="440" height="300" rx="16" />
<rect class="hero__screen" x="389" y="43" width="422" height="282" rx="8" />
<svg x="465" y="49" width="270" height="270" viewBox="0 0 520 520">
<g filter="url(#hero-glow)">
<path class="hero__ticks" d="M75.4 368.3A214 214 0 1 1 444.6 368.3" pathLength="240.8" />
<g class="hero__markers">
<use href="#hero-marker" transform="rotate(-120 260 260)" />
<use href="#hero-marker" transform="rotate(-100 260 260)" />
<use href="#hero-marker" transform="rotate(-80 260 260)" />
<use href="#hero-marker" transform="rotate(-60 260 260)" />
<use href="#hero-marker" transform="rotate(-40 260 260)" />
<use href="#hero-marker" transform="rotate(-20 260 260)" />
<use href="#hero-marker" />
<use href="#hero-marker" transform="rotate(20 260 260)" />
<use href="#hero-marker" transform="rotate(40 260 260)" />
<use href="#hero-marker" transform="rotate(60 260 260)" />
<use href="#hero-marker" transform="rotate(80 260 260)" />
<use href="#hero-marker" transform="rotate(100 260 260)" />
<use href="#hero-marker" transform="rotate(120 260 260)" />
</g>
<g class="hero__numerals">
<text x="133.6" y="333">40</text>
<text x="116.2" y="234.6">60</text>
<text x="166.2" y="148.2">80</text>
<text x="260" y="114">100</text>
<text x="353.8" y="148.2">120</text>
<text x="403.8" y="234.6">140</text>
<text x="386.4" y="333">160</text>
</g>
<g class="hero__beats">
<circle class="hero__beat" style="--i: 0" cx="224" cy="352" r="6.5" />
<circle class="hero__beat" style="--i: 1" cx="248" cy="352" r="5" />
<circle class="hero__beat" style="--i: 2" cx="272" cy="352" r="5" />
<circle class="hero__beat" style="--i: 3" cx="296" cy="352" r="5" />
</g>
<text class="hero__bpm" x="260" y="404">72</text>
<text class="hero__tempo" x="260" y="448">ADAGIO</text>
</g>
<rect class="hero__hand" x="254.5" y="120" width="11" height="158" rx="5.5" transform="rotate(-56 260 260)" />
<rect class="hero__hand-inlay" x="257.5" y="128" width="5" height="92" rx="2.5" transform="rotate(-56 260 260)" />
<g class="hero__pendulum">
<line class="hero__needle" x1="260" y1="306" x2="260" y2="52" />
<rect class="hero__weight" x="250" y="126" width="20" height="28" rx="5" />
</g>
<circle class="hero__pivot" cx="260" cy="260" r="12" />
<circle class="hero__pivot-eye" cx="260" cy="260" r="4" />
</svg>
<rect class="hero__bezel" x="850" y="304" width="72" height="130" rx="14" />
<rect class="hero__screen" x="854" y="308" width="64" height="122" rx="10" />
<g filter="url(#hero-glow)">
<text class="hero__phone-bpm" x="886" y="364">72</text>
<text class="hero__phone-unit" x="886" y="384">BPM</text>
<circle class="hero__beat" style="--i: 0" cx="868" cy="408" r="3.6" />
<circle class="hero__beat" style="--i: 1" cx="880" cy="408" r="2.8" />
<circle class="hero__beat" style="--i: 2" cx="892" cy="408" r="2.8" />
<circle class="hero__beat" style="--i: 3" cx="904" cy="408" r="2.8" />
</g>
</svg>
</div>
</header>
<style>
.hero {
position: relative;
padding: calc(var(--bar-height) + var(--gutter) / 2 + clamp(1rem, 3vw, 3.5rem)) var(--edge) calc(var(--gutter) / 2);
text-align: center;
}
/* Marks the first few pixels of the page: once it leaves the top, the bar gets its capsule. */
.hero__sentinel {
position: absolute;
top: 0;
left: 0;
width: 1px;
height: var(--space-m);
}
.hero__bar {
position: fixed;
z-index: 50;
top: calc(var(--gutter) / 2);
left: 50%;
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-s);
width: min(100% - var(--gutter), var(--content-max) + var(--gutter));
height: var(--bar-height);
padding: 0 calc(var(--gutter) / 2);
translate: -50% 0;
}
.hero__bar::before {
content: "";
position: absolute;
inset: 0;
z-index: -1;
border-radius: var(--radius-pill);
background: color-mix(in srgb, var(--page) 78%, transparent);
box-shadow: var(--shadow-float), inset 0 0 0 1px color-mix(in srgb, var(--card) 70%, transparent);
-webkit-backdrop-filter: blur(1.25rem) saturate(1.4);
backdrop-filter: blur(1.25rem) saturate(1.4);
opacity: 0;
transition: opacity var(--time-slow) var(--ease-out);
}
.hero.is-scrolled .hero__bar::before {
opacity: 1;
}
.hero__brand {
display: flex;
align-items: center;
gap: clamp(0.625rem, 1.5vw, 1.375rem);
min-height: var(--tap);
color: var(--ink);
text-decoration: none;
}
.hero__mark {
flex: none;
width: clamp(2.75rem, 5vw, 4.5rem);
height: auto;
aspect-ratio: 1;
}
.hero__mark-ticks,
.hero__mark-marks {
fill: none;
stroke: var(--ink-soft);
stroke-width: 5;
stroke-dasharray: 0.5 2;
stroke-dashoffset: 0.25;
}
.hero__mark-marks {
stroke: var(--ink-faint);
stroke-width: 8;
stroke-dasharray: 1.2 8.8;
stroke-dashoffset: 0.6;
}
.hero__mark-needle {
stroke: var(--ink);
stroke-width: 1.8;
stroke-linecap: round;
transform-origin: 36px 36px;
animation: hero-swing var(--beat) var(--ease-swing) infinite alternate;
}
.hero__mark-pivot {
fill: var(--page);
stroke: var(--ink);
stroke-width: 1.4;
}
.hero__name {
font-size: clamp(1.125rem, 2.2vw, 2rem);
letter-spacing: -0.02em;
white-space: nowrap;
}
.hero__name-soft {
color: var(--ink-soft);
}
/* Glossy pill: a black body, a highlight from the top left, a graphite wash that fades in on hover. */
.hero__buy {
position: relative;
isolation: isolate;
display: inline-flex;
flex: none;
align-items: center;
gap: 0.5em;
min-height: clamp(2.75rem, 4.45vw, 4rem);
padding: 0 clamp(1.125rem, 1.75vw, 1.625rem);
overflow: hidden;
border-radius: var(--radius-pill);
background: var(--night);
box-shadow: var(--shadow-button), inset 0 1px 0 color-mix(in srgb, var(--on-dark) 30%, transparent), inset 0 -1px 0 color-mix(in srgb, var(--on-dark) 8%, transparent);
color: var(--on-dark);
font-size: clamp(1rem, 1.6vw, 1.5rem);
font-weight: 500;
letter-spacing: -0.01em;
text-decoration: none;
white-space: nowrap;
transition: transform var(--time) var(--ease-spring);
}
.hero__buy::before,
.hero__buy::after {
content: "";
position: absolute;
inset: 0;
z-index: -1;
}
.hero__buy::before {
background: linear-gradient(180deg, var(--graphite), var(--night));
opacity: 0;
transition: opacity var(--time) var(--ease-out);
}
.hero__buy::after {
background: radial-gradient(90% 120% at 12% -10%, color-mix(in srgb, var(--on-dark) 34%, transparent), transparent 62%);
}
.hero__buy:hover::before,
.hero__buy:focus-visible::before {
opacity: 1;
}
.hero__buy:active {
transform: scale(0.97);
}
.hero__buy:focus-visible,
.hero__brand:focus-visible,
.hero__badge:focus-visible {
outline: 2px solid var(--ink);
outline-offset: 4px;
}
.hero__buy-icon {
width: 1em;
height: 1em;
fill: none;
stroke: currentColor;
stroke-width: 1.8;
stroke-linecap: round;
stroke-linejoin: round;
}
.hero__badge {
display: inline-flex;
align-items: center;
gap: 0.625rem;
min-height: 3rem;
margin-bottom: clamp(1.25rem, 2.6vw, 2.5rem);
padding: 0 1rem;
border-radius: var(--radius-pill);
background: color-mix(in srgb, var(--mint-soft) 45%, var(--card));
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--aqua) 22%, var(--card)), 0 0.375rem 1rem -0.25rem color-mix(in srgb, var(--aqua) 30%, transparent);
color: var(--ink);
font-size: var(--text-l);
font-weight: 500;
letter-spacing: -0.01em;
text-decoration: none;
}
.hero__badge-dot {
width: 0.875rem;
height: 0.875rem;
border-radius: 50%;
background: radial-gradient(circle at 35% 30%, var(--mint), var(--aqua) 60%);
box-shadow: 0 0 0 0 color-mix(in srgb, var(--aqua) 50%, transparent);
animation: hero-ping calc(var(--beat) * 4) var(--ease-out) infinite;
}
.hero__badge-arrow {
width: 0.5rem;
height: 0.75rem;
fill: none;
stroke: var(--ink-faint);
stroke-width: 1.5;
stroke-linecap: round;
stroke-linejoin: round;
transition: transform var(--time) var(--ease-spring);
}
.hero__badge:hover .hero__badge-arrow {
transform: translateX(3px);
}
.hero__title {
margin: 0 0 clamp(1.75rem, 4.2vw, 5rem);
font-size: var(--head-l);
font-weight: 600;
line-height: 1.04;
letter-spacing: -0.04em;
}
.hero__title-line {
display: block;
padding-bottom: 0.08em;
background: linear-gradient(90deg, var(--ink) 20%, var(--graphite));
-webkit-background-clip: text;
background-clip: text;
color: transparent;
text-wrap: balance;
}
.hero__title-line--soft {
background: none;
color: var(--ink-soft);
}
.hero__stage {
overflow: hidden;
aspect-ratio: 1200 / 540;
border-radius: var(--radius-card);
background: var(--night);
}
.hero__scene {
display: block;
width: 100%;
height: 100%;
}
.hero__stop-wall-top {
stop-color: color-mix(in srgb, var(--graphite) 34%, var(--night));
}
.hero__stop-wall-low {
stop-color: color-mix(in srgb, var(--graphite) 12%, var(--night));
}
.hero__stop-desk-top {
stop-color: color-mix(in srgb, var(--graphite) 46%, var(--night));
}
.hero__stop-desk-low {
stop-color: var(--night);
}
.hero__stop-metal-edge {
stop-color: color-mix(in srgb, var(--chrome-dark) 22%, var(--night));
}
.hero__stop-metal-lit {
stop-color: color-mix(in srgb, var(--chrome-dark) 60%, var(--night));
}
.hero__wall {
fill: url(#hero-wall);
}
.hero__haze {
fill: var(--lume);
opacity: 0.2;
}
.hero__frame {
fill: color-mix(in srgb, var(--on-dark) 3%, transparent);
stroke: color-mix(in srgb, var(--on-dark) 9%, transparent);
stroke-width: 1.5;
}
.hero__frame--inner {
fill: color-mix(in srgb, var(--lume) 5%, transparent);
stroke-width: 1;
}
.hero__desk {
fill: url(#hero-desk);
}
.hero__desk-edge {
fill: color-mix(in srgb, var(--on-dark) 10%, transparent);
}
.hero__pool {
fill: var(--lume);
opacity: 0.3;
}
.hero__book {
fill: color-mix(in srgb, var(--graphite) 70%, var(--night));
stroke: color-mix(in srgb, var(--lume) 16%, transparent);
}
.hero__book--top {
fill: color-mix(in srgb, var(--graphite) 40%, var(--night));
}
.hero__neck,
.hero__foot {
fill: url(#hero-metal);
}
.hero__bezel {
fill: var(--night);
stroke: color-mix(in srgb, var(--on-dark) 16%, transparent);
stroke-width: 1.2;
}
.hero__screen {
fill: color-mix(in srgb, var(--lume) 3%, var(--night));
}
/* Everything that glows is one colour; the blur filter on the group makes the halo. */
.hero__ticks {
fill: none;
stroke: color-mix(in srgb, var(--lume) 70%, transparent);
stroke-width: 15;
stroke-dasharray: 0.9 3.1;
}
.hero__markers,
.hero__beat,
.hero__numerals,
.hero__bpm,
.hero__tempo,
.hero__phone-bpm,
.hero__phone-unit {
fill: var(--lume);
}
.hero__numerals,
.hero__bpm,
.hero__tempo,
.hero__phone-bpm,
.hero__phone-unit {
font-family: var(--font-dial);
text-anchor: middle;
dominant-baseline: central;
}
.hero__numerals {
font-size: 30px;
}
.hero__bpm {
font-size: 46px;
}
.hero__tempo {
font-size: 14px;
letter-spacing: var(--tracking-dial);
}
.hero__phone-bpm {
font-size: 24px;
}
.hero__phone-unit {
font-size: 7px;
letter-spacing: var(--tracking-dial);
}
.hero__beat {
animation: hero-beat calc(var(--beat) * 4) steps(1) infinite;
animation-delay: calc(var(--beat) * var(--i));
opacity: 0.22;
}
.hero__hand {
fill: color-mix(in srgb, var(--chrome-dark) 30%, var(--night));
stroke: color-mix(in srgb, var(--chrome-dark) 60%, var(--night));
stroke-width: 1.2;
}
.hero__hand-inlay {
fill: var(--lume);
}
.hero__pendulum {
transform-origin: 260px 260px;
animation: hero-swing var(--beat) var(--ease-swing) infinite alternate;
}
.hero__needle {
stroke: color-mix(in srgb, var(--lume) 55%, var(--chrome-light));
stroke-width: 3;
stroke-linecap: round;
}
.hero__weight {
fill: color-mix(in srgb, var(--chrome-dark) 36%, var(--night));
stroke: color-mix(in srgb, var(--lume) 70%, var(--chrome-light));
stroke-width: 1.5;
}
.hero__pivot {
fill: color-mix(in srgb, var(--chrome-dark) 45%, var(--night));
stroke: color-mix(in srgb, var(--chrome-dark) 80%, var(--night));
stroke-width: 1.5;
}
.hero__pivot-eye {
fill: var(--night);
}
@keyframes hero-swing {
from {
transform: rotate(-26deg);
}
to {
transform: rotate(26deg);
}
}
@keyframes hero-beat {
0% {
opacity: 1;
}
25%,
100% {
opacity: 0.22;
}
}
@keyframes hero-ping {
0%,
60% {
box-shadow: 0 0 0 0 color-mix(in srgb, var(--aqua) 45%, transparent);
}
100% {
box-shadow: 0 0 0 0.625rem transparent;
}
}
@media (max-width: 40rem) {
.hero__name-soft,
.hero__buy-more {
display: none;
}
.hero__badge {
font-size: var(--text-s);
}
.hero__stage {
aspect-ratio: 5 / 4;
border-radius: var(--radius-window);
}
}
@media (prefers-reduced-motion: reduce) {
.hero__mark-needle,
.hero__pendulum {
animation: none;
transform: rotate(18deg);
}
.hero__beat,
.hero__badge-dot {
animation: none;
}
.hero__beat:first-child {
opacity: 1;
}
.hero__bar::before,
.hero__buy,
.hero__buy::before,
.hero__badge-arrow {
transition-duration: 0s;
}
}
</style>
<script>
(() => {
const SCROLLED = "is-scrolled";
const floatBarOnceScrolled = (root) => {
const sentinel = root.querySelector(".hero__sentinel");
const update = ([entry]) => root.classList.toggle(SCROLLED, !entry.isIntersecting);
new IntersectionObserver(update).observe(sentinel);
};
document.querySelectorAll(".hero").forEach(floatBarOnceScrolled);
})();
</script>