Spaces:
Running
Running
Download script.js from Knuger/kaffekompis: direct link, hf CLI and curl.
- Browser
- Download file 1.41 kB
-
https://huggingface.co/spaces/Knuger/kaffekompis/resolve/main/script.js
- Command line
-
hf download hf://spaces/Knuger/kaffekompis/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Knuger/kaffekompis/resolve/main/script.js
1.41 kB
| // Form submission handling | |
| document.addEventListener('DOMContentLoaded', function() { | |
| const contactForm = document.querySelector('form'); | |
| if (contactForm) { | |
| contactForm.addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| // Get form values | |
| const name = document.getElementById('name').value; | |
| const email = document.getElementById('email').value; | |
| const message = document.getElementById('message').value; | |
| // Here you would typically send the data to a server | |
| console.log('Form submitted:', { name, email, message }); | |
| // Show success message | |
| alert('Tack för ditt meddelande! Vi återkommer så snart vi kan.'); | |
| contactForm.reset(); | |
| }); | |
| } | |
| // Add animations to coffee products on scroll | |
| const observerOptions = { | |
| threshold: 0.1 | |
| }; | |
| const observer = new IntersectionObserver(function(entries) { | |
| entries.forEach(entry => { | |
| if (entry.isIntersecting) { | |
| entry.target.classList.add('animate-fadeIn'); | |
| } | |
| }); | |
| }, observerOptions); | |
| document.querySelectorAll('.bg-white.rounded-lg').forEach(card => { | |
| observer.observe(card); | |
| card.classList.add('opacity-0', 'transition-opacity', 'duration-500'); | |
| }); | |
| }); |