StealThis .dev

Three.js Product Spotlight

Product spotlight with scroll-driven camera rail movement.

Open in Lab
threejscamera-railswebgl
Targets: JS HTML

Code

:root { --bg:#04070f; --text:#eff4ff; --muted:#c2d0e7; --accent:#8de8ff; }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--text); font-family:"Avenir Next","Segoe UI",sans-serif; }
#scene { position:fixed; inset:0; z-index:0; }
.topbar { position:fixed; inset:0 0 auto 0; z-index:30; display:flex; justify-content:space-between; align-items:center; padding:.75rem 1rem; background:rgba(0,0,0,.28); backdrop-filter:blur(8px); }
.topbar a { color:var(--accent); text-decoration:none; font-weight:700; }
button { border:1px solid rgba(255,255,255,.25); border-radius:999px; padding:.45rem .8rem; background:rgba(255,255,255,.07); color:var(--text); cursor:pointer; }
main { position:relative; z-index:10; }
.panel { min-height:90vh; width:min(920px,92%); margin:0 auto; display:grid; align-content:center; gap:.7rem; border-bottom:1px solid rgba(255,255,255,.12); }
.label { margin:0; color:var(--accent); letter-spacing:.1em; text-transform:uppercase; }
h1,h2,p { margin:0; }
h1 { font-size: clamp(2.1rem, 7vw, 4.3rem); }
p { color:var(--muted); max-width:62ch; }

Three.js Product Spotlight

Product spotlight with scroll-driven camera rail movement.

Source

  • Repository: libs-gen
  • Original demo id: 12-threejs-product-spotlight

Notes

Product spotlight with scroll-driven camera rail movement.