kitbash Sign in Connect agent
Components

Spinning coin hero

The signature: 'Earn' over a second word that swaps every few seconds, in giant wide italic type, with two glossy gold coins turning in 3D across the letters, a dim two-line intro and store buttons along the bottom.

Part of the style

Spinning Coin Night

7 parts that belong together, with their tokens, type and rules.

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --night: #dfe4e8;
  --ink: #030101;
  --ink-dim: rgba(3, 1, 1, 0.5);
  --paper: #030101;
  --paper-ink: #dfe4e8;
  --chip: #a2a7ab;
  --chip-hover: #8f9498;
  --rule: rgba(3, 1, 1, 0.14);
  --shade: rgba(223, 228, 232, 0.25);
  --blush: #a73c13;
  --blush-deep: #a53a11;
  --gold: #a73c13;
  --gold-deep: #c25f3f;
  --gold-light: #f18c6b;
  --gold-glow: rgba(240, 96, 44, 0.35);
}
</style>

<section class="hero">
  <h1 class="hero__title">
    <span class="hero__line">Earn</span>
    <span class="hero__words" aria-live="off">
      <span class="hero__word is-active">Coins</span>
      <span class="hero__word">Cash</span>
      <span class="hero__word">Dough</span>
      <span class="hero__word">Stash</span>
    </span>
  </h1>

  <span class="hero__coin hero__coin--a" aria-hidden="true">
    <span class="hero__spin">
      <span class="hero__layer hero__layer--back"></span>
      <span class="hero__layer hero__layer--edge" style="--z: -3px"></span>
      <span class="hero__layer hero__layer--edge" style="--z: -1px"></span>
      <span class="hero__layer hero__layer--edge" style="--z: 1px"></span>
      <span class="hero__layer hero__layer--edge" style="--z: 3px"></span>
      <span class="hero__layer hero__layer--front"></span>
    </span>
  </span>
  <span class="hero__coin hero__coin--b" aria-hidden="true">
    <span class="hero__spin">
      <span class="hero__layer hero__layer--back"></span>
      <span class="hero__layer hero__layer--edge" style="--z: -3px"></span>
      <span class="hero__layer hero__layer--edge" style="--z: -1px"></span>
      <span class="hero__layer hero__layer--edge" style="--z: 1px"></span>
      <span class="hero__layer hero__layer--edge" style="--z: 3px"></span>
      <span class="hero__layer hero__layer--front"></span>
    </span>
  </span>

  <div class="hero__foot">
    <p class="hero__intro">Earn pocket money for the chores you already do. <br>Dishes, dog walks, homework streaks: it all adds up in one jar.</p>
    <div class="hero__stores">
      <a class="hero__store" href="#">
        <svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M11 8.4c0-1.6 1.3-2.3 1.3-2.4-.7-1-1.8-1.2-2.2-1.2-.9-.1-1.8.6-2.3.6s-1.2-.5-2-.5C4.8 4.9 3 6 3 8.6c0 1.6.6 3.2 1.4 4.3.6.8 1.1 1.5 1.9 1.5s1-.5 2-.5 1.2.5 2 .5 1.3-.8 1.8-1.5c.6-.8.8-1.6.8-1.7 0 0-1.9-.7-1.9-2.8zM9.6 3.6c.4-.5.7-1.2.6-1.9-.6 0-1.3.4-1.8.9-.4.4-.7 1.1-.6 1.8.7.1 1.4-.3 1.8-.8z" fill="currentColor"/></svg>
        <span class="hero__store-text">App Store<small>4.8 ★</small></span>
      </a>
      <a class="hero__store" href="#">
        <svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M3 1.5v13L14 8z" fill="currentColor"/></svg>
        <span class="hero__store-text">Play Store<small>4.7 ★</small></span>
      </a>
    </div>
  </div>
</section>

<style>
  .hero {
    position: relative;
    display: grid;
    grid-template-rows: 1fr auto;
    min-height: clamp(600px, 64vw, 880px);
    padding: var(--space-xl) var(--edge) var(--space-m);
    overflow: hidden;
    background: var(--grain), var(--night);
    color: var(--ink);
  }

  .hero__title {
    position: relative;
    z-index: 1;
    align-self: center;
    display: grid;
    justify-items: center;
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--display-xl);
    font-weight: 900;
    font-style: italic;
    font-variation-settings: "wdth" var(--wdth-display);
    letter-spacing: var(--track-display);
    line-height: var(--lead-display);
    text-align: center;
  }
  .hero__line { display: block; }
  .hero__words {
    position: relative;
    display: block;
    width: 100%;
    height: 1em;
    margin-top: 0.02em;
  }
  .hero__word {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    white-space: nowrap;
    opacity: 0;
    filter: blur(8px);
    transform: translateY(0.7em);
    color: var(--ink-dim);
    transition: opacity var(--time-word) var(--ease), transform var(--time-word) var(--ease), filter var(--time-word) var(--ease), color var(--time-word) var(--ease);
  }
  .hero__word.is-active {
    opacity: 1;
    filter: none;
    transform: none;
    color: var(--ink);
  }
  .hero__word.is-leaving {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(-0.6em) scale(0.96);
  }

  /* A coin: two gold faces with four darker layers between them, turned as one in 3D. */
  .hero__coin {
    position: absolute;
    z-index: 2;
    width: var(--size);
    height: var(--size);
    perspective: 600px;
    pointer-events: none;
  }
  .hero__coin::after {
    content: "";
    position: absolute;
    inset: 10%;
    z-index: -1;
    border-radius: 50%;
    box-shadow: var(--glow);
  }
  .hero__coin--a { --size: clamp(64px, 8.5vw, 124px); --delay: 0s; top: 16%; left: calc(50% - clamp(150px, 26vw, 390px)); }
  .hero__coin--b { --size: clamp(72px, 9.5vw, 138px); --delay: -1.7s; top: 52%; left: calc(50% + clamp(90px, 17vw, 260px)); }
  .hero__spin {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    animation: hero-spin var(--spin) linear var(--delay) infinite;
  }
  .hero__layer {
    position: absolute;
    inset: 0;
    border-radius: 50%;
  }
  .hero__layer--edge {
    background: var(--gold-deep);
    transform: translateZ(var(--z));
  }
  .hero__layer--front,
  .hero__layer--back {
    background:
      radial-gradient(circle at 50% 50%, transparent 60%, var(--gold-deep) 61%, var(--gold) 64%, transparent 65%),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 24c2.6 15.5 10.5 23.4 26 26-15.5 2.6-23.4 10.5-26 26-2.6-15.5-10.5-23.4-26-26 15.5-2.6 23.4-10.5 26-26z' fill='%23b47a08' opacity='.85'/%3E%3Cpath d='M50 27c2 12 7 19 20 22' fill='none' stroke='%23fff3b8' stroke-width='2' opacity='.7'/%3E%3C/svg%3E") center / 100% no-repeat,
      radial-gradient(circle at 34% 28%, var(--gold-light), var(--gold) 45%, var(--gold-deep) 100%);
    box-shadow: inset 0 0 0 3px var(--gold-deep), inset -6px -8px 14px var(--shade);
  }
  .hero__layer--front { transform: translateZ(5px); }
  .hero__layer--back { transform: rotateY(180deg) translateZ(5px); }
  @keyframes hero-spin {
    from { transform: rotateX(14deg) rotateY(0deg); }
    to { transform: rotateX(14deg) rotateY(360deg); }
  }

  .hero__foot {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--space-m);
  }
  .hero__intro {
    max-width: 36em;
    margin: 0;
    color: var(--ink);
    font-size: var(--text-xs);
    line-height: 1.6;
  }
  .hero__stores {
    display: flex;
    gap: var(--space-xs);
  }
  .hero__store {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    min-height: var(--tap);
    padding: 6px 14px 6px 12px;
    border-radius: var(--radius-s);
    background: var(--chip);
    color: var(--ink);
    text-decoration: none;
    transition: background var(--time) var(--ease), transform var(--time) var(--ease);
  }
  .hero__store:hover,
  .hero__store:focus-visible {
    background: var(--chip-hover);
    transform: translateY(-2px);
  }
  .hero__store-text {
    display: grid;
    font-size: var(--text-xs);
    line-height: 1.2;
  }
  .hero__store-text small {
    color: var(--ink-dim);
    font-size: 10px;
  }

  @media (max-width: 44rem) {
    .hero { min-height: 640px; padding-top: var(--space-l); }
    .hero__title { font-size: clamp(52px, 19vw, 96px); }
    .hero__coin--a { top: 18%; left: 6%; }
    .hero__coin--b { top: auto; bottom: 26%; left: auto; right: 8%; }
    .hero__foot { flex-direction: column; align-items: center; text-align: center; }
    .hero__intro { font-size: var(--text-s); }
    .hero__intro br { display: none; }
  }

  @media (prefers-reduced-motion: reduce) {
    .hero__spin { animation: none; transform: rotateX(10deg) rotateY(-28deg); }
    .hero__word { transition: none; }
  }
</style>

<script>
  (() => {
    const still = matchMedia('(prefers-reduced-motion: reduce)');
    for (const root of document.querySelectorAll('.hero')) {
      const words = [...root.querySelectorAll('.hero__word')];
      if (words.length < 2) continue;
      let index = 0;
      let timer = 0;
      let visible = true;
      const step = () => {
        const old = words[index];
        index = (index + 1) % words.length;
        const next = words[index];
        old.classList.remove('is-active');
        old.classList.add('is-leaving');
        next.classList.remove('is-leaving');
        next.classList.add('is-active');
        setTimeout(() => old.classList.remove('is-leaving'), 700);
      };
      const run = () => {
        clearInterval(timer);
        if (visible && !still.matches) timer = setInterval(step, 2400);
      };
      new IntersectionObserver(([entry]) => { visible = entry.isIntersecting; run(); }).observe(root);
      still.addEventListener('change', run);
    }
  })();
</script>

Similar components

Swinging badge hero

Swinging badge hero

Phone stage hero

Phone stage hero

Hero

Hero

Opening line

Opening line

Centred hero with foil word

Centred hero with foil word

Mark and standfirst

Mark and standfirst

Lobby Kiosk

Lobby Kiosk

Tablet on the lawn

Tablet on the lawn