Download script.js from muna95/regal-threads-timeless-ties: direct link, hf CLI and curl.
- Browser
- Download file 1.47 kB
-
https://huggingface.co/spaces/muna95/regal-threads-timeless-ties/resolve/main/script.js
- Command line
-
hf download hf://spaces/muna95/regal-threads-timeless-ties/script.js
-
curl -L -o script.js https://huggingface.co/spaces/muna95/regal-threads-timeless-ties/resolve/main/script.js
1.47 kB
| document.addEventListener('DOMContentLoaded', function() { | |
| // Smooth scrolling for anchor links | |
| document.querySelectorAll('a[href^="#"]').forEach(anchor => { | |
| anchor.addEventListener('click', function (e) { | |
| e.preventDefault(); | |
| document.querySelector(this.getAttribute('href')).scrollIntoView({ | |
| behavior: 'smooth' | |
| }); | |
| }); | |
| }); | |
| // Parallax effect for hero section | |
| window.addEventListener('scroll', function() { | |
| const scrollPosition = window.pageYOffset; | |
| const heroSection = document.querySelector('section.relative'); | |
| if (heroSection) { | |
| heroSection.style.backgroundPositionY = scrollPosition * 0.5 + 'px'; | |
| } | |
| }); | |
| // Initialize tooltips | |
| const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')); | |
| tooltipTriggerList.map(function (tooltipTriggerEl) { | |
| return new bootstrap.Tooltip(tooltipTriggerEl); | |
| }); | |
| }); | |
| // Product hover effect | |
| function setupProductHover() { | |
| const products = document.querySelectorAll('.product-card'); | |
| products.forEach(product => { | |
| product.addEventListener('mouseenter', () => { | |
| product.querySelector('.product-overlay').classList.add('opacity-100'); | |
| }); | |
| product.addEventListener('mouseleave', () => { | |
| product.querySelector('.product-overlay').classList.remove('opacity-100'); | |
| }); | |
| }); | |
| } |