StealThis .dev

Scroll Camera Narrative

Scroll through story chapters as the camera flies between 3D scene waypoints with cinematic transitions.

Open in Lab
three.jsgsaplenisscrolltrigger
Targets: JS HTML

Code

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

:root {
  --bg: #070a12;
  --text: #f0f4fb;
  --muted: #8a95a8;
  --accent: #86e8ff;
  --border: #263249;
}

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

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

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

/* Scrollable container overlaid on the 3D scene */
.scroll-container {
  position: relative;
  z-index: 2;
}

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

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

.chapter-panel {
  pointer-events: auto;
  max-width: 360px;
  padding: 2rem;
  background: rgba(12, 15, 25, 0.75);
  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(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.chapter-panel.visible {
  opacity: 1;
  transform: translateY(0);
}

.reduced-motion .chapter-panel {
  opacity: 1;
  transform: none;
  transition: none;
}

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

.chapter-panel h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

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

/* Progress indicator */
.scroll-progress {
  position: fixed;
  top: 50%;
  right: 1.5rem;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(134, 232, 255, 0.2);
  border: 1px solid rgba(134, 232, 255, 0.3);
  transition: all 0.3s ease;
}

.progress-dot.active {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(134, 232, 255, 0.5);
  transform: scale(1.3);
}

@media (max-width: 640px) {
  .chapter { padding: 1rem; }
  .chapter-panel { max-width: 280px; padding: 1.5rem; }
  .chapter:nth-child(odd),
  .chapter:nth-child(even) { justify-content: center; }
  .scroll-progress { right: 0.75rem; }
}

Scroll Camera Narrative

Scroll through story chapters as the camera flies between 3D scene waypoints with cinematic transitions.

Source

  • Repository: libs-genclaude
  • Original demo id: 21-scroll-camera-narrative

Notes

Scroll through story chapters as the camera flies between 3D scene waypoints with cinematic transitions.