Swinging badge hero
A light centred headline surrounded by gradient badges and a QR tag hanging on straps that sway, with a phone peeking from the bottom edge.
Part of the style
Swinging Lanyard Badges
7 parts that belong together, with their tokens, type and rules.
https://kitbash.me/components/swinging-lanyard-badges/hero/figma.html?palette=a00a69e670901cbb
Use the Figma MCP server (https://mcp.figma.com/mcp). Download https://kitbash.me/components/swinging-lanyard-badges/hero/figma.html?palette=a00a69e670901cbb and pass that whole HTML document to the html_to_figma tool, so the part "Swinging badge hero" 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 {
--ground: #030303;
--surface: #010101;
--ink: #c5c4c9;
--ink-soft: #79797b;
--ink-faint: #373635;
--night: #fbfaff;
--night-raised: #c1c0c5;
--frame-edge: #a1a0a4;
--on-night: #010101;
--on-night-soft: rgba(1, 1, 1, 0.6);
--blush: #0a0a0a;
--peach: #050505;
--glass: rgba(3, 3, 3, 0.72);
--frost: rgba(1, 1, 1, 0.55);
--line-soft: rgba(197, 196, 201, 0.1);
--line-night: rgba(1, 1, 1, 0.16);
--strap: #3f498f;
--mesh-pink: #3c40bb;
--mesh-rose: #404768;
--strap-dark: #353e80;
--link: #454b7a;
--mesh-violet: #545b93;
--mesh-blue: #474d7c;
--sky: #202128;
--mesh-peach: #3f498f;
--mesh-cyan: #454b7a;
--mesh-teal: #44496c;
--mesh-green: #3f498f;
--aurora-green: #3638ab;
--aurora-pink: #454b7a;
}
</style>
<section class="hero">
<div class="hero__float" aria-hidden="true">
<div class="hero__hang" style="--x: 5%; --y: 40px; --w: 1; --rot: -7deg; --dur: 5.2s; --delay: -1.1s;">
<span class="hero__strap"></span><span class="hero__clip"></span>
<div class="hero__card hero__card--blue"><span class="hero__strip"><b class="hero__who">Theo Lindqvist</b><i class="hero__role">Lighting</i></span></div>
</div>
<div class="hero__hang" style="--x: 17%; --y: 0px; --w: 0.62; --rot: 5deg; --dur: 4.4s; --delay: -2.4s;">
<span class="hero__strap"></span><span class="hero__clip"></span>
<div class="hero__card hero__card--green"></div>
</div>
<div class="hero__hang hero__hang--far" style="--x: 13%; --y: 300px; --w: 0.85; --rot: 9deg; --dur: 6.1s; --delay: -0.4s;">
<span class="hero__strap"></span><span class="hero__clip"></span>
<div class="hero__card hero__card--violet"><span class="hero__strip"><b class="hero__who">Jun Park</b><i class="hero__role">Crew</i></span></div>
</div>
<div class="hero__hang hero__hang--far" style="--x: -2%; --y: 420px; --w: 0.8; --rot: -4deg; --dur: 5.6s; --delay: -3s;">
<span class="hero__strap"></span><span class="hero__clip"></span>
<div class="hero__card hero__card--photo"><img class="hero__photo" src="assets/coastal-island.jpg" alt="" width="800" height="450"></div>
</div>
<div class="hero__hang" style="--x: 83%; --y: 24px; --w: 1.05; --rot: 8deg; --dur: 4.8s; --delay: -0.7s;">
<span class="hero__strap"></span><span class="hero__clip"></span>
<div class="hero__card hero__card--pink"><span class="hero__strip"><b class="hero__who">Ruth Amari</b><i class="hero__role">Artist</i></span></div>
</div>
<div class="hero__hang hero__hang--far" style="--x: 72%; --y: 6px; --w: 0.5; --rot: -6deg; --dur: 4.1s; --delay: -1.8s;">
<span class="hero__strap"></span><span class="hero__clip"></span>
<div class="hero__card hero__card--blank"></div>
</div>
<div class="hero__hang" style="--x: 77%; --y: 330px; --w: 0.72; --rot: -5deg; --dur: 5.9s; --delay: -2.2s;">
<span class="hero__strap"></span><span class="hero__clip"></span>
<div class="hero__card hero__card--qr">
<svg class="hero__qr" viewBox="0 0 21 21" shape-rendering="crispEdges">
<path fill="currentColor" d="M0 0h7v7H0zM1 1v5h5V1zM2 2h3v3H2zM14 0h7v7h-7zM15 1v5h5V1zM16 2h3v3h-3zM0 14h7v7H0zM1 15v5h5v-5zM2 16h3v3H2zM8 0h1v2H8zM10 1h2v1h-2zM9 3h2v2H9zM12 4h1v3h-1zM8 6h2v2H8zM0 8h2v1H0zM3 8h3v1H3zM7 9h3v1H7zM11 8h2v2h-2zM14 8h1v2h-1zM16 8h3v1h-3zM20 9h1v3h-1zM1 10h2v2H1zM4 11h3v1H4zM9 11h2v3H9zM12 11h3v1h-3zM16 10h2v3h-2zM8 13h1v1H8zM12 13h2v2h-2zM15 14h3v1h-3zM19 13h1v2h-1zM8 15h3v1H8zM10 17h2v2h-2zM8 19h1v2H8zM13 16h2v3h-2zM16 16h1v1h-1zM18 16h3v2h-3zM16 18h2v3h-2zM19 19h2v2h-2zM12 20h3v1h-3z"/>
</svg>
<span class="hero__qr-label">lumo.pass/ruth</span>
</div>
</div>
<div class="hero__hang hero__hang--far" style="--x: 92%; --y: 460px; --w: 0.7; --rot: 6deg; --dur: 6.4s; --delay: -4s;">
<span class="hero__strap"></span><span class="hero__clip"></span>
<div class="hero__card hero__card--peach"></div>
</div>
</div>
<div class="hero__copy">
<p class="hero__eyebrow">Festival pass app for iPhone</p>
<h1 class="hero__title">Carry your pass.</h1>
<p class="hero__lead">Lumo turns your phone into the pass on your lanyard, with your name, your role and the doors it opens, the right way up for whoever checks it.</p>
<a class="hero__get" href="#">
<svg class="hero__get-icon" viewBox="0 0 16 24" aria-hidden="true"><rect x="1.5" y="1.5" width="13" height="21" rx="3.5" fill="none" stroke="currentColor" stroke-width="1.6"/><rect x="5.5" y="3.6" width="5" height="1.6" rx="0.8" fill="currentColor"/></svg>
<span class="hero__get-text"><small class="hero__get-small">Free for iPhone</small>Get Lumo</span>
</a>
</div>
<div class="hero__phone" aria-hidden="true">
<div class="hero__screen">
<span class="hero__time">9:41</span>
<span class="hero__island"></span>
<span class="hero__chip">Swing</span>
</div>
</div>
</section>
<style>
.hero {
position: relative;
overflow: hidden;
display: grid;
place-items: center;
min-height: clamp(640px, 54vw, 780px);
padding: var(--space-xl) var(--edge) 170px;
background: var(--ground);
isolation: isolate;
}
.hero__float {
position: absolute;
inset: 0;
z-index: -1;
pointer-events: none;
}
.hero__hang {
--card: clamp(72px, 10.5vw, 150px);
position: absolute;
top: var(--y);
left: var(--x);
display: grid;
justify-items: center;
width: calc(var(--card) * var(--w));
transform-origin: 50% 0;
rotate: var(--rot);
animation: hero-sway var(--dur) ease-in-out var(--delay) infinite alternate;
pointer-events: auto;
}
@keyframes hero-sway {
from { transform: rotate(-3deg); }
to { transform: rotate(3deg); }
}
.hero__strap {
width: 26%;
height: calc(46px * var(--w));
background: linear-gradient(to bottom, transparent, var(--strap) 45%);
border-inline: 1px solid rgba(0, 0, 0, 0.06);
}
.hero__clip {
width: 34%;
height: 7px;
margin-bottom: -3px;
border-radius: 3px;
background: var(--strap-dark);
position: relative;
z-index: 1;
}
.hero__card {
position: relative;
width: 100%;
aspect-ratio: 5 / 7;
overflow: hidden;
border-radius: calc(var(--radius-card) * 0.55 * var(--w));
box-shadow: var(--shadow-card);
transition: transform var(--slow) var(--ease);
}
.hero__card::before {
content: "";
position: absolute;
top: 6%;
left: 50%;
width: 22%;
height: 3.5%;
translate: -50% 0;
border-radius: var(--pill);
background: rgba(255, 255, 255, 0.7);
z-index: 1;
}
.hero__hang:hover .hero__card { transform: rotate(-4deg) scale(1.04); }
.hero__card--blue {
background:
radial-gradient(circle at 25% 30%, var(--mesh-cyan), transparent 42%),
radial-gradient(ellipse at 75% 55%, var(--mesh-violet), transparent 55%),
radial-gradient(circle at 30% 85%, var(--mesh-cyan), transparent 40%),
var(--mesh-blue);
}
.hero__card--green {
background:
radial-gradient(circle at 30% 30%, var(--mesh-green), transparent 50%),
radial-gradient(circle at 75% 75%, var(--mesh-teal), transparent 55%),
var(--mesh-green);
}
.hero__card--violet {
background:
radial-gradient(circle at 70% 25%, var(--mesh-pink), transparent 40%),
radial-gradient(ellipse at 25% 60%, var(--mesh-blue), transparent 55%),
var(--mesh-violet);
}
.hero__card--pink {
background:
radial-gradient(circle at 30% 25%, var(--mesh-peach), transparent 42%),
radial-gradient(ellipse at 70% 55%, var(--mesh-pink), transparent 55%),
radial-gradient(circle at 25% 75%, var(--mesh-violet), transparent 35%),
var(--mesh-rose);
}
.hero__card--peach {
background:
radial-gradient(circle at 40% 35%, var(--mesh-peach), transparent 55%),
radial-gradient(circle at 70% 80%, var(--mesh-pink), transparent 50%),
var(--mesh-rose);
}
.hero__card--blank,
.hero__card--qr { background: var(--surface); }
.hero__card--blank::before,
.hero__card--qr::before { background: var(--ground); }
.hero__photo {
width: 100%;
height: 100%;
object-fit: cover;
object-position: 45% 50%;
}
.hero__strip {
position: absolute;
inset: auto 0 0;
display: grid;
padding: 8% 9% 10%;
background: var(--frost);
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
color: var(--ink);
line-height: 1.15;
}
.hero__who {
font-size: clamp(10px, 1.1vw, 15px);
font-weight: var(--weight-medium);
letter-spacing: -0.01em;
}
.hero__role {
font-size: clamp(7px, 0.7vw, 10px);
font-style: normal;
color: var(--ink-soft);
}
.hero__card--qr {
display: grid;
align-content: center;
justify-items: center;
gap: 8%;
padding: 14%;
color: var(--ink);
}
.hero__qr { width: 100%; }
.hero__qr-label {
font-size: clamp(6px, 0.6vw, 9px);
color: var(--ink-soft);
}
.hero__copy {
position: relative;
display: grid;
justify-items: center;
max-width: 36rem;
text-align: center;
}
.hero__eyebrow {
margin: 0 0 var(--space-m);
color: var(--ink-soft);
font-size: var(--text-s);
}
.hero__title {
margin: 0;
font-family: var(--font-display);
font-size: var(--display-xl);
font-weight: var(--weight-light);
line-height: 1.05;
letter-spacing: var(--track-display);
text-wrap: balance;
}
.hero__lead {
max-width: var(--measure);
margin: var(--space-l) 0 var(--space-xl);
color: var(--ink-soft);
font-size: var(--text);
line-height: 1.62;
text-wrap: balance;
}
.hero__get {
display: inline-flex;
align-items: center;
gap: 10px;
min-height: 52px;
padding: 6px 20px 6px 16px;
border: var(--line) solid var(--ink-faint);
border-radius: calc(var(--radius-s) * 1.5);
background: var(--ink);
color: var(--on-night);
font-size: var(--text-l);
font-weight: var(--weight-medium);
line-height: 1.05;
text-decoration: none;
transition: transform var(--quick) var(--ease), opacity var(--quick) var(--ease);
}
.hero__get:hover { opacity: 0.86; }
.hero__get:active { transform: scale(0.97); }
.hero__get:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
.hero__get-icon { width: 16px; height: 24px; }
.hero__get-text { display: grid; text-align: left; }
.hero__get-small {
font-size: 11px;
font-weight: 400;
opacity: 0.8;
}
.hero__phone {
position: absolute;
bottom: -150px;
left: 50%;
translate: -50% 0;
width: clamp(150px, 15vw, 200px);
aspect-ratio: 9 / 19;
padding: 6px;
border-radius: 36px;
background: var(--night-raised);
box-shadow: var(--shadow-card), inset 0 0 0 2px var(--frame-edge);
}
.hero__screen {
position: relative;
height: 100%;
border-radius: 30px;
background:
radial-gradient(circle at 30% 70%, var(--mesh-peach), transparent 45%),
radial-gradient(ellipse at 70% 40%, var(--mesh-pink), transparent 60%),
var(--mesh-rose);
}
.hero__time {
position: absolute;
top: 14px;
left: 20px;
font-size: 11px;
font-weight: 600;
}
.hero__island {
position: absolute;
top: 10px;
left: 50%;
width: 34%;
height: 18px;
translate: -50% 0;
border-radius: var(--pill);
background: var(--night);
}
.hero__chip {
position: absolute;
top: 48px;
right: 12px;
padding: 3px 9px;
border-radius: var(--pill);
background: var(--night);
color: var(--on-night);
font-size: 9px;
}
@media (max-width: 40rem) {
.hero { padding-top: 120px; }
.hero__hang { --card: 86px; }
.hero__hang--far { display: none; }
.hero__hang[style*="--x: 5%"] { left: -30px; top: 520px; }
.hero__hang[style*="--x: 17%"] { left: 40px; top: 0; }
.hero__hang[style*="--x: 83%"] { left: auto; right: -30px; top: 10px; }
.hero__hang[style*="--x: 77%"] { left: auto; right: -14px; top: 470px; }
}
@media (prefers-reduced-motion: reduce) {
.hero__hang { animation: none; }
}
</style>