kitbash Sign in Connect agent
Components

Photo ring

Photo tiles, repeated to twenty-four, on a tilted 3D ring that turns slowly and reads as an arc across the page, with a short line and a count under it.

Part of the style

Black Bar Grotesk

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

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --ink: #fbf4ee;
  --paper: #251a1a;
  --ink-soft: #837777;
  --veil: rgba(37, 26, 26, 0.5);
}
</style>

<section class="ring" aria-label="Recent parks">
  <div class="ring__stage">
    <ul class="ring__wheel">
      <li class="ring__tile"><img class="ring__photo" src="assets/shade-path.jpg" alt="A bark path through a shady planted garden" width="1000" height="750" loading="lazy"></li>
      <li class="ring__tile"><img class="ring__photo" src="assets/pavilion.jpg" alt="An old park pavilion with a tower in winter" width="800" height="533" loading="lazy"></li>
      <li class="ring__tile"><img class="ring__photo" src="assets/pergola-2.jpg" alt="Rose arches over a pale path" width="800" height="533" loading="lazy"></li>
      <li class="ring__tile"><img class="ring__photo" src="assets/walking-path.jpg" alt="A sandy path curving through ferns" width="800" height="600" loading="lazy"></li>
      <li class="ring__tile"><img class="ring__photo" src="assets/coast-path.jpg" alt="A path under rhododendrons near the coast" width="800" height="533" loading="lazy"></li>
      <li class="ring__tile"><img class="ring__photo" src="assets/pergola.jpg" alt="A long pergola of climbing roses" width="1200" height="800" loading="lazy"></li>
      <li class="ring__tile"><img class="ring__photo" src="assets/shade-path.jpg" alt="Hostas and ferns along a garden walk" width="1000" height="750" loading="lazy"></li>
      <li class="ring__tile"><img class="ring__photo" src="assets/pavilion.jpg" alt="A timbered pavilion seen across snow" width="800" height="533" loading="lazy"></li>
      <li class="ring__tile"><img class="ring__photo" src="assets/pergola-2.jpg" alt="A rose walk in summer" width="800" height="533" loading="lazy"></li>
      <li class="ring__tile"><img class="ring__photo" src="assets/walking-path.jpg" alt="A woodland walk in green shade" width="800" height="600" loading="lazy"></li>
      <li class="ring__tile"><img class="ring__photo" src="assets/coast-path.jpg" alt="Evergreen shrubs over a paved trail" width="800" height="533" loading="lazy"></li>
      <li class="ring__tile"><img class="ring__photo" src="assets/pergola.jpg" alt="Roses on timber beams above a walk" width="1200" height="800" loading="lazy"></li>
      <li class="ring__tile"><img class="ring__photo" src="assets/walking-path.jpg" alt="A worn path between ferns" width="800" height="600" loading="lazy"></li>
      <li class="ring__tile"><img class="ring__photo" src="assets/pergola-2.jpg" alt="Climbing roses on a timber frame" width="800" height="533" loading="lazy"></li>
      <li class="ring__tile"><img class="ring__photo" src="assets/coast-path.jpg" alt="A shaded trail under broad shrubs" width="800" height="533" loading="lazy"></li>
      <li class="ring__tile"><img class="ring__photo" src="assets/pavilion.jpg" alt="A park tower against a white sky" width="800" height="533" loading="lazy"></li>
    </ul>
  </div>
  <div class="ring__foot">
    <p class="ring__text">Combining patient planting with a clear plan, we take the awkward plot nobody wanted and turn it into the place everybody meets.</p>
    <p class="ring__count"><span class="ring__num">(16)</span> parks in the round</p>
  </div>
</section>

<style>
  .ring {
    overflow: hidden;
    padding: var(--space-l) 0 var(--section-space);
  }
  .ring__stage {
    position: relative;
    height: clamp(13rem, 27vw, 25rem);
    perspective: 1600px;
    perspective-origin: 50% 0%;
  }
  .ring__wheel {
    --radius: 520px;
    --tile-w: 240px;
    --turn: 0deg;
    position: absolute;
    left: 50%;
    top: 8%;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    transform-style: preserve-3d;
    transform: translateZ(calc(var(--radius) * -1)) rotateX(-14deg) rotateZ(-7deg) rotateY(var(--turn));
  }
  .ring__tile {
    position: absolute;
    left: calc(var(--tile-w) / -2);
    top: 0;
    width: var(--tile-w);
    aspect-ratio: 4 / 5;
    transform: rotateY(calc(var(--i) * 15deg)) translateZ(var(--radius));
    backface-visibility: hidden;
  }
  .ring__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .ring__foot {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: var(--gap);
    margin-top: var(--space-l);
    padding: 0 var(--edge);
  }
  .ring__text {
    max-width: 22rem;
    margin: 0;
    font-size: var(--text-s);
    line-height: 1.3;
  }
  .ring__count {
    margin: 0;
    font-size: var(--text-xs);
  }
  .ring__num {
    margin-right: var(--space-xs);
  }

  @media (max-width: 40rem) {
    .ring__foot { flex-direction: column; align-items: start; }
  }
</style>

<script>
  (() => {
    for (const root of document.querySelectorAll('.ring')) {
      const stage = root.querySelector('.ring__stage');
      const wheel = root.querySelector('.ring__wheel');
      const originals = [...root.querySelectorAll('.ring__tile')];
      for (let i = 0; originals.length && wheel.children.length < 24; i += 1) {
        const copy = originals[i % originals.length].cloneNode(true);
        copy.setAttribute('aria-hidden', 'true');
        wheel.append(copy);
      }
      const tiles = wheel.querySelectorAll('.ring__tile');
      const step = 360 / tiles.length;
      tiles.forEach((tile, i) => {
        tile.style.setProperty('--i', i);
        tile.style.transform = `rotateY(${i * step}deg) translateZ(var(--radius))`;
      });

      const size = () => {
        const width = stage.clientWidth;
        const radius = Math.max(260, width * 0.55);
        const tileW = (2 * Math.PI * radius) / tiles.length * 0.94;
        wheel.style.setProperty('--radius', `${radius}px`);
        wheel.style.setProperty('--tile-w', `${tileW}px`);
      };
      size();
      new ResizeObserver(size).observe(stage);

      const still = matchMedia('(prefers-reduced-motion: reduce)');
      let angle = -15;
      let frame = 0;
      let last = 0;
      const draw = () => wheel.style.setProperty('--turn', `${angle}deg`);
      const tick = (now) => {
        if (last) angle -= (now - last) * 0.006;
        last = now;
        draw();
        frame = requestAnimationFrame(tick);
      };
      const start = () => { if (!frame && !still.matches) { last = 0; frame = requestAnimationFrame(tick); } };
      const stop = () => { cancelAnimationFrame(frame); frame = 0; };
      draw();
      new IntersectionObserver(([entry]) => (entry.isIntersecting ? start() : stop())).observe(root);
      still.addEventListener('change', () => (still.matches ? stop() : start()));
    }
  })();
</script>

Similar components

Centred work stack

Centred work stack

Staggered work grid

Staggered work grid

Location reel

Location reel

Matted device wall

Matted device wall

Latest work rail

Latest work rail

Numbered tile index

Numbered tile index

Project windows

Project windows

Bleed and column cascade

Bleed and column cascade