Motion 04 of 16 · Canvas 2D with 3D projection
Globe → arcs
Orders flying round a dotted world.
A free dotted globe animation in plain HTML, CSS and canvas JavaScript. Also known as animated globe with arcs, 3D globe canvas or world map arcs.
- Built with
- Canvas 2D with 3D projection
- Loop
- 12 seconds, seamless
- Needs
- Nothing: no libraries
- Best for
- Shipping worldwide, an international client list or a 'where we work' section.
Tune it
The preview, the code and the download all follow these settings.
How the dotted globe animation works
Dots placed on real coastlines (Natural Earth map data) turn once per loop, while arcs lift off from one city and land on another with a small pulse.
Everything is worked out from the time alone, never from the last frame, so it loops without a seam and can be rendered to video frame by frame.
Add it to your site
- Download the file, or copy the code below into a new file called
coyote-globe.html. - Show it on a page with
<iframe src="coyote-globe.html" style="width:100%;aspect-ratio:96/86;border:0"></iframe>. - Make it yours. Use Tune it above before you copy, or change
CC_MOTION_SETTINGSnear the top of the file: a colourway, your ownaccentandaccent2,speedandamount.
The Globe → arcs code
One self-contained file: the Coyote style file, the small runtime and the animation itself.
Show the code (30.2 KB)
<!doctype html>
<!-- Globe → arcs: a free animation from Coyote Lab (https://coyoteconcept.com/lab/motion/globe).
Free for personal and commercial use. Change the colours in the :root block and in C inside the script.
Put this file in an <iframe>, or copy the stage and scripts into your page. -->
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Globe → arcs · Coyote Lab</title>
<style>
/* Coyote Motion style file: the brand, once, for every scene.
Taken from coyote-concepts/static/css/tokens.css (dusk theme). Frames are 1080x1350 (4:5) and scale to fit. */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;1,9..144,500&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");
:root {
--void: #0b0b0d;
--dusk: #100f12;
--surface: #18171b;
--stage: #121115;
--line: rgba(236, 233, 226, 0.08);
--bone: #ece9e2;
--ash: #a3a19a;
--ash-dim: #6f6d68;
--moon: #c9d6de;
--ember: #e0883e;
--ember-bright: #f2a35e;
--rust: #b8551a;
--gold: #e8b04a;
--rose: #d9776b;
--slate: #4c6a80;
--indigo: #232a40;
--font-display: "Fraunces", ui-serif, Georgia, serif;
--font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
--font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
--ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #060607; overflow: hidden; }
body { font-family: var(--font-body); color: var(--bone); }
.frame {
width: 1080px; height: 1350px; position: absolute; left: 50%; top: 50%;
background: radial-gradient(120% 70% at 50% 0%, #17151a 0%, var(--void) 60%);
transform-origin: 0 0; padding: 64px 60px 56px; display: flex; flex-direction: column; overflow: hidden;
}
.frame::before { /* faint grain */
content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.head { display: flex; flex-direction: column; gap: 14px; }
.kicker { font-family: var(--font-mono); font-size: 20px; color: var(--ash-dim); letter-spacing: .04em; display: flex; gap: 14px; align-items: center; }
.kicker i { width: 10px; height: 10px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 14px var(--ember); }
h1 { font-family: var(--font-display); font-weight: 600; font-size: 92px; line-height: 1; letter-spacing: -.02em; }
h1 .arrow { color: var(--ash-dim); font-weight: 400; margin: 0 .12em; }
h1 .verb { font-style: italic; font-weight: 500; color: var(--ember); }
.sub { font-size: 28px; color: var(--ash); }
.stage {
margin-top: 40px; flex: 1; position: relative; border-radius: 34px; overflow: hidden;
background: var(--stage); border: 1px solid var(--line);
box-shadow: 0 40px 80px -40px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.04);
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage .grid { position: absolute; inset: 0; opacity: .5;
background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
background-size: 48px 48px; mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent); }
.how { margin-top: 26px; font-family: var(--font-mono); font-size: 19px; line-height: 1.5; color: var(--ash-dim); min-height: 58px; }
.how b { color: var(--ash); font-weight: 500; }
.foot { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 18px; color: var(--ash-dim); }
.foot .brand { display: flex; align-items: center; gap: 14px; color: var(--bone); font-family: var(--font-body); font-weight: 700; font-size: 20px; letter-spacing: .06em; }
.foot .brand img { width: 34px; height: 34px; }
.foot .brand em { font-style: normal; color: var(--ember); }
.frame--embed { width: 960px; height: 860px; padding: 0; background: var(--stage); }
.frame--embed::before { display: none; }
.frame--embed .stage { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
html:has(.frame--embed), body:has(.frame--embed) { background: var(--stage); }
@media (prefers-reduced-motion: reduce) { * { animation-duration: 0s !important; } }
</style></head><body>
<script>window.CC_MOTION_EMBED = true; window.CC_MOTION_SETTINGS = {"palette": "ember", "speed": 1, "amount": 1};</script>
<script>
/* Shared frame for every Coyote Motion scene.
Scene({n, title, verb, sub, how, dur, setup(stage, S), draw(t, p, state, S), retint(state, S)})
- draw gets t (seconds into the loop) and p (0..1). Everything is a pure function of t, so the scene loops
seamlessly and can be rendered frame by frame: window.renderAt(seconds). ?t=2.5 freezes one frame.
- S.canvas(stage) returns a 2x canvas context sized to the stage, with ctx.W / ctx.H in CSS pixels.
- ?embed (or window.CC_MOTION_EMBED = true) shows the animation alone, without the social-post frame: that's how
Coyote Lab embeds it and how the copyable code runs. Off-screen, the loop pauses.
- Settings: S.C is the palette, S.P.speed scales time and S.P.amount (default 1) is the scene's own strength
dial (more particles, taller waves, a harder tilt), where a scene has one. They come from
window.CC_MOTION_SETTINGS, from the URL (?palette=moon&speed=1.5&amount=.6&accent=%23ff0000&accent2=...) or
live from the Lab page via postMessage({type: 'cc-motion', palette, accent, accent2, speed, amount}).
DOM scenes colour themselves with the --cc-* custom properties, which follow the palette. */
(function () {
const TOTAL = 16;
const PALETTES = {
ember: { ember: '#e0883e', emberBright: '#f2a35e', rust: '#b8551a', gold: '#e8b04a', rose: '#d9776b', slate: '#4c6a80', indigo: '#232a40', moon: '#c9d6de' },
moon: { ember: '#c9d6de', emberBright: '#ffffff', rust: '#6f8797', gold: '#e8f0f4', rose: '#8fb0c2', slate: '#4f6b7a', indigo: '#1e2836', moon: '#e8f0f4' },
gold: { ember: '#d9a635', emberBright: '#ffe08a', rust: '#8a6410', gold: '#fff0b3', rose: '#e0b45a', slate: '#5a5236', indigo: '#2a2416', moon: '#f1ead8' },
aurora: { ember: '#5ee6c0', emberBright: '#a8ffe6', rust: '#1d8f78', gold: '#7aa2ff', rose: '#5fb8e8', slate: '#2f5a78', indigo: '#16243a', moon: '#e4f2f0' },
rose: { ember: '#ff6f91', emberBright: '#ffa8bc', rust: '#b8325a', gold: '#ffb38a', rose: '#e85a8a', slate: '#5a3a5a', indigo: '#2a1626', moon: '#f6e6ea' },
mono: { ember: '#e8e8e8', emberBright: '#ffffff', rust: '#6a6a6a', gold: '#bdbdbd', rose: '#9a9a9a', slate: '#4a4a4a', indigo: '#222222', moon: '#f2f2f2' },
};
const C = Object.assign({ void: '#0b0b0d', stage: '#121115', bone: '#ece9e2', ash: '#a3a19a', dim: '#6f6d68' }, PALETTES.ember);
const P = { speed: 1, amount: 1 };
const ease = {
out: x => 1 - Math.pow(1 - x, 3), inOut: x => x < .5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2,
outBack: x => { const c1 = 1.70158, c3 = c1 + 1; return 1 + c3 * Math.pow(x - 1, 3) + c1 * Math.pow(x - 1, 2); },
outElastic: x => x === 0 ? 0 : x === 1 ? 1 : Math.pow(2, -10 * x) * Math.sin((x * 10 - .75) * (2 * Math.PI / 3)) + 1,
};
const clamp = (x, a = 0, b = 1) => Math.min(b, Math.max(a, x));
const seg = (t, a, b) => clamp((t - a) / (b - a)); // 0..1 progress of t through [a, b]
const lerp = (a, b, x) => a + (b - a) * x;
const rand = s => () => (s = (s * 16807) % 2147483647) / 2147483647; // seeded, so every frame is repeatable
const rgb = h => { const n = parseInt(h.slice(1), 16); return [n >> 16, (n >> 8) & 255, n & 255]; };
const hex = (h, a = 1) => { const [r, g, b] = rgb(h); return `rgba(${r},${g},${b},${a})`; };
const mixRgb = (h1, h2, x) => { const a = rgb(h1), b = rgb(h2); return a.map((v, i) => Math.round(lerp(v, b[i], x))); };
const mix = (h1, h2, x) => `rgb(${mixRgb(h1, h2, x).join(',')})`;
const mixHex = (h1, h2, x) => '#' + mixRgb(h1, h2, x).map(v => v.toString(16).padStart(2, '0')).join('');
const isHex = v => /^#[0-9a-f]{6}$/i.test(v || '');
function palette(s) {
if (isHex(s.accent)) { // custom: build the whole set from two colours
const a = s.accent, b = isHex(s.accent2) ? s.accent2 : mixHex(a, '#ffffff', .4);
return { ember: a, emberBright: mixHex(a, '#ffffff', .35), rust: mixHex(a, '#000000', .4), gold: b,
rose: mixHex(a, b, .5), slate: mixHex(a, '#2a3340', .75), indigo: mixHex(a, '#12151c', .85), moon: mixHex(b, '#ffffff', .6) };
}
return PALETTES[s.palette] || PALETTES.ember;
}
function applyVars() {
const r = document.documentElement.style;
Object.entries({ ember: C.ember, 'ember-bright': C.emberBright, rust: C.rust, gold: C.gold, rose: C.rose, slate: C.slate, indigo: C.indigo, moon: C.moon })
.forEach(([k, v]) => r.setProperty('--cc-' + k, v));
}
function settings(s) {
if (!s) return;
if (s.palette || s.accent) Object.assign(C, palette(s));
if (s.speed != null && s.speed !== '' && isFinite(+s.speed)) P.speed = clamp(+s.speed, .1, 4);
if (s.amount != null && s.amount !== '' && isFinite(+s.amount)) P.amount = clamp(+s.amount, .1, 3);
applyVars();
}
function canvas(stage) {
const cv = document.createElement('canvas'); stage.appendChild(cv);
const r = stage.getBoundingClientRect(), s = 1 / (window.__frameScale || 1);
const W = Math.round(r.width * s), H = Math.round(r.height * s);
const dpr = +(new URLSearchParams(location.search).get('dpr') || window.CC_MOTION_DPR || Math.min(2, window.devicePixelRatio || 1));
cv.width = W * dpr; cv.height = H * dpr;
const ctx = cv.getContext('2d'); ctx.scale(dpr, dpr); ctx.W = W; ctx.H = H;
return ctx;
}
function fit(frame) {
const s = Math.min(innerWidth / frame.offsetWidth, innerHeight / frame.offsetHeight);
window.__frameScale = s; frame.style.transform = `scale(${s}) translate(-50%, -50%)`;
}
window.Scene = function (cfg) {
const dur = cfg.dur || 6;
const pad = String(cfg.n).padStart(2, '0');
const q = new URLSearchParams(location.search);
applyVars();
settings(window.CC_MOTION_SETTINGS);
settings({ palette: q.get('palette'), accent: q.get('accent'), accent2: q.get('accent2'), speed: q.get('speed'), amount: q.get('amount') });
document.title = `${cfg.title} → ${cfg.verb} · Coyote Motion`;
const embed = window.CC_MOTION_EMBED || q.has('embed');
const grid = cfg.grid === false ? '' : '<div class="grid"></div>';
if (embed) document.body.innerHTML = `<div class="frame frame--embed"><div class="stage">${grid}</div></div>`;
else document.body.innerHTML = `
<div class="frame">
<div class="head">
<div class="kicker"><i></i>COYOTE MOTION · ${pad} OF ${TOTAL}</div>
<h1>${cfg.title}<span class="arrow">→</span><span class="verb">${cfg.verb}</span></h1>
<p class="sub">${cfg.sub}</p>
</div>
<div class="stage">${grid}</div>
<p class="how">${cfg.how}</p>
<div class="foot"><span class="brand"><img src="../cc-mark-white.svg" alt="">COYOTE <em>CONCEPT</em></span><span>coyoteconcept.com</span><span>${pad} / ${TOTAL}</span></div>
</div>`;
const frame = document.querySelector('.frame'), stage = frame.querySelector('.stage');
fit(frame); addEventListener('resize', () => fit(frame));
const S = { C, P, ease, clamp, seg, lerp, rand, rgb, hex, mix, mixHex, canvas, dur };
Promise.resolve(document.fonts.ready).then(() => cfg.setup ? cfg.setup(stage, S) : null).then(state => {
const render = t => { t = ((t % dur) + dur) % dur; cfg.draw(t, t / dur, state, S); };
window.renderAt = render; window.sceneDuration = dur;
const fixed = q.get('t');
const still = fixed !== null || matchMedia('(prefers-reduced-motion: reduce)').matches;
const stillAt = fixed !== null ? +fixed : dur * .7;
if (cfg.retint) cfg.retint(state, S);
addEventListener('message', e => {
if (!e.data || e.data.type !== 'cc-motion') return;
settings(e.data); if (cfg.retint) cfg.retint(state, S);
if (still) render(stillAt);
});
if (still) { render(stillAt); window.sceneReady = true; return; }
let clock = 0, last = null, visible = true;
const loop = now => {
if (visible) { if (last !== null) clock += (now - last) / 1000 * P.speed; render(clock); }
last = visible ? now : null; requestAnimationFrame(loop);
};
if ('IntersectionObserver' in window) new IntersectionObserver(es => { visible = es[0].isIntersecting; }).observe(frame);
requestAnimationFrame(loop); window.sceneReady = true;
});
};
})();
</script>
<script>
const LAND = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///8AGf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////n////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////7////////4AAAAA/wAAD4AAAAAAP4AAAAAAAAAAAAAAAAAAAAAAAAAAA///+B////////AAAAB//wAAAAAAAAAAH8gAAAAAAAAAAAAAAAAAAAAAAAMH3P//x////////+AAAAB/2AAAAAAAAAAAAD4AAAAAAAAAAAAAAAAAAAAAA8cABwP/A////////+AAAAAPHAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAD/DA9+//Af///////8AAAAAAAAAAAAAf4AAAAP/+AAAAAAAAAAAAAAAAAAAAAH/w93/8AAA//////+AAAAAAAAAAAAH+AAAB////AAAB/uAAAAAAAAAAAAAAfA8AAx/8AAAP/////8AAAAAAAAAAAAfAAAAP///4AAAAwAAAAAAAAAAAAAAAf+AYe+d/gAAD/////4AAAAAAAAAAAB8AAAP/////+HwAOAAAAAAAAAAAAAAA///4/4//wAAB/////wAAAAAAAAAAADwAHl////////4Af8AAAAAwAAAAAAAA/f/8P4///AAD/////wAAAAAAAAAAAHwAff////////8///gAAABAAA//wAACAP//B8f//8AB/////wAAAAAAB/gAAAAAfv/////////////8AAAAAB///+P//n//n+D4f+AB/////AAAAAAA//8AAAA+f////////////////P+wAf////////94Hfz4f+AAf///4AAAAAAD///4MHf////////////////////+AH/////////////4Z/wA///4AAAAAAAP///+O////v//////////////////4P/////////////wD/8A///wAwYAAAAf///+////////////////////////8/////////////+A/+4Af/8AA/8AAAB/8f+D///////////////////////BwP/////////////w//gAP/wAAf8AAAD/5//f//////////////////////+AOB////////////HcA/gAP/gAADAAAAP/z/////////////////////////+AAP///////////8Aw+PAAD/AAAAAAAB//H//////////////////////////AAP///////////4AA/gAAD/AAAAAAAB//H///////////////////////v/AAAf//3////////wAA/4AAAOAAAAAAAB//n//////////////////////C/8AAAA/7gH///////wAA/4wAAAAAAAAAAB//h/////////////////////+DwAAAAAv4AA///////4AA//4AAAAAAAAA4A5+B///////////////////8AAHgAAAAAD8AAD//////8AAf/8AAAAAAAAA8AG+G///////////////////wAA/gAAAAAOAAAB///////wAf/+AAAAAAAAA8AO8H///////////////////AAA/gAAAAB4AAAA///////+A///AAAAAAAAA+ANwH//////////////////+AAB/AAAAAGAAAAAf///////z///4AAAAAAAHPAOn///////////////////+AAB/AAAAAAAAAABP///////x///8AAAAAAAPfB//////////////////////6AA8AAAAAAAAAAAn///////5///+AAAAAAAPfz///////////////////////AA4AAAAAAAAAAAD///////////+AAAAAAAAfn//////////////////////7AAwAAAAAAAAAAAH///////////sAAAAAAAA+f//////////////////////7AAAAAAAAAAAAAAB/////////+MPAAAAAAAAD///////////////////////7gAAAAAAAAAAAAAAf/////////wfgAAAAAAAf///////////////////////yAAAAAAAAAAAAAAAf/////////gfwAAAAAAAP///////////////////////iAAAAAAAAAAAAAAAP/////////9AgAAAAAAAD//////v/x//////////////jAAAAAAAAAAAAAAAP//////////AAAAAAAAAD/////H//D//////////////AAAAAAAAAAAAAAAAP////////+4AAAAAAAAAD//n/+Gf+H/////////////8HAAAAAAAAAAAAAAAf////////wgAAAAAAAAH//zz/+AH/H/////////////4PwAAAAAAAAAAAAAAf////////wAAAAAAAAAH/4N4/8AB/D////////////+APAAAAAAAAAAAAAAAP////////wAAAAAAAAAH/4A+f+fh/g////////////8AMAAAAAAAAAAAAAAAf///////+AAAAAAAAAAH/gMPfv///x////////////4AMAAAAAAAAAAAAAAAP///////8AAAAAAAAAAP/AMGOP///x///////////ZwAMAAAAAAAAAAAAAAAP///////4AAAAAAAAAAP/AAGHP///g//////////8B4AcAAAAAAAAAAAAAAAH///////wAAAAAAAAAAH+AA8HH///w///////////w4A4AAAAAAAAAAAAAAAD///////wAAAAAAAAAAB8/+ACD///////////////g8D4AAAAAAAAAAAAAAAB///////wAAAAAAAAAAA7/+AAwE//////////////A8/4AAAAAAAAAAAAAAAB///////gAAAAAAAAAAB//+AAAA//////////////Ax/gAAAAAAAAAAAAAAAAP/////+AAAAAAAAAAAH//+AAAB//////////////gD8AAAAAAAAAAAAAAAAAH/////8AAAAAAAAAAAP///4OAB//////////////gDAAAAAAAAAAAAAAAAAAH/////4AAAAAAAAAAAP///8P8z//////////////wDAAAAAAAAAAAAAAAAAADf////4AAAAAAAAAAAP/////////////////////wAAAAAAAAAAAAAAAAAAADf///g4AAAAAAAAAAAP/////////P///////////wAAAAAAAAAAAAAAAAAAABv//AAcAAAAAAAAAAA//////////n///////////wAAAAAAAAAAAAAAAAAAAB3/+AAcAAAAAAAAAAD///////9//j///////////gAAAAAAAAAAAAAAAAAAAA7/+AANgAAAAAAAAAD///////8//wn//////////AAAAAAAAAAAAAAAAAAAAAZ/+AAMAAAAAAAAAAH///////+f/8b//////////AAAAAAAAAAAAAAAAAAAAAM/+AABgAAAAAAAAAP////////f/84Af///////+wAAAAAAAAAAAAAAAAAAAAGf+AAAAAAAAAAAAAP////////P//+AP///////8wAAAAAAAAAAAAAAAAAAAAAP8AB/AAAAAAAAAAf////////n///AH///////ggAAAAAAAAAAAAAAAAAAAAAP+A4DwAAAAAAAAAf////////n///AH//+P//8AAAAAAAAAAAAAAAAAAAAAAAP+B4A8AAAAAAAAAf////////n//+AAf/4P/+IAAAAAAAAAAAAAAAgAAAAAAAH/B4AB4AAAAAAAAf////////h//8AAf/wH/8YAAAAAAAAAAAAAAAAAAAAAAAD//wAj9AAAAAAAAf////////x//4AAf/AD/8QAQAAAAAAAAAAAAAAAAAAAAAA//wAAAAAAAAAAAf////////4//wAAf+AD/+AA4AAAAAAAAAAAAAAAAAAAAAAP/wAAAAAAAAAAAf////////4//AAAf8AD//AA4AAAAAAAAAAAAAAAAAAAAAAAP/gAAAAAAAAAAf////////8/8AAAP4AAf/gAwAAAAAAAAAAAAAAAAAAAAAAAD/gAAAAAAAAAA/////////+fwAAAPwAAP/gAwAAAAAAAAAAAAAAAAAAAAAAAA/gAAAAAAAAAAf/////////fAAAAP4AAP/wA8AAAAAAAAAAAAAAAAAAAAAAAAPgAgAAAAAAAAf/////////4AAAAHwAAN/wATAAAAAAAAAAAAAAAAAAAAAAAADgD4AAAAAAAAP/////////w4AAAHwAAMfgALAAAAAAAAAAAAAAAAAAAAAAAADgP/eAAAAAAAH//////////4AAADwAAMfABOAAAAAAAAAAAAAAAAAAAAAAAABzP/+AAAAAAAD//////////4AAADoAAMGACNAAAAAAAAAAAAAAAAAAAAAAAAA9///AAAAAAAB//////////4AAABMAAMAAAHgAAAAAAAAAAAAAAAAAAAAAAAAE///wAAAAAAB//////////wAAAAcAAGAAAPgAAAAAAAAAAAAAAAAAAAAAAAAA///4AAAAAAA//////////wAAAAMAADAAMDAAAAAAAAAAAAAAAAAAAAAAAAAA////gAAAAAAP/h///////gAAAAAABjgAeAAAAAAAAAAAAAAAAAAAAAAAAAAA////4AAAAAAHAB///////AAAAAAAAzwA+AAAAAAAAAAAAAAAAAAAAAAAAAAA////4AAAAAAAAAH/////+AAAAAAAAdwB8AAAAAAAAAAAAAAAAAAAAAAAAAAB////8AAAAAAAAAH/////+AAAAAAAAfwH8AAAAAAAAAAAAAAAAAAAAAAAAAAB////8AAAAAAAAAH/////4AAAAAAAAPwf+CYAAAAAAAAAAAAAAAAAAAAAAAAD////8AAAAAAAAAH/////wAAAAAAAAHwf8+YAAAAAAAAAAAAAAAAAAAAAAAAH/////gAAAAAAAAH/////gAAAAAAAADwf9IAwAAAAAAAAAAAAAAAAAAAAAAAH/////4AAAAAAAAH/////AAAAAAAAAD4P54B5AAAAAAAAAAAAAAAAAAAAAAAH//////AAAAAAAAH////+AAAAAAAAAB8P5wA74AAAAAAAAAAAAAAAAAAAAAAH//////8AAAAAAAD////8AAAAAAAAAA8D54u//AIAAAAAAAAAAAAAAAAAAAAP//////+AAAAAAAB////8AAAAAAAAAAcAB4AH/wYAAAAAAAAAAAAAAAAAAAAH///////gAAAAAAA////4AAAAAAAAAAMABoAB/7yAAAAAAAAAAAAAAAAAAAAH///////gAAAAAAA////4AAAAAAAAAAHkAAAI/8BAAAAAAAAAAAAAAAAAAAAD///////wAAAAAAAf///8AAAAAAAAAAB/AAAA/8AIAAAAAAAAAAAAAAAAAAAB///////gAAAAAAAf///8AAAAAAAAAAAHm5gAvOACAAAAAAAAAAAAAAAAAAAB///////gAAAAAAAf///8AAAAAAAAAAAABjAAAHADAAAAAAAAAAAAAAAAAAAA///////AAAAAAAAf///+AAAAAAAAAAAAAAAAABgBAAAAAAAAAAAAAAAAAAAA//////+AAAAAAAAf///+AAAAAAAAAAAAAAAwCAAAAAAAAAAAAAAAAAAAAAAAf/////8AAAAAAAAf///+AQAAAAAAAAAAAAD+DAAAAAAAAAAAAAAAAAAAAAAAf/////4AAAAAAAA////+AwAAAAAAAAAAAAD8HAAAAAAAAAAAAAAAAAAAAAAAP/////4AAAAAAAA////+BwAAAAAAAAAAAB38HgAAAAAAAAAAAAAAAAAAAAAAH/////4AAAAAAAA////+D4AAAAAAAAAAAD/+HwAAAAAAAAAAAAAAAAAAAAAAD/////4AAAAAAAB////8PwAAAAAAAAAAAH//HwAAAABAAAAAAAAAAAAAAAAAA/////4AAAAAAAB////wPwAAAAAAAAAAAP///wAAAAGAAAAAAAAAAAAAAAAAAf////4AAAAAAAA////gPwAAAAAAAAAAAP///wAAAAAAAAAAAAAAAAAAAAAAAP////wAAAAAAAA////APgAAAAAAAAAAAf///8AAAAAAAAAAAAAAAAAAAAAAAP////wAAAAAAAAf//+APgAAAAAAAAAAH////+AAIAAAAAAAAAAAAAAAAAAAAP////gAAAAAAAAf//+AfgAAAAAAAAAAf/////AAGAAAAAAAAAAAAAAAAAAAAf////gAAAAAAAAP///AfAAAAAAAAAAA//////gACAAAAAAAAAAAAAAAAAAAAf///8AAAAAAAAAP///AfAAAAAAAAAAB//////gAAAAAAAAAAAAAAAAAAAAAAf///gAAAAAAAAAP//+APAAAAAAAAAAB//////wAAAAAAAAAAAAAAAAAAAAAAf///AAAAAAAAAAP//4AEAAAAAAAAAAA//////4AAAAAAAAAAAAAAAAAAAAAAf///AAAAAAAAAAH//4AAAAAAAAAAAAB//////4AAAAAAAAAAAAAAAAAAAAAAf///AAAAAAAAAAH//4AAAAAAAAAAAAA//////8AAAAAAAAAAAAAAAAAAAAAA///+AAAAAAAAAAD//4AAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAB8AAAAAAAAAAAAAAAAAAH8AAAAGAB8P4P3+AAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAD//nAAH//////////wAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAGB////8A////////////yAAAAAAAAAAAAAAAAAAAAAA/4AAAAAAAAAAAAAAAP/////8H/////////////4AAAAAAAAAAAAAAAAAAAAA/8AAAAAAAAAAD+/////////4f//////////////wAAAAAAAAAAAAAAAAAAAH/+AAAAAAAAf////////////5////////////////4AAAAAAAAAAAAAB/AAAAz+AAAAAAAD//////////////////////////////4AAAAAAAAABjgAB////j/+AAAAAAAP//////////////////////////////wAAAAAAAA////8Af/////8AAAAAAAf/////////////////////////////+AAAAAAAD/////////////wAAAAAAD//////////////////////////////4AAAAAAAP////////////wAAAAAAf///////////////////////////////wAAAAAD/////////////8AAAAAAH////////////////////////////////wAAAADz/////////////gAAAD8A/////////////////////////////////+AAAAB4D////////////gAAAH+A/////////////////////////////////AAAAAAAAH////////////g/A/4AD///////////////////////////////+AAAAAAA///////////////4ADg//////////////////////////////////AAAAAAAH///////////////n////////////////////////////////////4AAAAAAP/////////////////////////////////////////////////////wA//4AA///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////';
Scene({
n: 4, title: 'Globe', verb: 'arcs', sub: 'Orders flying round a dotted world', dur: 12,
how: '<b>How:</b> dots placed on real coastlines (Natural Earth map data) turn once per loop, while arcs lift off from one city and land on another with a small pulse.',
setup(stage, S) {
const ctx = S.canvas(stage), dots = [], D = Math.PI / 180;
// Land, 1 degree per bit, row by row from 90N and 180W, rasterised from Natural Earth's 1:110m land outlines
// (public domain), so every dot sits on a real coast.
const raw = atob(LAND), isLand = (la, lo) => {
const x = ((Math.floor(lo + 180) % 360) + 360) % 360, y = Math.min(179, Math.max(0, Math.floor(90 - la))), i = y * 360 + x;
return (raw.charCodeAt(i >> 3) >> (7 - (i & 7))) & 1;
};
for (let la = -84; la <= 84; la += 2) {
const step = 2 / Math.max(.12, Math.cos(la * D));
for (let lo = -180; lo < 180; lo += step) if (isLand(la + 1, lo + 1)) dots.push([la * D, lo * D]);
}
// Snap each city to the nearest land cell, so arcs always leave from and land on land.
const snap = ([la, lo]) => {
if (isLand(la, lo)) return [la, lo];
for (let r = 1; r <= 4; r++) for (let dy = -r; dy <= r; dy++) for (let dx = -r; dx <= r; dx++)
if (isLand(la + dy, lo + dx)) return [Math.floor(la + dy) + .5, Math.floor(lo + dx) + .5];
return [la, lo];
};
const city = { London: [51.5, -0.1], NewYork: [40.7, -74], Lagos: [6.5, 3.4], Dubai: [25.2, 55.3], Tokyo: [35.7, 139.7],
SaoPaulo: [-23.5, -46.6], Sydney: [-33.9, 151.2], Mumbai: [19, 72.8] };
Object.keys(city).forEach(k => { city[k] = snap(city[k]); });
const routes = [['London', 'NewYork'], ['London', 'Dubai'], ['Lagos', 'London'], ['Dubai', 'Mumbai'], ['NewYork', 'SaoPaulo'],
['Tokyo', 'Sydney'], ['Mumbai', 'Tokyo'], ['London', 'Lagos']].map(([a, b]) => ({ a: city[a], b: city[b] }));
// Each arc flies only while both of its cities face the viewer, from take-off to landing (LIFE seconds),
// so no arc ever leaves or lands on the far side. Pick, for each route, the start time nearest its slot
// in the loop at which both ends stay well in view.
const dur = S.dur, LIFE = 2.3, faceZ = (la, lo, t) => {
const rot = t / dur * Math.PI * 2 - 0.3, tilt = -0.32, L = la * D, G = lo * D;
const y = Math.sin(L), z = Math.cos(L) * Math.cos(G + rot);
return y * Math.sin(tilt) + z * Math.cos(tilt);
};
routes.forEach((r, i) => {
let best = null, bestScore = -1;
for (let t0 = 0; t0 < dur; t0 += .05) {
let worst = 1;
for (let k = 0; k <= LIFE; k += .1) worst = Math.min(worst, faceZ(r.a[0], r.a[1], t0 + k), faceZ(r.b[0], r.b[1], t0 + k));
if (worst < .18) continue;
const slot = i * dur / routes.length, gap = Math.min(Math.abs(t0 - slot), dur - Math.abs(t0 - slot));
const score = worst - gap * .05;
if (score > bestScore) { bestScore = score; best = t0; }
}
r.start = best; // null: this pair can't be seen whole at once, so it doesn't fly
});
return { ctx, dots, routes: routes.filter(r => r.start !== null), D };
},
draw(t, p, st, S) {
const { ctx, dots, routes, D } = st, W = ctx.W, H = ctx.H, R = 330, cx = W / 2, cy = H / 2 + 10, { C, seg, ease, hex } = S;
const rot = p * Math.PI * 2 - 0.3, tilt = -0.32;
const proj = (la, lo, lift = 1) => {
const x = Math.cos(la) * Math.sin(lo + rot), y = Math.sin(la), z = Math.cos(la) * Math.cos(lo + rot);
const y2 = y * Math.cos(tilt) - z * Math.sin(tilt), z2 = y * Math.sin(tilt) + z * Math.cos(tilt);
return [cx + x * R * lift, cy - y2 * R * lift, z2];
};
ctx.clearRect(0, 0, W, H);
const halo = ctx.createRadialGradient(cx, cy, R * .7, cx, cy, R * 1.35);
halo.addColorStop(0, hex(C.slate, .35)); halo.addColorStop(1, 'rgba(0,0,0,0)'); ctx.fillStyle = halo; ctx.fillRect(0, 0, W, H);
const body = ctx.createRadialGradient(cx - R * .35, cy - R * .4, R * .1, cx, cy, R);
body.addColorStop(0, '#1f2638'); body.addColorStop(1, '#0d0f16'); ctx.fillStyle = body; ctx.beginPath(); ctx.arc(cx, cy, R, 0, 6.283); ctx.fill();
const bins = [[], [], [], [], [], []];
for (const [la, lo] of dots) { const q = proj(la, lo); if (q[2] >= -0.05) bins[Math.min(5, Math.floor(Math.max(0, q[2]) * 6))].push(q); }
bins.forEach((pts, i) => {
const z = (i + .5) / 6, r = .9 + z * 1.3; ctx.fillStyle = hex(C.moon, .25 + z * .6); ctx.beginPath();
for (const [x, y] of pts) { ctx.moveTo(x + r, y); ctx.arc(x, y, r, 0, 6.283); }
ctx.fill();
});
const slerp = (A, B, k) => { // great-circle point between two lat/lon pairs
const v = ([la, lo]) => [Math.cos(la * D) * Math.cos(lo * D), Math.sin(la * D), Math.cos(la * D) * Math.sin(lo * D)];
const a = v(A), b = v(B), dot = a[0] * b[0] + a[1] * b[1] + a[2] * b[2], om = Math.acos(Math.min(1, dot)), s = Math.sin(om);
const q = a.map((ai, i) => (Math.sin((1 - k) * om) * ai + Math.sin(k * om) * b[i]) / s);
return [Math.asin(q[1]), Math.atan2(q[2], q[0])];
};
for (const r of routes.slice(0, Math.max(1, Math.round(routes.length * Math.min(1, S.P.amount))))) {
const local = ((t - r.start) % S.dur + S.dur) % S.dur, grow = ease.inOut(seg(local, 0, 1.2)), fade = 1 - seg(local, 1.9, 2.3);
if (fade <= 0) continue;
const tail = ease.inOut(seg(local, .6, 1.9)), pts = [];
for (let i = 0; i <= 40; i++) {
const k = i / 40; if (k > grow || k < tail) continue;
const [la, lo] = slerp(r.a, r.b, k), q = proj(la, lo, 1 + Math.sin(k * Math.PI) * .22);
pts.push(q);
}
if (pts.length > 1) {
ctx.beginPath(); pts.forEach(([x, y], i) => i ? ctx.lineTo(x, y) : ctx.moveTo(x, y));
const g = ctx.createLinearGradient(pts[0][0], pts[0][1], pts.at(-1)[0], pts.at(-1)[1]);
g.addColorStop(0, hex(C.rose, 0)); g.addColorStop(1, hex(C.ember, fade));
ctx.strokeStyle = g; ctx.lineWidth = 3; ctx.lineCap = 'round'; ctx.stroke();
const [hx, hy, hz] = pts.at(-1); if (grow < 1 && hz > -0.2) { ctx.fillStyle = hex(C.gold, fade); ctx.beginPath(); ctx.arc(hx, hy, 5, 0, 6.283); ctx.fill(); }
}
for (const end of [r.a, r.b]) { // both ends sit on land: mark them
const [ex, ey, ez] = proj(end[0] * D, end[1] * D);
if (ez > 0) { ctx.fillStyle = hex(C.gold, fade * (end === r.a ? .9 : grow)); ctx.beginPath(); ctx.arc(ex, ey, 3.2, 0, 6.283); ctx.fill(); }
}
if (grow >= 1) { // landing pulse
const [x, y, z] = proj(r.b[0] * D, r.b[1] * D), k = seg(local, 1.2, 2.2);
if (z > 0 && k < 1) { ctx.strokeStyle = hex(C.ember, (1 - k) * .9); ctx.lineWidth = 2; ctx.beginPath(); ctx.arc(x, y, 4 + k * 26, 0, 6.283); ctx.stroke(); }
}
}
const rim = ctx.createRadialGradient(cx, cy, R * .92, cx, cy, R * 1.02);
rim.addColorStop(0, 'rgba(0,0,0,0)'); rim.addColorStop(1, hex(C.moon, .18)); ctx.fillStyle = rim; ctx.beginPath(); ctx.arc(cx, cy, R * 1.02, 0, 6.283); ctx.fill();
},
});
</script>
</body></html>
For AI assistants
Using ChatGPT, Claude, Copilot or Cursor? Give it this and it can add the dotted globe animation to your site. Assistants can read the full instructions at https://coyoteconcept.com/lab/motion/globe.md.
Add Coyote Lab's Globe → arcs animation (dotted globe animation) to my site. Follow https://coyoteconcept.com/lab/motion/globe.md and set CC_MOTION_SETTINGS to match my brand colours.
Questions
How do I add this dotted globe animation to my website?
Download the HTML file from this page and show it with an iframe, or copy its style block and its two scripts into your own page. It needs no libraries or build step.
Can I change the colours?
Yes. Pick a colourway or your own two colours in Tune it, along with the speed, and the code and download change to match. In the file itself it's the CC_MOTION_SETTINGS line near the top.
Is it free to use?
Yes, for personal and commercial projects. Credit and a link to coyoteconcept.com/lab are appreciated but never required.
Does it respect reduced motion?
Yes. For visitors who've asked their device to reduce motion it shows one still frame, and it pauses whenever it's scrolled out of view.
Where does a dotted globe animation work best?
Shipping worldwide, an international client list or a 'where we work' section.