Changed around line 1
+ // Smooth scroll to top button
+ const scrollToTop = document.createElement('button');
+ scrollToTop.textContent = '↑';
+ scrollToTop.style.position = 'fixed';
+ scrollToTop.style.bottom = '20px';
+ scrollToTop.style.right = '20px';
+ scrollToTop.style.padding = '10px 15px';
+ scrollToTop.style.backgroundColor = 'var(--primary-color)';
+ scrollToTop.style.color = 'white';
+ scrollToTop.style.border = 'none';
+ scrollToTop.style.borderRadius = '50%';
+ scrollToTop.style.cursor = 'pointer';
+ scrollToTop.style.display = 'none';
+ scrollToTop.style.zIndex = '1000';
+
+ document.body.appendChild(scrollToTop);
+
+ window.addEventListener('scroll', () => {
+ if (window.scrollY > 300) {
+ scrollToTop.style.display = 'block';
+ } else {
+ scrollToTop.style.display = 'none';
+ }
+ });
+
+ scrollToTop.addEventListener('click', () => {
+ window.scrollTo({
+ top: 0,
+ behavior: 'smooth'
+ });
+ });