Spaces:
Running
Running
Download script.js from ch1245/doughdash-delights: direct link, hf CLI and curl.
- Browser
- Download file 988 Bytes
-
https://huggingface.co/spaces/ch1245/doughdash-delights/resolve/main/script.js
- Command line
-
hf download hf://spaces/ch1245/doughdash-delights/script.js
-
curl -L -o script.js https://huggingface.co/spaces/ch1245/doughdash-delights/resolve/main/script.js
988 Bytes
| document.addEventListener('DOMContentLoaded', function() { | |
| // Format all currency elements | |
| document.querySelectorAll('.currency').forEach(el => { | |
| const amount = parseFloat(el.textContent); | |
| el.textContent = amount.toLocaleString('en-US', { | |
| style: 'currency', | |
| currency: 'USD' | |
| }); | |
| }); | |
| // Add tooltips to all elements with data-tooltip attribute | |
| tippy('[data-tooltip]', { | |
| content(reference) { | |
| return reference.getAttribute('data-tooltip'); | |
| }, | |
| }); | |
| }); | |
| // Balance pulse animation for low balance warning | |
| function animateBalanceWarning() { | |
| const balanceWarning = document.querySelector('.balance-warning'); | |
| if (balanceWarning) { | |
| balanceWarning.classList.add('animate-pulse-slow'); | |
| } | |
| } | |
| // Initialize when DOM is loaded | |
| if (document.readyState !== 'loading') { | |
| animateBalanceWarning(); | |
| } else { | |
| document.addEventListener('DOMContentLoaded', animateBalanceWarning); | |
| } |