Coin rain call
A closing statement in white and pink italic over a canvas of falling, flipping coins, with a pink download pill and the fine print.
Part of the style
Spinning Coin Night
7 parts that belong together, with their tokens, type and rules.
https://kitbash.me/components/spinning-coin-night/outro/figma.html?palette=7ef8064dfd89d2ff
Use the Figma MCP server (https://mcp.figma.com/mcp). Download https://kitbash.me/components/spinning-coin-night/outro/figma.html?palette=7ef8064dfd89d2ff and pass that whole HTML document to the html_to_figma tool, so the part "Coin rain call" 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 {
--night: #251a1a;
--ink: #fbf4ee;
--ink-dim: rgba(251, 244, 238, 0.5);
--paper: #fbf4ee;
--paper-ink: #251a1a;
--chip: #504444;
--chip-hover: #5f5353;
--rule: rgba(251, 244, 238, 0.14);
--shade: rgba(37, 26, 26, 0.25);
--blush: #a07b75;
--blush-deep: #b78076;
--gold: #a07b75;
--gold-deep: #37211e;
--gold-light: #a58a85;
--gold-glow: rgba(150, 113, 107, 0.35);
}
</style>
<footer class="outro">
<canvas class="outro__canvas" aria-hidden="true"></canvas>
<div class="outro__body">
<h2 class="outro__title">Earn coins <span class="outro__pink">on every chore.</span></h2>
<p class="outro__line">Download the free Pennyweight app and start the first jar tonight.</p>
<a class="outro__button" href="#">Get the app <span aria-hidden="true">↗</span></a>
</div>
<div class="outro__fine">
<span>© 2027 Pennyweight Ltd. Coins have no cash value outside the jar.</span>
<nav class="outro__links" aria-label="Legal">
<a href="#">Privacy</a><a href="#">Terms</a><a href="#">Help</a>
</nav>
</div>
</footer>
<style>
.outro {
position: relative;
display: grid;
grid-template-rows: 1fr auto;
min-height: clamp(600px, 62vw, 860px);
overflow: hidden;
background: var(--grain), var(--night);
color: var(--ink);
}
.outro__canvas {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
color: var(--gold);
}
.outro__body {
position: relative;
z-index: 1;
align-self: center;
display: grid;
justify-items: center;
gap: var(--space-m);
padding: var(--space-xl) var(--edge);
text-align: center;
}
.outro__title {
margin: 0;
font-family: var(--font-display);
font-size: var(--display-l);
font-weight: 900;
font-style: italic;
font-variation-settings: "wdth" var(--wdth-display);
letter-spacing: var(--track-display);
line-height: var(--lead-display);
text-wrap: balance;
}
.outro__pink {
display: block;
color: var(--blush);
}
.outro__line {
margin: 0;
font-size: var(--text-s);
}
.outro__button {
display: inline-flex;
align-items: center;
gap: var(--space-xs);
min-height: 52px;
padding: 0 var(--space-l);
border-radius: var(--radius-pill);
background: var(--blush);
color: var(--paper-ink);
font-weight: 700;
text-decoration: none;
transition: background var(--time) var(--ease), transform var(--time) var(--ease);
}
.outro__button:hover,
.outro__button:focus-visible { background: var(--blush-deep); transform: translateY(-3px); }
.outro__fine {
position: relative;
z-index: 1;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
gap: var(--space-xs) var(--space-m);
padding: var(--space-s) var(--edge);
border-top: var(--line) solid var(--rule);
background: var(--night);
color: var(--ink-dim);
font-size: var(--text-xs);
}
.outro__links { display: flex; gap: var(--space-xs); }
.outro__links a {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: var(--tap);
min-height: var(--tap);
padding: 0 var(--space-xs);
color: var(--ink-dim);
text-decoration: none;
transition: color var(--time) var(--ease);
}
.outro__links a:hover { color: var(--blush); }
@media (max-width: 44rem) {
.outro__title { font-size: clamp(44px, 13vw, 72px); }
.outro__fine { justify-content: center; text-align: center; }
}
</style>
<script>
(() => {
const still = matchMedia('(prefers-reduced-motion: reduce)');
// Coins fall and flip: each is an ellipse whose width follows the cosine of its turn, so it reads as a spinning disc.
function makeCoins(count) {
return Array.from({ length: count }, (_, i) => ({
x: (i + 0.5) / count + (Math.random() - 0.5) * 0.08,
y: Math.random(),
size: 0.6 + Math.random() * 0.7,
speed: 0.05 + Math.random() * 0.06,
turn: Math.random() * Math.PI * 2,
turnSpeed: 1.2 + Math.random() * 1.4,
tilt: (Math.random() - 0.5) * 0.6,
}));
}
function paint(context, width, height, seconds, coins, colours) {
context.clearRect(0, 0, width, height);
const base = Math.max(28, Math.min(width, 1400) * 0.05);
for (const coin of coins) {
const r = base * coin.size;
const y = ((coin.y + seconds * coin.speed) % 1.2) * (height + r * 4) - r * 2;
const x = coin.x * width;
const turn = coin.turn + seconds * coin.turnSpeed;
const squeeze = Math.cos(turn);
const w = Math.max(0.06, Math.abs(squeeze)) * r;
const edge = r * 0.16 * Math.sign(squeeze || 1) * Math.sqrt(1 - squeeze * squeeze);
context.save();
context.translate(x, y);
context.rotate(coin.tilt);
context.globalAlpha = 0.25 + coin.size * 0.45;
context.fillStyle = colours.deep;
context.beginPath();
context.ellipse(edge, 0, w, r, 0, 0, Math.PI * 2);
context.fill();
const face = context.createRadialGradient(-w * 0.35, -r * 0.4, r * 0.05, 0, 0, r);
face.addColorStop(0, colours.light);
face.addColorStop(0.5, colours.gold);
face.addColorStop(1, colours.deep);
context.fillStyle = face;
context.beginPath();
context.ellipse(0, 0, w, r, 0, 0, Math.PI * 2);
context.fill();
context.strokeStyle = colours.deep;
context.lineWidth = Math.max(1, r * 0.06);
context.beginPath();
context.ellipse(0, 0, w * 0.74, r * 0.74, 0, 0, Math.PI * 2);
context.stroke();
context.restore();
}
}
function run(canvas) {
const context = canvas.getContext('2d');
const style = getComputedStyle(canvas);
const colours = {
light: style.getPropertyValue('--gold-light').trim(),
gold: style.getPropertyValue('--gold').trim(),
deep: style.getPropertyValue('--gold-deep').trim(),
};
let coins = [];
let frame = 0;
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);
coins = makeCoins(canvas.clientWidth < 600 ? 6 : 10);
paint(context, canvas.clientWidth, canvas.clientHeight, performance.now() / 1000, coins, colours);
};
const tick = (now) => {
paint(context, canvas.clientWidth, canvas.clientHeight, now / 1000, coins, colours);
frame = requestAnimationFrame(tick);
};
new ResizeObserver(fit).observe(canvas);
new IntersectionObserver(([entry]) => {
cancelAnimationFrame(frame);
if (entry.isIntersecting && !still.matches) frame = requestAnimationFrame(tick);
}).observe(canvas);
}
document.querySelectorAll('.outro__canvas').forEach(run);
})();
</script>