StealThis .dev

Pinned Scroll Sections

Sections pin in place while multi-step timelines play, driven entirely by scroll position.

Open in Lab
gsapscrolltriggerpin
Targets: JS HTML

Code

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

:root {
  --bg: #070a12;
  --panel: #121a2b;
  --border: #263249;
  --text: #f0f4fb;
  --muted: #8a95a8;
  --accent: #86e8ff;
  --neon-purple: #ae52ff;
  --neon-pink: #ff40d6;
}

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

body { overflow-x: hidden; }

/* ── Intro ── */
.intro {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff, var(--accent), var(--neon-purple));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  color: var(--muted);
  max-width: 500px;
  margin-top: 0.75rem;
  line-height: 1.6;
}

/* ── Pinned sections ── */
.pinned-section {
  position: relative;
  min-height: 100vh;
}

.pin-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  gap: 2rem;
  padding: 0 4rem;
  align-items: center;
}

/* ── Left side: steps ── */
.pin-left {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  padding: 2rem 0;
}

.step-indicators {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 0.5rem;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.step-dot.active {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(134, 232, 255, 0.4);
}

.pin-text {
  position: relative;
}

.step-text {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.step-text.active {
  position: relative;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

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

.step-text h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1rem;
  -webkit-text-fill-color: var(--text);
}

.step-text p {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 400px;
}

/* ── Right side: visuals ── */
.pin-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Visual stage (section 1) */
.visual-stage {
  position: relative;
  width: 360px;
  height: 360px;
}

.vis-element {
  position: absolute;
  will-change: transform, opacity;
}

.vis-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), rgba(134, 232, 255, 0.3));
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.vis-square {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--neon-purple), rgba(174, 82, 255, 0.3));
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.vis-triangle {
  width: 0;
  height: 0;
  border-left: 45px solid transparent;
  border-right: 45px solid transparent;
  border-bottom: 78px solid var(--neon-pink);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  filter: drop-shadow(0 0 16px rgba(255, 64, 214, 0.3));
}

.vis-line {
  position: absolute;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  opacity: 0;
  will-change: transform, opacity;
}

.vis-line-1 { width: 120px; top: 30%; left: 10%; }
.vis-line-2 { width: 80px; top: 60%; right: 10%; }
.vis-line-3 { width: 160px; bottom: 20%; left: 25%; }

/* Metric bars (section 2) */
.metric-bars {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 360px;
}

.metric-bar {
  position: relative;
}

.bar-fill {
  height: 8px;
  border-radius: 4px;
  background: var(--color, var(--accent));
  width: 0%;
  will-change: width;
  transition: width 0.05s linear;
}

.bar-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Outro ── */
.outro {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.outro h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  -webkit-text-fill-color: var(--text);
}

.btn-back {
  display: inline-block;
  padding: 0.7rem 2rem;
  border-radius: 999px;
  border: 1px solid rgba(134, 232, 255, 0.3);
  color: var(--accent);
  text-decoration: none;
  font: 600 0.85rem/1 'Inter', system-ui, sans-serif;
  transition: all 0.25s ease;
}

.btn-back:hover {
  background: rgba(134, 232, 255, 0.08);
  border-color: var(--accent);
}

/* ── Reduced motion ── */
.reduced-motion .vis-element,
.reduced-motion .vis-line,
.reduced-motion .step-text {
  opacity: 1 !important;
  transform: none !important;
}

.reduced-motion .bar-fill { transition: none; }

@media (max-width: 768px) {
  .pin-content {
    grid-template-columns: 1fr;
    padding: 0 1.5rem;
  }

  .pin-right { min-height: 300px; }
  .visual-stage { width: 260px; height: 260px; }
}

Pinned Scroll Sections

Sections pin in place while multi-step timelines play, driven entirely by scroll position.

Source

  • Repository: libs-genclaude
  • Original demo id: 04-pinned-timeline

Notes

Sections pin in place while multi-step timelines play, driven entirely by scroll position.