kitbash Sign in Connect agent
Components

Depth thumbnail cloud

A drifting cloud of small thumbnails at different depths beside one case caption and pill.

Part of the style

Staggered Black Folio

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

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --page: #dfd9d2;
  --ink: #09121f;
  --ink-soft: #454e5a;
  --ink-mute: #766d63;
  --stage: #a0988e;
  --stage-light: #1f2835;
  --paper: #09121f;
  --paper-ink: #dfd9d2;
  --rule: #afa79e;
  --flat-orange: #a66b47;
  --flat-yellow: #497abd;
  --flat-green: #557bb0;
  --flat-blue: #a66b47;
}
</style>

<section class="cloud">
  <div class="cloud__caption">
    <h2 class="cloud__title">Common Ground Archive</h2>
    <p class="cloud__note">A shared picture library for eleven small museums, built as one drifting index.</p>
    <a class="cloud__pill" href="#">View case study</a>
  </div>
  <div class="cloud__field">
    <img class="cloud__thumb" style="--x: 6;  --y: 10; --z: 0.9;" src="assets/palmhouse.jpg" alt="" width="1118" height="1200" loading="eager">
    <img class="cloud__thumb" style="--x: 22; --y: 52; --z: 0.5;" src="assets/harbor.jpg" alt="" width="800" height="508" loading="eager">
    <img class="cloud__thumb" style="--x: 34; --y: 18; --z: 0.4;" src="assets/specimens.jpg" alt="" width="656" height="800" loading="eager">
    <img class="cloud__thumb" style="--x: 44; --y: 64; --z: 1;   " src="assets/teapot.jpg" alt="" width="843" height="674" loading="eager">
    <img class="cloud__thumb" style="--x: 52; --y: 6;  --z: 0.7;" src="assets/vase.jpg" alt="" width="918" height="1200" loading="eager">
    <img class="cloud__thumb" style="--x: 64; --y: 40; --z: 0.45;" src="assets/chair.jpg" alt="" width="578" height="800" loading="eager">
    <img class="cloud__thumb" style="--x: 74; --y: 12; --z: 0.6;" src="assets/nocturne.jpg" alt="" width="1200" height="793" loading="eager">
    <img class="cloud__thumb" style="--x: 82; --y: 60; --z: 0.85;" src="assets/jar.jpg" alt="" width="525" height="800" loading="eager">
    <img class="cloud__thumb" style="--x: 12; --y: 78; --z: 0.6;" src="assets/vase.jpg" alt="" width="918" height="1200" loading="eager">
    <img class="cloud__thumb" style="--x: 90; --y: 30; --z: 0.35;" src="assets/specimens.jpg" alt="" width="656" height="800" loading="eager">
    <img class="cloud__thumb" style="--x: 30; --y: 86; --z: 0.4;" src="assets/chair.jpg" alt="" width="578" height="800" loading="eager">
    <img class="cloud__thumb" style="--x: 60; --y: 82; --z: 0.55;" src="assets/harbor.jpg" alt="" width="800" height="508" loading="eager">
    <img class="cloud__thumb" style="--x: 2;  --y: 44; --z: 0.38;" src="assets/teapot.jpg" alt="" width="843" height="674" loading="eager">
    <img class="cloud__thumb" style="--x: 40; --y: 38; --z: 0.3;" src="assets/palmhouse.jpg" alt="" width="1118" height="1200" loading="eager">
  </div>
</section>

<style>
  .cloud {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gap);
    align-items: end;
    padding: var(--space-l) var(--edge) var(--section-space);
  }
  .cloud__caption {
    grid-column: 1 / 4;
    display: grid;
    justify-items: start;
    gap: var(--space-s);
    padding-bottom: var(--space-l);
  }
  .cloud__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-m);
    font-weight: 400;
    line-height: 1.4;
  }
  .cloud__note {
    margin: 0;
    color: var(--ink-soft);
    font-size: var(--text-s);
  }
  .cloud__pill {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: 0 28px;
    border: var(--line) solid var(--ink);
    border-radius: var(--radius-pill);
    color: var(--ink);
    font-size: var(--text-s);
    font-weight: 500;
    text-decoration: none;
    transition: background-color var(--quick) linear, color var(--quick) linear;
  }
  .cloud__pill:hover,
  .cloud__pill:focus-visible {
    background: var(--ink);
    color: var(--page);
    outline: none;
  }
  .cloud__field {
    grid-column: 4 / -1;
    position: relative;
    height: clamp(360px, 40vw, 560px);
    overflow: hidden;
  }
  .cloud__thumb {
    position: absolute;
    left: calc(var(--x) * 1%);
    top: calc(var(--y) * 1%);
    width: calc(var(--z) * clamp(64px, 8vw, 120px));
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--radius-frame);
    filter: brightness(calc(0.35 + var(--z) * 0.65));
    z-index: calc(var(--z) * 100);
    translate: var(--dx, 0) var(--dy, 0);
    transition: filter var(--quick) linear;
  }
  .cloud__thumb:hover {
    filter: brightness(1);
  }

  @media (max-width: 40rem) {
    .cloud__caption {
      grid-column: 1 / -1;
      order: 2;
      padding-bottom: 0;
      padding-top: var(--space-m);
    }
    .cloud__field {
      grid-column: 1 / -1;
      height: 360px;
    }
    .cloud__thumb {
      width: calc(var(--z) * 88px);
    }
  }
</style>

<script>
(() => {
  const still = matchMedia('(prefers-reduced-motion: reduce)').matches;
  for (const root of document.querySelectorAll('.cloud')) {
    const field = root.querySelector('.cloud__field');
    const thumbs = [...root.querySelectorAll('.cloud__thumb')].map((el, i) => ({
      el,
      z: parseFloat(getComputedStyle(el).getPropertyValue('--z')) || 0.5,
      phase: i * 1.7,
    }));
    if (still) continue;
    let running = false;
    let frame = 0;
    let start = performance.now();
    const step = (now) => {
      const t = (now - start) / 1000;
      const reach = field.clientWidth * 0.05;
      for (const thumb of thumbs) {
        // Nearer thumbnails swing wider and faster, so the cloud reads in depth.
        const dx = Math.sin(t * 0.3 * (0.5 + thumb.z) + thumb.phase) * reach * thumb.z;
        const dy = Math.cos(t * 0.22 * (0.5 + thumb.z) + thumb.phase) * 14 * thumb.z;
        thumb.el.style.setProperty('--dx', dx.toFixed(1) + 'px');
        thumb.el.style.setProperty('--dy', dy.toFixed(1) + 'px');
      }
      frame = requestAnimationFrame(step);
    };
    new IntersectionObserver(([entry]) => {
      if (entry.isIntersecting && !running) {
        running = true;
        frame = requestAnimationFrame(step);
      } else if (!entry.isIntersecting && running) {
        running = false;
        cancelAnimationFrame(frame);
      }
    }).observe(root);
  }
})();
</script>

Similar components

Numbered tile index

Numbered tile index

Green flood

Green flood

Drifting tile wall

Drifting tile wall

Grey print tiles

Grey print tiles

Loose project grid

Loose project grid

Edge-to-edge picture rail

Edge-to-edge picture rail

Work rail

Work rail

Line-screen archive

Line-screen archive