need the counter to calculate and remember the total number of clicks by all users together - Follow Up Deployment
Browse files120 unmodified lines121122123124125126127252 unmodified lines3803813823833843852 unmodified lines388389390391392393394395120 unmodified lines<button class="cartoon-button bg-gradient-to-r from-purple-500 to-pink-500 hover:from-purple-600 hover:to-pink-600 text-white font-bold py-3 px-6 rounded-full text-2xl mb-4">Will you push the horses?</button><div class="text-5xl text-amber-700 animate-bounce mt-2">↓</div></div><img id="horse-image" src="https://www.dropbox.com/scl/fi/h9m9f345o94e3g49ealh3/DPTHtoken-logo-happy.png?rlkey=mnzcyc08vcpi87sk90kvoops7&st=0byeouiy&dl=1"data-happy="https://www.dropbox.com/scl/fi/h9m9f345o94e3g49ealh3/DPTHtoken-logo-happy.png?rlkey=mnzcyc08vcpi87sk90kvoops7&st=0byeouiy&dl=1"252 unmodified linesmuteBtn.innerHTML = '<i class="fas fa-volume-mute text-2xl bg-gradient-to-r from-purple-500 to-pink-500 bg-clip-text text-transparent"></i>';}});// Toggle horse image on click and play sounddocument.getElementById('horse-image').addEventListener('click', function() {const currentSrc = this.src;2 unmodified linesthis.src = currentSrc === happySrc ? seriousSrc : happySrc;const horseSound = document.getElementById('horse-sound');horseSound.currentTime = 0; // Rewind to start if already playinghorseSound.play();});// Instagram embed script120 unmodified lines121122123124125126127128252 unmodified lines3813823833843853863873883893903913923933943953963973983994004014024034044054064074084094102 unmodified lines413414415416417418419420421422423120 unmodified lines<button class="cartoon-button bg-gradient-to-r from-purple-500 to-pink-500 hover:from-purple-600 hover:to-pink-600 text-white font-bold py-3 px-6 rounded-full text-2xl mb-4">Will you push the horses?</button><div class="text-amber-700 font-bold text-lg">Pushed: <span id="click-counter">0</span> times</div><div class="text-5xl text-amber-700 animate-bounce mt-6">↓</div></div><img id="horse-image" src="https://www.dropbox.com/scl/fi/h9m9f345o94e3g49ealh3/DPTHtoken-logo-happy.png?rlkey=mnzcyc08vcpi87sk90kvoops7&st=0byeouiy&dl=1"data-happy="https://www.dropbox.com/scl/fi/h9m9f345o94e3g49ealh3/DPTHtoken-logo-happy.png?rlkey=mnzcyc08vcpi87sk90kvoops7&st=0byeouiy&dl=1"252 unmodified linesmuteBtn.innerHTML = '<i class="fas fa-volume-mute text-2xl bg-gradient-to-r from-purple-500 to-pink-500 bg-clip-text text-transparent"></i>';}});// Global click counter with localStorage persistenceasync function updateCounter() {try {// Simulate fetching total count from backendconst response = await fetch('https://api.countapi.xyz/hit/dpthtoken/global');const data = await response.json();document.getElementById('click-counter').textContent = data.value.toLocaleString();// Store user's personal count in localStoragelet userCount = localStorage.getItem('dpth_user_clicks') || 0;userCount++;localStorage.setItem('dpth_user_clicks', userCount);} catch (error) {// Fallback to localStorage if API failslet totalCount = localStorage.getItem('dpth_total_clicks') || 0;totalCount++;localStorage.setItem('dpth_total_clicks', totalCount);document.getElementById('click-counter').textContent = totalCount;}}// Initialize counter on page loadupdateCounter();// Toggle horse image on click and play sounddocument.getElementById('horse-image').addEventListener('click', function() {const currentSrc = this.src;2 unmodified linesthis.src = currentSrc === happySrc ? seriousSrc : happySrc;const horseSound = document.getElementById('horse-sound');horseSound.currentTime = 0;horseSound.play();// Update global counterupdateCounter();});// Instagram embed script
index.html+30-2