counter doesn't work - Follow Up Deployment
Browse files252 unmodified lines2532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263271 unmodified line3293303313323333343353363373383391 unmodified line3413423433443453468 unmodified lines355356357358359360252 unmodified lines</audio><!-- Scripts --><script>// Background music controlconst bgMusic = document.getElementById('bg-music');const muteBtn = document.getElementById('mute-btn');document.addEventListener('DOMContentLoaded', function() {bgMusic.volume = 0.3;const playPromise = bgMusic.play();if (playPromise !== undefined) {playPromise.catch(error => {console.log('Autoplay prevented:', error);});}});muteBtn.addEventListener('click', function () {if (bgMusic.paused) {bgMusic.play();muteBtn.innerHTML = '<i class="fas fa-volume-up text-2xl bg-gradient-to-r from-purple-500 to-pink-500 bg-clip-text text-transparent"></i>';} else {bgMusic.pause();muteBtn.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>';}});// Click on horsedocument.getElementById('horse-image').addEventListener('click', function () {const currentSrc = this.src;const happySrc = this.dataset.happy;const seriousSrc = this.dataset.serious;this.src = currentSrc === happySrc ? seriousSrc : happySrc;const horseSound = document.getElementById('horse-sound');horseSound.currentTime = 0;horseSound.play();registerClick(); // Firebase});// Smooth scroll for anchor linksdocument.querySelectorAll('a[href^="#"]').forEach(anchor => {anchor.addEventListener('click', function (e) {e.preventDefault();document.querySelector(this.getAttribute('href')).scrollIntoView({behavior: 'smooth'});});});</script><!-- Firebase SDK --><script src="https://www.gstatic.com/firebasejs/10.3.1/firebase-app.js"></script><script src="https://www.gstatic.com/firebasejs/10.3.1/firebase-database.js"></script><script>// 👉 Замінити цей блок на свої дані з Firebase Consoleconst firebaseConfig = {apiKey: "AIzaSyCVYIrFNTrzNAoDg7ILDkuuj6WOuIbshkw",authDomain: "dpth-token.firebaseapp.com",databaseURL: "https://dpth-token-default-rtdb.firebaseio.com/",projectId: "dpth-token",storageBucket: "dpth-token.firebasestorage.app",messagingSenderId: "342451304770",appId: "1:342451304770:web:2fa126439179c152cb70db",measurementId: "G-Q31X5D2S68"};const app = firebase.initializeApp(firebaseConfig);const db = firebase.database();let userCountry = "XX";fetch('https://ipapi.co/json/').then(res => res.json())1 unmodified lineuserCountry = data.country_code || "XX";});function registerClick() {const ref = db.ref(`clicks_by_country/${userCountry}`);ref.transaction(current => (current || 0) + 1);}const totalRef = db.ref("clicks_by_country");totalRef.on("value", snapshot => {const data = snapshot.val() || {};1 unmodified lineconst sorted = Object.entries(data).sort((a, b) => b[1] - a[1]);sorted.forEach(([_, count]) => total += count);const counterEl = document.getElementById("click-counter");if (counterEl) counterEl.textContent = total.toLocaleString();8 unmodified lineslb.innerHTML = html;}});</script><p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=ICEGUS/dpthtoken" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>252 unmodified lines2532542552562572582592602612622632642652662672682692702712722732742752762772782792801 unmodified line2822832842852862872882892902912922932941 unmodified line2962972982993003013028 unmodified lines311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367252 unmodified lines</audio><!-- Scripts --><!-- Scripts --><script src="https://www.gstatic.com/firebasejs/10.3.1/firebase-app.js"></script><script src="https://www.gstatic.com/firebasejs/10.3.1/firebase-database.js"></script><script>// 👉 Заміни цей блок своїм firebaseConfigconst firebaseConfig = {apiKey: "AIzaSyCVYIrFNTrzNAoDg7ILDkuuj6WOuIbshkw",authDomain: "dpth-token.firebaseapp.com",databaseURL: "https://dpth-token-default-rtdb.firebaseio.com",projectId: "dpth-token",storageBucket: "dpth-token.firebasestorage.app",messagingSenderId: "342451304770",appId: "1:342451304770:web:2fa126439179c152cb70db",measurementId: "G-Q31X5D2S68"};// 🔧 Ініціалізація Firebaseconst app = firebase.initializeApp(firebaseConfig);const db = firebase.database();// 🌍 Визначення країни користувачаlet userCountry = "XX";fetch('https://ipapi.co/json/').then(res => res.json())1 unmodified lineuserCountry = data.country_code || "XX";});// 🧮 Запис кліку в базуfunction registerClick() {const ref = db.ref(`clicks_by_country/${userCountry}`);ref.transaction(current => (current || 0) + 1);}// 📊 Оновлення лічильника та лідербордуconst totalRef = db.ref("clicks_by_country");totalRef.on("value", snapshot => {const data = snapshot.val() || {};1 unmodified lineconst sorted = Object.entries(data).sort((a, b) => b[1] - a[1]);sorted.forEach(([_, count]) => total += count);const counterEl = document.getElementById("click-counter");if (counterEl) counterEl.textContent = total.toLocaleString();8 unmodified lineslb.innerHTML = html;}});// 🔊 Обробка звуку та зображенняconst bgMusic = document.getElementById('bg-music');const muteBtn = document.getElementById('mute-btn');document.addEventListener('DOMContentLoaded', function() {bgMusic.volume = 0.3;const playPromise = bgMusic.play();if (playPromise !== undefined) {playPromise.catch(error => {console.log('Autoplay prevented:', error);});}});muteBtn.addEventListener('click', function () {if (bgMusic.paused) {bgMusic.play();muteBtn.innerHTML = '<i class="fas fa-volume-up text-2xl bg-gradient-to-r from-purple-500 to-pink-500 bg-clip-text text-transparent"></i>';} else {bgMusic.pause();muteBtn.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>';}});// 🐴 Клік по зображенню коняconst horseImage = document.getElementById('horse-image');if (horseImage) {horseImage.addEventListener('click', function () {const currentSrc = this.src;const happySrc = this.dataset.happy;const seriousSrc = this.dataset.serious;this.src = currentSrc === happySrc ? seriousSrc : happySrc;const horseSound = document.getElementById('horse-sound');horseSound.currentTime = 0;horseSound.play();registerClick(); // ✅ Запис у Firebase});}// 🧭 Smooth scrolldocument.querySelectorAll('a[href^="#"]').forEach(anchor => {anchor.addEventListener('click', function (e) {e.preventDefault();document.querySelector(this.getAttribute('href')).scrollIntoView({behavior: 'smooth'});});});</script><p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=ICEGUS/dpthtoken" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
index.html+66-59