kitbash Sign in Connect agent
Components

Band and case accordion

A black band of bold words with spinning sage stars running forever, then a two-face heading and a row of 40px case cards that widen on hover or focus, each with a drawn scene, a white caps label and a turning plus.

Part of the style

Glass Garden

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

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --stone: #6fa0ff;
  --stone-light: #85adfb;
  --stone-shade: #6a98f3;
  --paper: #000007;
  --mist: #83abf8;
  --ink: #0f111b;
  --ink-soft: #242841;
  --charcoal: #161a3a;
  --graphite: #2b315c;
  --ash: #5174b8;
  --sage-mid: #5470a5;
  --sage-pale: #6591e7;
  --forest: #272c4e;
  --line: rgba(15, 17, 27, 0.1);
  --grid-line: rgba(15, 17, 27, 0.045);
  --spot: rgba(145, 182, 252, 0.15);
  --shadow: rgba(15, 17, 27, 0.1);
  --glass: rgba(132, 173, 250, 0.55);
  --linen: #7ba7fd;
  --sand: #6a98f3;
  --pool: #648fe4;
  --stone-deep: #6490e4;
  --glass-light: #85adfb;
  --glass-shadow: #4968a5;
  --sage: #866f5a;
  --lime: #fdc998;
  --pearl-1: #f0bd8c;
  --sticker-leaf: #734303;
  --mint-card: #ad8e71;
  --pearl-4: #727e9d;
  --sand-deep: #7b8190;
  --sticker-lemon: #687dba;
  --horn: #727d9a;
  --pearl-2: #6d86ba;
  --sticker-rose: #597cca;
  --rose-light: #6b87c4;
  --pearl-3: #927b66;
  --sticker-terracotta: #727e9d;
  --sticker-azul: #576ea1;
}
</style>

<section class="cases" aria-labelledby="cases-title-1">
  <div class="cases__band" aria-hidden="true">
    <div class="cases__track">
      <span class="cases__phrase">Let’s grow your project<svg class="cases__star" viewBox="0 0 40 40"><path d="M20 2c2 12 6 16 18 18-12 2-16 6-18 18-2-12-6-16-18-18 12-2 16-6 18-18z" transform="rotate(45 20 20)"/></svg></span>
      <span class="cases__phrase">Let’s grow your project<svg class="cases__star" viewBox="0 0 40 40"><path d="M20 2c2 12 6 16 18 18-12 2-16 6-18 18-2-12-6-16-18-18 12-2 16-6 18-18z" transform="rotate(45 20 20)"/></svg></span>
      <span class="cases__phrase">Let’s grow your project<svg class="cases__star" viewBox="0 0 40 40"><path d="M20 2c2 12 6 16 18 18-12 2-16 6-18 18-2-12-6-16-18-18 12-2 16-6 18-18z" transform="rotate(45 20 20)"/></svg></span>
    </div>
  </div>

  <h2 class="cases__title" id="cases-title-1"><span class="cases__kicker">Discover our</span><span class="cases__caps">Latest case studies</span></h2>

  <ul class="cases__row">
    <li class="cases__card cases__card--mint is-open">
      <a class="cases__link" href="#">
        <svg class="cases__art" viewBox="0 0 800 600" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
          <rect width="800" height="600" class="cases__fill-mint"/>
          <g transform="translate(400 300)">
            <path d="M0-150L260-20 0 110-260-20z" class="cases__fill-paper"/>
            <path d="M-260-20L0 110v40l-260-130z" class="cases__fill-stone-shade"/>
            <path d="M260-20L0 110v40l260-130z" class="cases__fill-stone"/>
            <path d="M-120-60L40-140l120 60-160 80z" class="cases__fill-pale"/>
            <path d="M-40-20L60-70l70 35L30 15z" class="cases__fill-pool"/>
            <g class="cases__fill-leaf"><ellipse cx="-150" cy="-10" rx="26" ry="14"/><ellipse cx="-90" cy="20" rx="26" ry="14"/><ellipse cx="-30" cy="50" rx="26" ry="14"/><ellipse cx="150" cy="-10" rx="26" ry="14"/><ellipse cx="90" cy="20" rx="26" ry="14"/></g>
            <g class="cases__fill-sage"><ellipse cx="-150" cy="-22" rx="18" ry="16"/><ellipse cx="-90" cy="8" rx="18" ry="16"/><ellipse cx="-30" cy="38" rx="18" ry="16"/><ellipse cx="150" cy="-22" rx="18" ry="16"/><ellipse cx="90" cy="8" rx="18" ry="16"/></g>
            <path d="M-200-20l40 20M180-50l40 20" class="cases__line-ink"/>
            <circle cx="40" cy="-140" r="6" class="cases__fill-lime"/>
          </g>
        </svg>
        <span class="cases__label">Quinta do Rio, courtyard for a winery</span>
        <span class="cases__plus" aria-hidden="true"><svg viewBox="0 0 16 16"><path d="M8 2v12M2 8h12"/></svg></span>
      </a>
    </li>
    <li class="cases__card cases__card--night">
      <a class="cases__link" href="#">
        <svg class="cases__art" viewBox="0 0 800 600" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
          <rect width="800" height="600" class="cases__fill-night"/>
          <g class="cases__line-lime" fill="none"><circle cx="400" cy="300" r="190"/><circle cx="400" cy="300" r="130"/><circle cx="400" cy="300" r="70"/><path d="M400 60v480M160 300h480"/></g>
          <g class="cases__fill-sage"><circle cx="266" cy="166" r="30"/><circle cx="534" cy="166" r="30"/><circle cx="266" cy="434" r="30"/><circle cx="534" cy="434" r="30"/></g>
          <circle cx="400" cy="300" r="14" class="cases__fill-lime"/>
        </svg>
        <span class="cases__label">Praça Nova, a square that cools its street</span>
        <span class="cases__plus" aria-hidden="true"><svg viewBox="0 0 16 16"><path d="M8 2v12M2 8h12"/></svg></span>
      </a>
    </li>
    <li class="cases__card cases__card--stone">
      <a class="cases__link" href="#">
        <svg class="cases__art" viewBox="0 0 800 600" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
          <rect width="800" height="600" class="cases__fill-stone-shade"/>
          <g class="cases__fill-stone"><path d="M220 600V280a80 80 0 0 1 160 0v320z"/><path d="M420 600V280a80 80 0 0 1 160 0v320z"/></g>
          <g class="cases__fill-paper"><path d="M250 600V290a50 50 0 0 1 100 0v310z"/><path d="M450 600V290a50 50 0 0 1 100 0v310z"/></g>
          <g class="cases__fill-leaf"><circle cx="300" cy="540" r="40"/><circle cx="500" cy="540" r="40"/><circle cx="270" cy="560" r="26"/><circle cx="530" cy="560" r="26"/></g>
          <path d="M180 200h440" class="cases__line-ink"/>
          <circle cx="620" cy="140" r="30" class="cases__fill-butter"/>
        </svg>
        <span class="cases__label">Casa Alta, a terrace over the river</span>
        <span class="cases__plus" aria-hidden="true"><svg viewBox="0 0 16 16"><path d="M8 2v12M2 8h12"/></svg></span>
      </a>
    </li>
    <li class="cases__card cases__card--mist">
      <a class="cases__link" href="#">
        <svg class="cases__art" viewBox="0 0 800 600" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
          <rect width="800" height="600" class="cases__fill-mist"/>
          <g class="cases__fill-sage"><path d="M400 560C380 420 420 260 560 160c-10 160-60 300-160 400z"/><path d="M400 560C420 420 380 280 240 200c10 150 60 280 160 360z"/></g>
          <path d="M400 560c40-140 80-260 160-400M400 560c-40-130-80-240-160-360" class="cases__line-pale" fill="none"/>
          <circle cx="560" cy="160" r="10" class="cases__fill-terracotta"/>
        </svg>
        <span class="cases__label">Jardim do Bonfim, a school garden</span>
        <span class="cases__plus" aria-hidden="true"><svg viewBox="0 0 16 16"><path d="M8 2v12M2 8h12"/></svg></span>
      </a>
    </li>
  </ul>
</section>

<style>
  .cases { padding: 0 0 var(--space-xl); background: var(--stone); color: var(--ink); overflow: hidden; }

  .cases__band { overflow: hidden; background: var(--ink); color: var(--paper); }
  .cases__track { display: flex; width: max-content; animation: cases-roll 26s linear infinite; }
  .cases:not(.is-live) .cases__track,
  .cases:not(.is-live) .cases__star { animation-play-state: paused; }
  .cases__phrase {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 34px;
    padding: 24px 34px 24px 0;
    font: 700 var(--band-size)/1 var(--font-body);
    letter-spacing: 1px;
    white-space: nowrap;
  }
  .cases__star {
    width: 1.12em;
    height: 1.12em;
    fill: var(--sage);
    animation: cases-turn var(--spin-slow) linear infinite;
  }
  .cases.is-reversed .cases__star { animation-name: cases-turn-back; }
  @keyframes cases-roll { to { transform: translateX(-50%); } }
  @keyframes cases-turn { to { transform: rotate(1turn); } }
  @keyframes cases-turn-back { to { transform: rotate(-1turn); } }

  .cases__title { display: grid; margin: var(--space-l) var(--edge) var(--space-m); font-weight: 400; }
  .cases__kicker { font: 400 var(--head-s)/1.1 var(--font-display); }
  .cases__caps { font: 400 var(--head-l)/1 var(--font-condensed); text-transform: uppercase; letter-spacing: -0.005em; }

  .cases__row {
    display: flex;
    gap: 10px;
    height: clamp(340px, 34vw, 560px);
    margin: 0;
    padding: 0 var(--edge);
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .cases__row::-webkit-scrollbar { display: none; }
  .cases__card {
    position: relative;
    flex: none;
    width: clamp(120px, 21vw, 300px);
    overflow: hidden;
    border-radius: var(--radius-xl);
    transition: width var(--time) var(--ease-case);
  }
  .cases__card.is-open { width: 65%; }
  .cases__link { position: absolute; inset: 0; display: block; color: var(--ink); text-decoration: none; }
  .cases__link:focus-visible { outline: 3px solid var(--sage); outline-offset: -6px; border-radius: var(--radius-xl); }
  .cases__art { width: 100%; height: 100%; transition: transform var(--time) var(--ease-case); }
  .cases__card.is-open .cases__art { transform: scale(1.03); }
  .cases__label {
    position: absolute;
    left: 16px;
    bottom: 16px;
    max-width: calc(100% - 32px);
    padding: 12px 16px;
    border-radius: 6px;
    background: var(--paper);
    font: 400 var(--text-s)/1.2 var(--font-condensed);
    font-size: 15px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity var(--time) var(--ease), transform var(--time) var(--ease);
  }
  .cases__card.is-open .cases__label { opacity: 1; transform: none; transition-delay: 0.2s; }
  .cases__plus {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    place-items: center;
    width: var(--tap);
    height: var(--tap);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    color: var(--ink);
    transition: transform var(--time) var(--ease), background-color var(--time) var(--ease), color var(--time) var(--ease);
  }
  .cases__plus svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: scale var(--time) var(--ease); }
  .cases__link:hover .cases__plus,
  .cases__link:focus-visible .cases__plus { transform: rotate(45deg); background: var(--ink); color: var(--paper); }
  .cases__link:hover .cases__plus svg { scale: 1.1; }

  .cases__fill-mint { fill: var(--mint-card); }
  .cases__fill-paper { fill: var(--paper); }
  .cases__fill-stone { fill: var(--stone); }
  .cases__fill-stone-shade { fill: var(--stone-shade); }
  .cases__fill-pale { fill: var(--sage-pale); }
  .cases__fill-pool { fill: var(--mist); }
  .cases__fill-leaf { fill: var(--sticker-leaf); }
  .cases__fill-sage { fill: var(--sage); }
  .cases__fill-lime { fill: var(--lime); }
  .cases__fill-night { fill: var(--forest); }
  .cases__fill-butter { fill: var(--pearl-4); }
  .cases__fill-mist { fill: var(--mist); }
  .cases__fill-terracotta { fill: var(--sticker-terracotta); }
  .cases__line-ink { stroke: var(--ink); stroke-width: 3; }
  .cases__line-lime { stroke: var(--lime); stroke-width: 2; }
  .cases__line-pale { stroke: var(--sage-pale); stroke-width: 3; }

  @media (max-width: 700px) {
    .cases__row { height: 440px; }
    .cases__card { width: 76px; }
    .cases__card.is-open { width: calc(100% - 172px); min-width: 200px; }
    .cases__label { white-space: normal; }
  }
  @media (prefers-reduced-motion: reduce) {
    .cases__track, .cases__star { animation: none; }
  }
</style>

<script>
(() => {
  function setUp(root) {
    const track = root.querySelector('.cases__track');
    for (const phrase of [...track.children]) track.append(phrase.cloneNode(true));

    const cards = [...root.querySelectorAll('.cases__card')];
    const open = (card) => {
      for (const other of cards) other.classList.toggle('is-open', other === card);
    };
    for (const card of cards) {
      const link = card.querySelector('.cases__link');
      card.addEventListener('pointerenter', () => open(card));
      link.addEventListener('focus', () => open(card));
      link.addEventListener('click', (event) => {
        if (card.classList.contains('is-open')) return;
        event.preventDefault();
        open(card);
      });
    }

    let lastScroll = scrollY;
    addEventListener('scroll', () => {
      root.classList.toggle('is-reversed', scrollY < lastScroll);
      lastScroll = scrollY;
    }, { passive: true });

    new IntersectionObserver(([entry]) => root.classList.toggle('is-live', entry.isIntersecting)).observe(root);
  }

  document.querySelectorAll('.cases').forEach(setUp);
})();
</script>

Similar components

Project windows

Project windows

Scrapbook board

Scrapbook board

Inset project tiles

Inset project tiles

Work cloud

Work cloud

Work grid with pill

Work grid with pill

Artefact scatter

Artefact scatter

Work globe

Work globe

Shelf drawing

Shelf drawing