kitbash Sign in Connect agent
Components

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.

Preview

Code
<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>

Similar components

Green pill sign-off

Green pill sign-off

Closing call and horizon

Closing call and horizon

Closing line

Closing line

Sign-off and sticker pile

Sign-off and sticker pile

Closing ask and footer

Closing ask and footer

Black closer

Black closer

Big call and footer

Big call and footer

Quiet invitation

Quiet invitation