StealThis .dev

3D Product Spotlight

Scroll-driven camera orbits a 3D product on rails, revealing feature cards at each angle.

Open in Lab
three.jsgsaplenisscrolltrigger
Targets: JS HTML

Code

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #050508;
  --text: #f0f4fb;
  --muted: #8a95a8;
  --accent: #86e8ff;
  --border: #263249;
  --neon-purple: #ae52ff;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'SF Pro Display', system-ui, sans-serif;
}

/* Fixed Three.js canvas */
#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Scroll track — tall container that drives the camera */
.scroll-track {
  position: relative;
  z-index: 2;
}

.rail-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 2rem 3rem;
  pointer-events: none;
}

.rail-section:nth-child(odd) { justify-content: flex-start; }
.rail-section:nth-child(even) { justify-content: flex-end; }

/* Info cards */
.info-card {
  pointer-events: auto;
  max-width: 340px;
  padding: 2rem;
  background: rgba(12, 15, 25, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(134, 232, 255, 0.1);
  border-radius: 18px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.info-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.reduced-motion .info-card {
  opacity: 1;
  transform: none;
  transition: none;
}

.card-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.info-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.info-card p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Orbit progress bar (bottom) */
.orbit-progress {
  position: fixed;
  bottom: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 3px;
  background: rgba(134, 232, 255, 0.1);
  border-radius: 2px;
  z-index: 5;
  overflow: hidden;
}

.orbit-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--neon-purple));
  border-radius: 2px;
  transition: width 0.1s linear;
}

@media (max-width: 640px) {
  .rail-section { padding: 1.5rem; }
  .info-card { max-width: 280px; padding: 1.5rem; }
  .rail-section:nth-child(odd),
  .rail-section:nth-child(even) { justify-content: center; }
  .orbit-progress { width: 140px; }
}

3D Product Spotlight

Scroll-driven camera orbits a 3D product on rails, revealing feature cards at each angle.

Source

  • Repository: libs-genclaude
  • Original demo id: 22-product-spotlight

Notes

Scroll-driven camera orbits a 3D product on rails, revealing feature cards at each angle.