Wireframe globe
A hairline globe turning on canvas with pinned cities and their live local times.
Part of the style
Ember Silhouette Wireframe
7 parts that belong together, with their tokens, type and rules.
https://kitbash.me/components/ember-silhouette-wireframe/globe/figma.html?palette=0199ad153a5a00a5
Use the Figma MCP server (https://mcp.figma.com/mcp). Download https://kitbash.me/components/ember-silhouette-wireframe/globe/figma.html?palette=0199ad153a5a00a5 and pass that whole HTML document to the html_to_figma tool, so the part "Wireframe globe" 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 {
--paper: #24211e;
--ink: #f9f9f8;
--ink-mid: #979794;
--ink-soft: #908e8c;
--ink-faint: #595754;
--rule: #32302d;
--cream: #312e2b;
--night: #121211;
--smoke: rgba(203, 203, 201, 0.88);
--veil: rgba(129, 127, 125, 0.62);
--on-dark: #24211e;
--on-dark-soft: rgba(36, 33, 30, 0.8);
--rule-dark: rgba(36, 33, 30, 0.18);
--ember: #8e7d65;
--ember-deep: #9f8f7b;
--amber: #77654e;
}
</style>
<section class="globe">
<h2 class="globe__title">Lighting rooms<br>on four coasts</h2>
<div class="globe__stage">
<canvas class="globe__canvas" role="img" aria-label="A wireframe globe turning slowly, with the studio's four cities pinned"></canvas>
<ul class="globe__pins">
<li class="globe__pin" data-lat="38.7" data-lon="-9.1">
<span class="globe__dot" aria-hidden="true"></span>
<span class="globe__city">Lisbon</span>
<span class="globe__meta">Portugal · <time class="globe__time" data-zone="Europe/Lisbon">09:00</time></span>
</li>
<li class="globe__pin" data-lat="60.4" data-lon="5.3">
<span class="globe__dot" aria-hidden="true"></span>
<span class="globe__city">Bergen</span>
<span class="globe__meta">Norway · <time class="globe__time" data-zone="Europe/Oslo">10:00</time></span>
</li>
<li class="globe__pin globe__pin--left" data-lat="64.1" data-lon="-21.9">
<span class="globe__dot" aria-hidden="true"></span>
<span class="globe__city">Reykjavík</span>
<span class="globe__meta">Iceland · <time class="globe__time" data-zone="Atlantic/Reykjavik">09:00</time></span>
</li>
<li class="globe__pin" data-lat="45.5" data-lon="-73.6">
<span class="globe__dot" aria-hidden="true"></span>
<span class="globe__city">Montréal</span>
<span class="globe__meta">Canada · <time class="globe__time" data-zone="America/Toronto">04:00</time></span>
</li>
</ul>
</div>
</section>
<style>
.globe {
padding: var(--section-space) 0 0;
overflow: hidden;
background: var(--paper);
text-align: center;
}
.globe__title {
margin: 0 var(--edge) var(--space-xl);
font-family: var(--font-display);
font-size: var(--display-m);
font-weight: 400;
line-height: 1.04;
letter-spacing: var(--track-tight);
}
.globe__stage {
position: relative;
height: clamp(380px, 44vw, 620px);
}
.globe__canvas {
width: 100%;
height: 100%;
color: var(--ink-faint);
}
.globe__pins {
position: absolute;
inset: 0;
margin: 0;
padding: 0;
list-style: none;
pointer-events: none;
}
.globe__pin {
position: absolute;
top: 0;
left: 0;
display: grid;
grid-template-columns: auto auto;
column-gap: var(--space-s);
align-items: center;
text-align: left;
white-space: nowrap;
opacity: 0;
transition: opacity var(--quick) var(--ease);
}
.globe__pin--left {
grid-template-columns: auto auto;
text-align: right;
translate: calc(-100% + 9px) 0;
}
.globe__pin--left .globe__dot {
grid-column: 2;
grid-row: 1 / span 2;
}
.globe__pin--left .globe__city,
.globe__pin--left .globe__meta {
grid-column: 1;
}
.globe__pin.is-front {
opacity: 1;
}
.globe__dot {
grid-row: 1 / span 2;
width: 9px;
height: 9px;
border: 2px solid var(--ink);
border-radius: var(--pill);
background: var(--paper);
}
.globe__city {
font-size: var(--text-s);
font-weight: 500;
line-height: 1.1;
letter-spacing: var(--track-tight);
}
.globe__meta {
color: var(--ink-soft);
font-family: var(--font-mono);
font-size: var(--text-micro);
letter-spacing: var(--track-mono);
text-transform: uppercase;
}
.globe__time {
color: var(--ember);
}
</style>
<script>
(() => {
const still = matchMedia('(prefers-reduced-motion: reduce)');
const rad = Math.PI / 180;
const tilt = 4 * rad;
function project(lat, lon, lon0, radius, cx, cy) {
const phi = lat * rad;
const lambda = (lon - lon0) * rad;
const front = Math.sin(tilt) * Math.sin(phi) + Math.cos(tilt) * Math.cos(phi) * Math.cos(lambda);
return {
x: cx + radius * Math.cos(phi) * Math.sin(lambda),
y: cy - radius * (Math.cos(tilt) * Math.sin(phi) - Math.sin(tilt) * Math.cos(phi) * Math.cos(lambda)),
front,
};
}
function line(context, points) {
let drawing = false;
context.beginPath();
for (const point of points) {
if (point.front <= 0) { drawing = false; continue; }
if (drawing) context.lineTo(point.x, point.y);
else context.moveTo(point.x, point.y);
drawing = true;
}
context.stroke();
}
function run(root) {
const canvas = root.querySelector('.globe__canvas');
const context = canvas.getContext('2d');
const pins = [...root.querySelectorAll('.globe__pin')].map((pin) => ({ pin, lat: +pin.dataset.lat, lon: +pin.dataset.lon }));
const times = [...root.querySelectorAll('.globe__time')];
let frame = 0;
const clocks = () => {
const now = new Date();
times.forEach((time) => {
time.textContent = new Intl.DateTimeFormat('en-GB', { hour: '2-digit', minute: '2-digit', timeZone: time.dataset.zone }).format(now);
});
};
const paint = (seconds) => {
const width = canvas.clientWidth;
const height = canvas.clientHeight;
const radius = Math.max(300, Math.min(width * 0.56, 820));
const cx = width / 2;
const cy = radius + 24;
const lon0 = -30 + 26 * Math.sin(seconds * 0.12);
const ink = getComputedStyle(canvas).color;
context.clearRect(0, 0, width, height);
context.strokeStyle = ink;
context.lineWidth = 0.75;
for (let lon = -180; lon < 180; lon += 20) {
const points = [];
for (let lat = -90; lat <= 90; lat += 3) points.push(project(lat, lon, lon0, radius, cx, cy));
line(context, points);
}
for (let lat = -80; lat <= 80; lat += 20) {
const points = [];
for (let lon = -180; lon <= 180; lon += 3) points.push(project(lat, lon, lon0, radius, cx, cy));
line(context, points);
}
context.lineWidth = 1;
context.beginPath();
context.arc(cx, cy, radius, 0, Math.PI * 2);
context.stroke();
for (const { pin, lat, lon } of pins) {
const point = project(lat, lon, lon0, radius, cx, cy);
const shown = point.front > 0.12 && point.y < height - 24;
pin.classList.toggle('is-front', shown);
pin.style.transform = `translate(${(point.x - 5).toFixed(1)}px, ${(point.y - 12).toFixed(1)}px)`;
}
};
const fit = () => {
const density = Math.min(2, devicePixelRatio || 1);
canvas.width = canvas.clientWidth * density;
canvas.height = canvas.clientHeight * density;
context.setTransform(density, 0, 0, density, 0, 0);
paint(still.matches ? 0 : performance.now() / 1000);
};
const tick = (now) => {
paint(now / 1000);
frame = requestAnimationFrame(tick);
};
clocks();
setInterval(clocks, 30000);
new ResizeObserver(fit).observe(canvas);
new IntersectionObserver(([entry]) => {
cancelAnimationFrame(frame);
if (entry.isIntersecting && !still.matches) frame = requestAnimationFrame(tick);
}).observe(canvas);
}
document.querySelectorAll('.globe').forEach(run);
})();
</script>