kitbash Sign in Connect agent
Components

Work cloud

A slowly turning sphere of mock thumbnails behind a hairline title; hovering a project name lights its tiles and shows its tools.

Part of the style

Teal Haze Lab

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

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --field: #c7c1b4;
  --ink: #27140e;
  --night: #200f0a;
  --night-ink: #fffcf5;
  --screen: #4b3731;
  --screen-ink: #fffcf5;
  --paper: #fffcf5;
  --ray: #bba48f;
  --glow: #948373;
  --field-deep: #806557;
  --field-bright: #ae8169;
  --lilac: #96806b;
  --pink: #997c6d;
}
</style>

<section class="work">
  <h2 class="work__title">Selected<br>Work</h2>
  <div class="work__cloud" aria-hidden="true"></div>
  <ol class="work__list">
    <li class="work__row"><a class="work__project" href="#" data-project="0">Tide Choir</a><span class="work__tools">Hydrophones, Max, Pier 9</span></li>
    <li class="work__row"><a class="work__project" href="#" data-project="1">Glasshouse Hum</a><span class="work__tools">Contact mics, DMX</span></li>
    <li class="work__row"><a class="work__project" href="#" data-project="2">Night Ferry Radio</a><span class="work__tools">FM, tape loops</span></li>
    <li class="work__row"><a class="work__project" href="#" data-project="3">Salt Organ</a><span class="work__tools">Pipes, wind sensors</span></li>
    <li class="work__row"><a class="work__project" href="#" data-project="4">Ember Room</a><span class="work__tools">LED, granular synth</span></li>
  </ol>
</section>

<style>
  .work {
    position: relative;
    isolation: isolate;
    height: clamp(600px, 56vw, 820px);
    padding: var(--space-m) var(--edge);
    overflow: hidden;
    color: var(--ink);
    --work-glow-y: 58%;
    background: radial-gradient(circle at 50% var(--work-glow-y), color-mix(in srgb, var(--glow) 55%, transparent), transparent 34%);
  }
  .work__title {
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    top: var(--space-m);
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--display-l);
    font-weight: var(--display-weight);
    font-stretch: var(--display-stretch);
    line-height: 0.82;
    letter-spacing: var(--display-track);
    text-align: center;
    pointer-events: none;
  }
  .work__cloud {
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
  }
  .work__tile {
    --depth: 1;
    position: absolute;
    left: 0;
    top: 0;
    width: clamp(40px, 6.4vw, 104px);
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: var(--radius);
    opacity: calc(0.35 + var(--depth) * 0.65);
    transition: opacity var(--slow) var(--ease-out), filter var(--slow) var(--ease-out);
    will-change: transform;
  }
  .work__tile--wide { width: clamp(52px, 8.6vw, 140px); }
  .work__tile--tall { aspect-ratio: 4 / 5; }
  .work.is-focused .work__tile:not(.is-lit) {
    opacity: 0.1;
    filter: blur(1px);
  }
  .work__tile i {
    position: absolute;
    display: block;
  }

  .work__tile--dark { background: var(--screen); }
  .work__tile--dark i:nth-child(1) { left: 8%; top: 22%; width: 54%; height: 9%; background: var(--screen-ink); box-shadow: 0 8px 0 var(--screen-ink); }
  .work__tile--dark i:nth-child(2) { left: -5%; right: -5%; bottom: 10%; height: 9%; background: var(--ray); rotate: -3deg; }
  .work__tile--paper { background: var(--paper); }
  .work__tile--paper i:nth-child(1) { left: 8%; top: 12%; width: 40%; height: 6%; background: var(--ink); }
  .work__tile--paper i:nth-child(2) { left: 8%; right: 8%; bottom: 10%; height: 50%; background: linear-gradient(90deg, var(--field-deep) 0 30%, transparent 30% 35%, var(--glow) 35% 65%, transparent 65% 70%, var(--screen) 70%); }
  .work__tile--lilac { background: var(--lilac); }
  .work__tile--lilac i:nth-child(1) { left: 10%; top: 18%; width: 46%; height: 8%; background: var(--paper); box-shadow: 0 7px 0 var(--paper); }
  .work__tile--lilac i:nth-child(2) { right: 10%; bottom: 12%; width: 34%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--pink), var(--screen)); }
  .work__tile--night { background: var(--night); }
  .work__tile--night i:nth-child(1) { inset: -40%; background: repeating-conic-gradient(from 0deg at 50% 50%, var(--ray) 0deg 5deg, transparent 5deg 36deg); mask-image: radial-gradient(circle, #000, transparent 50%); -webkit-mask-image: radial-gradient(circle, #000, transparent 50%); }
  .work__tile--night i:nth-child(2) { left: 8%; bottom: 10%; width: 40%; height: 8%; background: var(--night-ink); }
  .work__tile--teal { background: var(--field-deep); }
  .work__tile--teal i:nth-child(1) { right: -15%; top: 5%; width: 75%; aspect-ratio: 1; border-radius: 50%; background: repeating-radial-gradient(circle, transparent 0 4px, var(--field-bright) 4px 5px); }
  .work__tile--teal i:nth-child(2) { left: 8%; bottom: 12%; width: 36%; height: 10%; background: var(--screen-ink); }

  .work__list {
    position: relative;
    z-index: 3;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .work__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--gap);
  }
  .work__project {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    font-family: var(--font-display);
    font-size: var(--text-name);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.01em;
    text-transform: none;
    text-decoration: none;
    transition: translate var(--quick) var(--ease);
  }
  .work__project:hover,
  .work__project:focus-visible {
    translate: 10px 0;
    outline: none;
  }
  .work__tools {
    text-align: right;
    opacity: 0.6;
    transition: opacity var(--quick) var(--ease);
  }
  .work__row.is-lit .work__tools {
    opacity: 1;
  }

  @media (max-width: 52rem) {
    .work__list {
      position: absolute;
      left: var(--edge);
      right: var(--edge);
      bottom: var(--space-m);
    }
    .work {
      --work-glow-y: 40%;
      height: 760px;
    }
    .work__title {
      top: var(--space-l);
    }
  }
  @media (max-width: 40rem) {
    .work__tools {
      max-width: 40%;
    }
  }
</style>

<script>
  (() => {
    const still = matchMedia('(prefers-reduced-motion: reduce)');
    const variants = ['dark', 'paper', 'lilac', 'night', 'teal'];
    const shapes = ['', '', 'wide', '', 'tall', 'wide'];
    const tileCount = 28;

    function makeTiles(cloud) {
      return Array.from({ length: tileCount }, (_, index) => {
        const tile = document.createElement('div');
        const project = index % variants.length;
        const variant = variants[(index * 3 + Math.floor(index / 5)) % variants.length];
        const shape = shapes[index % shapes.length];
        tile.className = `work__tile work__tile--${variant}${shape ? ` work__tile--${shape}` : ''}`;
        tile.dataset.project = project;
        tile.innerHTML = '<i></i><i></i>';
        cloud.append(tile);
        const fall = 1 - (2 * index + 1) / tileCount;
        return { tile, y: fall, ring: Math.sqrt(1 - fall * fall), angle: index * Math.PI * (3 - Math.sqrt(5)) };
      });
    }

    function place(work, cloud, points, seconds, nudge) {
      const width = cloud.clientWidth;
      const height = cloud.clientHeight;
      const narrow = width < 832;
      const radius = Math.min(width * (narrow ? 0.4 : 0.3), height * (narrow ? 0.27 : 0.36));
      const centerX = width / 2;
      const centerY = height * (narrow ? 0.38 : 0.56);
      const spin = seconds * 0.12 + nudge.x;
      const tilt = 0.35 + nudge.y;
      const distance = radius * 2.8;
      for (const point of points) {
        const x0 = Math.cos(point.angle + spin) * point.ring;
        const z0 = Math.sin(point.angle + spin) * point.ring;
        const y = point.y * Math.cos(tilt) - z0 * Math.sin(tilt);
        const z = point.y * Math.sin(tilt) + z0 * Math.cos(tilt);
        const scale = distance / (distance - z * radius);
        const depth = (z + 1) / 2;
        const box = point.tile;
        box.style.transform = `translate3d(${centerX + x0 * radius * scale - box.offsetWidth / 2}px, ${centerY + y * radius * scale - box.offsetHeight / 2}px, 0) scale(${scale.toFixed(3)})`;
        box.style.zIndex = Math.round(depth * 100);
        box.style.setProperty('--depth', depth.toFixed(2));
      }
    }

    function focusProject(work, project) {
      work.classList.toggle('is-focused', project !== null);
      work.querySelectorAll('.work__tile').forEach((tile) => tile.classList.toggle('is-lit', tile.dataset.project === project));
      work.querySelectorAll('.work__row').forEach((row) => row.classList.toggle('is-lit', row.querySelector('.work__project').dataset.project === project));
    }

    function run(work) {
      const cloud = work.querySelector('.work__cloud');
      const points = makeTiles(cloud);
      const nudge = { x: 0, y: 0 };
      const target = { x: 0, y: 0 };
      let frame = 0;

      const tick = (now) => {
        nudge.x += (target.x - nudge.x) * 0.05;
        nudge.y += (target.y - nudge.y) * 0.05;
        place(work, cloud, points, now / 1000, nudge);
        frame = requestAnimationFrame(tick);
      };

      work.querySelectorAll('.work__project').forEach((link) => {
        const light = () => focusProject(work, link.dataset.project);
        const dark = () => focusProject(work, null);
        link.addEventListener('pointerenter', light);
        link.addEventListener('focus', light);
        link.addEventListener('pointerleave', dark);
        link.addEventListener('blur', dark);
      });
      work.addEventListener('pointermove', (event) => {
        const box = work.getBoundingClientRect();
        target.x = ((event.clientX - box.left) / box.width - 0.5) * 0.8;
        target.y = ((event.clientY - box.top) / box.height - 0.5) * 0.4;
      });

      new ResizeObserver(() => place(work, cloud, points, performance.now() / 1000, nudge)).observe(cloud);
      new IntersectionObserver(([entry]) => {
        cancelAnimationFrame(frame);
        if (entry.isIntersecting && !still.matches) frame = requestAnimationFrame(tick);
      }).observe(work);
    }

    document.querySelectorAll('.work').forEach(run);
  })();
</script>

Similar components

Work grid with pill

Work grid with pill

Work globe

Work globe

Work grid

Work grid

Project windows

Project windows

Collage stage

Collage stage

Artefact scatter

Artefact scatter

Feed row

Feed row

Inset project tiles

Inset project tiles