You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- main content sits above layers and scrolls normally -->
77
+
<divclass="content">
78
+
<h1>Simple Scrolling Parallax</h1>
79
+
<pclass="lead">Layers move at different speeds as you scroll. Use data-speed to change depth.</p>
80
+
</div>
81
+
</header>
82
+
83
+
<!-- Normal flow content -->
84
+
<main>
85
+
<section>
86
+
<h2>What this is</h2>
87
+
<pclass="muted">A minimal base page with a hero that uses layered parallax. The rest of the page scrolls normally so you can mix static and parallax content.</p>
88
+
</section>
89
+
90
+
<section>
91
+
<h2>How to tune it</h2>
92
+
<ul>
93
+
<li>Change data-speed on each .parallax-layer (smaller = farther, larger = moves more).</li>
94
+
<li>Replace background-image URLs with your own photos or gradients.</li>
95
+
<li>For better performance on heavy pages, use lower-res images and limit number of layers.</li>
96
+
</ul>
97
+
</section>
98
+
99
+
<section>
100
+
<h2>More content</h2>
101
+
<pclass="muted">Add more sections here to test scrolling persistence of the parallax effect.</p>
102
+
</section>
103
+
</main>
104
+
105
+
<script>
106
+
// Parallax: translateY each layer based on page scroll and its data-speed.
107
+
// Use requestAnimationFrame to batch updates for smoothness.
0 commit comments