Spaces:
Running
Running
Download script.js from dreamski/puff-palace: direct link, hf CLI and curl.
- Browser
- Download file 657 Bytes
-
https://huggingface.co/spaces/dreamski/puff-palace/resolve/main/script.js
- Command line
-
hf download hf://spaces/dreamski/puff-palace/script.js
-
curl -L -o script.js https://huggingface.co/spaces/dreamski/puff-palace/resolve/main/script.js
657 Bytes
| document.addEventListener('DOMContentLoaded', function() { | |
| // Initialize animations | |
| const animatedElements = document.querySelectorAll('.fade-in, .slide-up'); | |
| animatedElements.forEach((el, index) => { | |
| // Stagger animations | |
| el.style.animationDelay = `${index * 0.1}s`; | |
| }); | |
| // Handle cart buttons | |
| const addToCartButtons = document.querySelectorAll('[data-add-to-cart]'); | |
| addToCartButtons.forEach(button => { | |
| button.addEventListener('click', function() { | |
| const product = this.getAttribute('data-product'); | |
| alert(`Added ${product} to your cart`); | |
| }); | |
| }); | |
| }); |