Spaces:
Running
Running
Download script.js from argho229/valentine_day: direct link, hf CLI and curl.
- Browser
- Download file 1.68 kB
-
https://huggingface.co/spaces/argho229/valentine_day/resolve/main/script.js
- Command line
-
hf download hf://spaces/argho229/valentine_day/script.js
-
curl -L -o script.js https://huggingface.co/spaces/argho229/valentine_day/resolve/main/script.js
1.68 kB
| const messages = [ | |
| "Are you sure?", | |
| "Really sure??", | |
| "Are you positive?", | |
| "Pookie please...", | |
| "Just think about it!", | |
| "If you say no, I will be really sad...", | |
| "I will be very sad...", | |
| "I will be very very very sad...", | |
| "Ok fine, I will stop asking...", | |
| "Just kidding, say yes please! β€οΈ" | |
| ]; | |
| let messageIndex = 0; | |
| function handleNoClick() { | |
| const noButton = document.getElementById('noBtn'); | |
| const yesButton = document.getElementById('yesBtn'); | |
| noButton.textContent = messages[messageIndex]; | |
| messageIndex = (messageIndex + 1) % messages.length; | |
| const currentSize = parseFloat(window.getComputedStyle(yesButton).fontSize); | |
| yesButton.style.fontSize = `${currentSize * 1.5}px`; | |
| } | |
| function handleYesClick() { | |
| window.location.href = "yes_page.html"; | |
| } | |
| // Background Hearts Generation | |
| function createHearts() { | |
| const bg = document.getElementById('bg-hearts'); | |
| const heartEmojis = ['β€οΈ', 'π', 'π', 'π', 'β¨']; | |
| for (let i = 0; i < 20; i++) { | |
| const heart = document.createElement('div'); | |
| heart.className = 'heart'; | |
| heart.textContent = heartEmojis[Math.floor(Math.random() * heartEmojis.length)]; | |
| heart.style.left = Math.random() * 100 + 'vw'; | |
| heart.style.animationDelay = Math.random() * 10 + 's'; | |
| heart.style.fontSize = (Math.random() * 20 + 10) + 'px'; | |
| bg.appendChild(heart); | |
| } | |
| } | |
| document.addEventListener('DOMContentLoaded', () => { | |
| createHearts(); | |
| document.getElementById('noBtn').addEventListener('click', handleNoClick); | |
| document.getElementById('yesBtn').addEventListener('click', handleYesClick); | |
| }); |