Dot-mosaic hero
A huge condensed headline drawn as a canvas of navy and orange square dots that bulge away from the pointer, with a selected badge above, a dashed selected subline and two buttons.
Part of the style
Cloud Sky Artboard
7 parts that belong together, with their tokens, type and rules.
https://kitbash.me/components/cloud-sky-artboard/hero/figma.html?type=backroom-tunnel
Use the Figma MCP server (https://mcp.figma.com/mcp). Download https://kitbash.me/components/cloud-sky-artboard/hero/figma.html?type=backroom-tunnel and pass that whole HTML document to the html_to_figma tool, so the part "Dot-mosaic 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 */
@import url("https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@800;900&family=League+Gothic:wdth@75..100&family=Dosis:wght@400;600&family=Archivo:wdth,wght@125,900&display=swap");
:root {
--font-display: "League Gothic", "Arial Narrow", sans-serif;
--font-body: "Dosis", "Trebuchet MS", sans-serif;
--font-mono: "Space Mono", ui-monospace, monospace;
--font-hand: "League Gothic", "Arial Narrow", sans-serif;
}
</style>
<section class="hero">
<div class="hero__stage">
<p class="hero__badge">
<span class="hero__handle hero__handle--tl"></span><span class="hero__handle hero__handle--tr"></span>
<span class="hero__handle hero__handle--bl"></span><span class="hero__handle hero__handle--br"></span>
Built for 40+ <span class="hero__badge-chip" aria-hidden="true">✦</span> <strong class="hero__badge-hot">independent</strong> makers
</p>
<h1 class="hero__title">
<span class="hero__line">Hard to</span>
<span class="hero__line hero__line--hot">scroll past</span>
</h1>
<canvas class="hero__dots" aria-hidden="true"></canvas>
<p class="hero__eyebrow">we don't do beige ✦</p>
<div class="hero__select">
<span class="hero__tagname">drag me, go on</span>
<span class="hero__handle hero__handle--tl"></span><span class="hero__handle hero__handle--tr"></span>
<span class="hero__handle hero__handle--bl"></span><span class="hero__handle hero__handle--br"></span>
<p class="hero__lead">Most websites blur into one long scroll. The ones we draw make people stop, squint and send the link to a friend.</p>
</div>
<div class="hero__actions">
<a class="hero__btn hero__btn--hot" href="#">Book a call <span aria-hidden="true">→</span></a>
<a class="hero__btn" href="#">See the work</a>
</div>
</div>
<div class="hero__corner hero__corner--left"><b>Two desks, one sky</b><span>remote since day one</span></div>
<div class="hero__corner hero__corner--right"><b>Booking spring 2027</b><span>any timezone, really</span></div>
<div class="hero__cursor" aria-hidden="true">
<svg viewBox="0 0 16 16" width="16" height="16"><path d="M2 1.5 14 7l-5.4 1.6L6.5 14Z" fill="currentColor" stroke="#fff" stroke-width="1.2" stroke-linejoin="round"/></svg>
<span class="hero__cursor-tag">You</span>
</div>
</section>
<style>
.hero {
position: relative;
overflow: hidden;
padding: clamp(40px, 5vw, 72px) var(--edge) clamp(96px, 9vw, 120px);
text-align: center;
}
.hero__stage {
position: relative;
display: grid;
justify-items: center;
max-width: 1080px;
margin: 0 auto;
}
.hero__handle {
position: absolute;
width: var(--handle);
height: var(--handle);
background: var(--paper);
border: var(--line-strong) solid var(--select);
border-radius: var(--radius-s);
}
.hero__handle--tl { top: -4px; left: -4px; }
.hero__handle--tr { top: -4px; right: -4px; }
.hero__handle--bl { bottom: -4px; left: -4px; }
.hero__handle--br { bottom: -4px; right: -4px; }
.hero__badge {
position: relative;
display: inline-flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
gap: var(--space-xs);
margin: 0 0 clamp(16px, 2vw, 28px);
padding: 12px 20px;
background: var(--paper-glass);
border: var(--line) solid var(--select);
backdrop-filter: blur(6px);
font-size: var(--text-m);
font-weight: 500;
}
.hero__badge-chip {
display: inline-grid;
place-items: center;
width: 22px;
height: 22px;
border-radius: 5px;
background: var(--flame);
color: var(--paper);
font-size: 12px;
}
.hero__badge-hot { color: var(--flame); font-weight: 600; }
.hero__title {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
font-family: var(--font-display);
color: var(--ink);
}
.hero__line--hot { color: var(--flame); }
.hero__dots {
width: min(100%, 980px);
aspect-ratio: 980 / 380;
touch-action: pan-y;
}
.hero__eyebrow {
margin: clamp(18px, 2.4vw, 32px) 0 16px;
font: 400 var(--mono-s) / 1.4 var(--font-mono);
letter-spacing: 0.16em;
text-transform: uppercase;
color: var(--flame);
}
.hero__select {
position: relative;
max-width: 540px;
padding: 10px 18px;
border: var(--line) dashed var(--select);
}
.hero__tagname {
position: absolute;
top: -11px;
left: 10px;
padding: 2px 7px;
border-radius: 4px;
background: var(--select);
color: var(--paper);
font: 700 var(--mono-xs) / 1.4 var(--font-mono);
}
.hero__lead {
margin: 0;
font-size: clamp(1rem, 1.5vw, var(--text-l));
line-height: 1.6;
color: var(--ink-soft);
}
.hero__actions {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: var(--space-s);
margin-top: var(--space-m);
}
.hero__btn {
display: inline-flex;
align-items: center;
gap: var(--space-s);
min-height: var(--tap);
padding: 0 22px;
border: var(--line-strong) solid var(--ink);
border-radius: var(--radius-m);
color: var(--ink);
font-size: var(--text-s);
font-weight: 600;
text-decoration: none;
transition: translate var(--lift) var(--ease-pop), background var(--quick) ease;
}
.hero__btn--hot {
border-color: var(--flame);
background: var(--flame);
color: var(--paper);
box-shadow: var(--shadow-flame);
}
.hero__btn:hover { translate: 0 -3px; }
.hero__btn:not(.hero__btn--hot):hover { background: var(--paper-glass); }
.hero__btn:focus-visible { outline: var(--line-strong) solid var(--select); outline-offset: 3px; }
.hero__corner {
position: absolute;
bottom: clamp(20px, 3vw, 40px);
display: grid;
gap: 2px;
font: 400 var(--mono-s) / 1.4 var(--font-mono);
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--ink-soft);
}
.hero__corner b { color: var(--ink); }
.hero__corner--left { left: var(--edge); text-align: left; }
.hero__corner--right { right: var(--edge); text-align: right; }
.hero__cursor {
position: absolute;
top: 0;
left: 0;
display: flex;
align-items: flex-start;
color: var(--select);
pointer-events: none;
translate: var(--cx, 62%) var(--cy, 320px);
transition: translate 120ms linear;
}
.hero__cursor-tag {
margin: 14px 0 0 -2px;
padding: 2px 8px;
border-radius: 4px;
background: var(--select);
color: var(--paper);
font-size: 12px;
font-weight: 600;
}
@media (max-width: 640px) {
.hero__corner { display: none; }
.hero { padding-bottom: var(--section-space); }
.hero__dots { aspect-ratio: 360 / 300; }
}
@media (prefers-reduced-motion: reduce) {
.hero__cursor { display: none; }
}
</style>
<script>
(() => {
const calm = matchMedia('(prefers-reduced-motion: reduce)').matches;
for (const root of document.querySelectorAll('.hero')) {
const canvas = root.querySelector('.hero__dots');
const ctx = canvas.getContext('2d');
const lines = [...root.querySelectorAll('.hero__line')].map((el) => ({
text: el.textContent.trim().toUpperCase(),
hot: el.classList.contains('hero__line--hot'),
}));
const css = getComputedStyle(root);
const ink = css.getPropertyValue('--ink').trim() || '#14202b';
const flame = css.getPropertyValue('--flame').trim() || '#f0531c';
const face = css.getPropertyValue('--font-display').trim() || 'sans-serif';
let dots = [];
let w = 0, h = 0, step = 6, running = false, visible = true, frame = 0;
const pointer = { x: -999, y: -999 };
const build = () => {
const box = canvas.getBoundingClientRect();
if (!box.width) return;
const ratio = Math.min(devicePixelRatio || 1, 2);
w = box.width; h = box.height;
canvas.width = Math.round(w * ratio); canvas.height = Math.round(h * ratio);
ctx.setTransform(ratio, 0, 0, ratio, 0, 0);
step = w < 500 ? 4 : w < 800 ? 5 : 6;
const off = document.createElement('canvas');
off.width = Math.ceil(w); off.height = Math.ceil(h);
const o = off.getContext('2d');
const squeeze = 0.72;
const narrow = w < 500;
const rows = narrow ? lines.flatMap((l) => l.text.split(' ').map((t) => ({ text: t, hot: l.hot }))) : lines;
const lineH = h / rows.length;
rows.forEach((row, i) => {
o.font = `800 100px ${face}`;
const natural = o.measureText(row.text).width * squeeze;
const size = Math.min(lineH * 1.02, (w * 0.98 / natural) * 100);
o.save();
o.font = `800 ${size}px ${face}`;
o.textBaseline = 'alphabetic';
o.fillStyle = row.hot ? '#f00' : '#00f';
const tw = o.measureText(row.text).width * squeeze;
o.translate((w - tw) / 2, lineH * i + lineH * 0.86);
o.scale(squeeze, 1);
o.fillText(row.text, 0, 0);
o.restore();
});
const data = o.getImageData(0, 0, off.width, off.height).data;
dots = [];
for (let y = step / 2; y < h; y += step) {
for (let x = step / 2; x < w; x += step) {
const k = (Math.floor(y) * off.width + Math.floor(x)) * 4;
if (data[k + 3] < 128) continue;
const hot = data[k] > data[k + 2];
const mix = Math.random();
const color = hot ? (mix < 0.78 ? flame : ink) : (mix < 0.62 ? ink : flame);
dots.push({
tx: x, ty: y, color,
x, y,
});
}
}
draw();
if (!calm) start();
};
const draw = () => {
ctx.clearRect(0, 0, w, h);
const size = step * 0.84;
for (const d of dots) {
ctx.fillStyle = d.color;
ctx.fillRect(d.x - size / 2, d.y - size / 2, size, size);
}
};
const tickFrame = () => {
let moving = false;
for (const d of dots) {
let gx = d.tx, gy = d.ty;
const dx = d.tx - pointer.x, dy = d.ty - pointer.y;
const dist = Math.hypot(dx, dy);
if (dist < 70) {
const push = (70 - dist) / 70 * 18;
gx += (dx / (dist || 1)) * push;
gy += (dy / (dist || 1)) * push;
}
d.x += (gx - d.x) * 0.14;
d.y += (gy - d.y) * 0.14;
if (Math.abs(gx - d.x) > 0.2 || Math.abs(gy - d.y) > 0.2) moving = true;
}
draw();
if (moving && visible) frame = requestAnimationFrame(tickFrame);
else running = false;
};
const start = () => {
if (running || !visible) return;
running = true;
frame = requestAnimationFrame(tickFrame);
};
new IntersectionObserver(([entry]) => {
visible = entry.isIntersecting;
if (visible && !calm) start();
else { cancelAnimationFrame(frame); running = false; }
}).observe(canvas);
const cursor = root.querySelector('.hero__cursor');
root.addEventListener('pointermove', (event) => {
const box = canvas.getBoundingClientRect();
pointer.x = event.clientX - box.left;
pointer.y = event.clientY - box.top;
const rootBox = root.getBoundingClientRect();
cursor.style.setProperty('--cx', event.clientX - rootBox.left + 'px');
cursor.style.setProperty('--cy', event.clientY - rootBox.top + 'px');
if (!calm) start();
});
root.addEventListener('pointerleave', () => {
pointer.x = pointer.y = -999;
if (!calm) start();
});
let resizeTimer;
new ResizeObserver(() => {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(build, 120);
}).observe(canvas);
(document.fonts ? document.fonts.load(`800 100px ${face}`).catch(() => {}) : Promise.resolve()).then(build);
}
})();
</script>