Spaces:
Running
Running
add scroll
Browse files- index.html +20 -0
index.html
CHANGED
@@ -1016,6 +1016,26 @@
|
|
1016 |
localStorage.setItem('pageViews', views);
|
1017 |
pageCounter.textContent = views;
|
1018 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1019 |
// Demo toggle functionality
|
1020 |
document.getElementById('demo-toggle').addEventListener('click', () => {
|
1021 |
const promoSection = document.getElementById('social-promo');
|
|
|
1016 |
localStorage.setItem('pageViews', views);
|
1017 |
pageCounter.textContent = views;
|
1018 |
|
1019 |
+
// Scroll navigation
|
1020 |
+
const scrollNav = document.getElementById('scroll-nav');
|
1021 |
+
const scrollUpBtn = document.getElementById('scroll-up-btn');
|
1022 |
+
const scrollDownBtn = document.getElementById('scroll-down-btn');
|
1023 |
+
|
1024 |
+
const sections = ['home', 'features', 'create', 'pricing'];
|
1025 |
+
let currentIndex = 0;
|
1026 |
+
|
1027 |
+
window.addEventListener('scroll', () => {
|
1028 |
+
scrollNav.classList.toggle('hidden', window.scrollY < 200);
|
1029 |
+
});
|
1030 |
+
|
1031 |
+
scrollUpBtn.addEventListener('click', () => window.scrollTo({ top: 0, behavior: 'smooth' }));
|
1032 |
+
|
1033 |
+
scrollDownBtn.addEventListener('click', () => {
|
1034 |
+
currentIndex = (currentIndex + 1) % sections.length;
|
1035 |
+
const target = document.getElementById(sections[currentIndex]);
|
1036 |
+
if (target) target.scrollIntoView({ behavior: 'smooth' });
|
1037 |
+
});
|
1038 |
+
|
1039 |
// Demo toggle functionality
|
1040 |
document.getElementById('demo-toggle').addEventListener('click', () => {
|
1041 |
const promoSection = document.getElementById('social-promo');
|