ComponentsMedia

Orbit Projects

Ready

A scroll-driven 3D ring of project covers pinned behind split ORBIT / PROJECTS display type. Scrolling spins the carousel a full turn while the nearest card scales up and sharpens.

Preview

Exploring ideas through daily design practice.

Project 01
Sevora
Project 03
Project 04
Project 05
Project 06

Code

orbit-projects-example.html
<style>
  .op {
    container-type: inline-size;
    width: 100%;
    font-family: Inter, "Inter Placeholder", system-ui, sans-serif;
  }
  .op__pin {
    position: relative;
    height: 460vh;
    background: #e8e4e3;
  }
  .op__stage {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100svh;
    min-height: 600px;
    overflow: hidden;
    background: #e8e4e3;
    perspective: 1300px;
    perspective-origin: 50% 50%;
    transform-style: preserve-3d;
    isolation: isolate;
  }
  .op__word {
    position: absolute;
    left: 50%;
    z-index: 0;
    margin: 0;
    width: max-content;
    pointer-events: none;
    font-size: 144px;
    font-size: clamp(52px, 10cqw, 144px);
    font-weight: 400;
    letter-spacing: -0.075em;
    line-height: 0.86;
    white-space: nowrap;
    color: #1d1816;
    will-change: transform;
  }
  .op__word--left {
    top: 56%;
    transform: translate3d(calc(-100% - min(126px, 9cqw)), calc(-50% - var(--op-drift, 0px)), 0);
  }
  .op__word--right {
    top: 39%;
    transform: translate3d(min(126px, 9cqw), calc(-50% + var(--op-drift, 0px)), 0);
  }
  .op__caption {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: 220px;
    max-width: 80cqw;
    margin: 0;
    padding: 16px;
    box-sizing: border-box;
    pointer-events: none;
    transform: translate3d(-50%, -50%, 0);
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 22px;
    color: #1d1816;
  }
  .op__hint {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 36px 16px 0;
    pointer-events: none;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: #18181b;
    will-change: transform, opacity;
  }
  .op__hint svg {
    width: 18px;
    height: 18px;
  }
  .op__ring {
    position: absolute;
    inset: 0;
    z-index: 10;
    transform-style: preserve-3d;
  }
  .op__card {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 742px;
    width: min(742px, 51.5cqw);
    aspect-ratio: 742 / 557.895;
    transform-origin: 50% 50%;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform, opacity;
  }
  .op__frame {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 16px;
    background: #e8e8e8;
    box-shadow: 0 36px 100px rgba(0, 0, 0, 0.12);
    backface-visibility: hidden;
    color: inherit;
    text-decoration: none;
  }
  .op__frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #e8e8e8;
    user-select: none;
    pointer-events: none;
    backface-visibility: hidden;
  }
  @media (prefers-reduced-motion: reduce) {
    .op__word { will-change: auto; }
  }
</style>
<div class="op" role="region" aria-roledescription="carousel" aria-label="Projects">
  <section class="op__pin">
    <div class="op__stage">
      <p class="op__word op__word--left" aria-hidden="true">ORBIT</p>
      <p class="op__word op__word--right" aria-hidden="true">PROJECTS</p>
      <p class="op__caption">Exploring ideas through daily design practice.</p>
      <div class="op__hint" aria-hidden="true">
        <span>Scroll to explore</span>
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4v15m0 0l-6.5-6.5M12 19l6.5-6.5" /></svg>
      </div>
      <div class="op__ring">
        <div class="op__card" style="transform: translate3d(-941px, -220.1px, 0px) rotateY(62deg) rotateZ(8deg) scale(0.455); opacity: 0.9; z-index: 500;">
          <div class="op__frame"><img src="cover-1.jpg" alt="Project 01" loading="eager" draggable="false" /></div>
        </div>
        <div class="op__card" style="transform: translate3d(-656px, -139.02px, 450.33px) rotateY(31deg) rotateZ(4deg) scale(0.494); opacity: 0.9866; z-index: 847;">
          <a class="op__frame" href="#" aria-label="Project 02"><img src="cover-2.jpg" alt="Project 02" loading="eager" draggable="false" /></a>
        </div>
        <div class="op__card" style="transform: translate3d(-86px, -266.12px, 450.33px) rotateY(-31deg) rotateZ(-4deg) scale(0.494); opacity: 0.9866; z-index: 847;">
          <div class="op__frame"><img src="cover-3.jpg" alt="Project 03" loading="eager" draggable="false" /></div>
        </div>
        <div class="op__card" style="transform: translate3d(199px, -474.3px, 0px) rotateY(-62deg) rotateZ(-8deg) scale(0.455); opacity: 0.9; z-index: 500;">
          <div class="op__frame"><img src="cover-4.jpg" alt="Project 04" loading="lazy" draggable="false" /></div>
        </div>
        <div class="op__card" style="transform: translate3d(-86px, -555.38px, -450.33px) rotateY(-31deg) rotateZ(-4deg) scale(0.416); opacity: 0.8134; z-index: 153;">
          <div class="op__frame"><img src="cover-5.jpg" alt="Project 05" loading="lazy" draggable="false" /></div>
        </div>
        <div class="op__card" style="transform: translate3d(-656px, -428.28px, -450.33px) rotateY(31deg) rotateZ(4deg) scale(0.416); opacity: 0.8134; z-index: 153;">
          <div class="op__frame"><img src="cover-6.jpg" alt="Project 06" loading="lazy" draggable="false" /></div>
        </div>
      </div>
    </div>
  </section>
</div>
<script>
  (function () {
    "use strict";

    var TAU = Math.PI * 2;

    // Ring geometry, recovered from the original frame.
    var SPREAD = 570;    // horizontal radius, px at reference width
    var DEPTH = 520;     // z radius, px
    var TILT = 62;       // peak rotateY, deg
    var ROLL = 8;        // peak rotateZ, deg
    var Y_BASE = -347.2; // ring centre above the stage middle, px
    var Y_SIN = 167;     // vertical sway tied to sin, px
    var Y_COS = 127.1;   // vertical sway tied to cos, px

    document.querySelectorAll(".op").forEach(function (root) {
      var pin = root.querySelector(".op__pin");
      var stage = root.querySelector(".op__stage");
      var cards = Array.prototype.slice.call(root.querySelectorAll(".op__card"));
      var hint = root.querySelector(".op__hint");
      var n = cards.length;
      if (!pin || !n) return;

      if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;

      var inView = true;
      var target = 0;
      var current = 0;
      var cardW = 0;
      var halfW = 0;
      var scale = 1;

      function measure() {
        cardW = cards[0].offsetWidth || 742;
        halfW = cardW / 2;
        scale = Math.min(1, stage.clientWidth / 1440);
      }

      function apply(p) {
        for (var i = 0; i < n; i++) {
          var t = (p + i / n) * TAU;
          var sin = Math.sin(t);
          var cos = Math.cos(t);
          var z = DEPTH * scale * sin;
          var card = cards[i];
          card.style.transform =
            "translate3d(" + (-halfW - SPREAD * scale * cos).toFixed(2) + "px, " +
            ((Y_BASE + Y_SIN * sin + Y_COS * cos) * scale).toFixed(2) + "px, " +
            z.toFixed(2) + "px) rotateY(" + (TILT * cos).toFixed(2) + "deg) rotateZ(" +
            (ROLL * cos).toFixed(2) + "deg) scale(" + (0.455 + 0.045 * sin).toFixed(4) + ")";
          card.style.opacity = (0.9 + 0.1 * sin).toFixed(4);
          card.style.zIndex = String(Math.round(500 + 0.77 * z));
        }
        root.style.setProperty("--op-drift", (110 * scale * p).toFixed(1) + "px");
        hint.style.opacity = Math.max(0, 1 - p * 6).toFixed(3);
        hint.style.transform = "translate3d(0, " + (-24 * p).toFixed(1) + "px, 0)";
      }

      function readScroll() {
        var rect = pin.getBoundingClientRect();
        var total = rect.height - window.innerHeight;
        target = total > 0 ? Math.min(1, Math.max(0, -rect.top / total)) : 0;
        if (!started) start();
      }

      function tick() {
        if (inView && current !== target) {
          current += (target - current) * 0.14;
          if (Math.abs(target - current) < 0.0005) current = target;
          apply(current);
        }
        window.requestAnimationFrame(tick);
      }

      // Container-query widths still read as 0 while the page is parsing,
      // so hold the first measure until real layout exists (retried on scroll).
      var started = false;

      function start() {
        if (started || !stage.clientWidth) return;
        started = true;
        measure();
        readScroll();
        current = target;
        apply(current);
        window.requestAnimationFrame(tick);
      }

      window.addEventListener("scroll", readScroll, { passive: true });
      window.addEventListener("resize", function () {
        if (!started || !stage.clientWidth) return;
        measure();
        readScroll();
        apply(current);
      });
      if ("IntersectionObserver" in window) {
        new IntersectionObserver(function (entries) {
          inView = entries[0].isIntersecting;
        }, { rootMargin: "120px" }).observe(pin);
      }

      if (document.readyState === "loading") {
        document.addEventListener("DOMContentLoaded", start);
      } else {
        start();
      }
      // Restored or prerendered pages can defer layout — retry when live again.
      window.addEventListener("load", start);
      document.addEventListener("visibilitychange", function () {
        if (!document.hidden) start();
      });
    });
  })();
</script>