// Update dashboard winsDisplay.textContent = wins; lossesDisplay.textContent = losses; accuracyDisplay.textContent = `${accuracy}%`; // Update stats tab totalWins.textContent = wins; totalLosses.textContent = losses; winRatioValue.textContent = `${accuracy}%`; document.documentElement.style.setProperty('--win-percent', `${accuracy}%`); // Get last 5 results (excluding pending) const lastFive = historyData .filter(item => item.resultStatus !== "Pending") .slice(0, 5); // Create HTML for results const lastFiveHTML = lastFive.map(item => { return `
${item.resultStatus === "WIN" ? '' : ''}
`; }).join(""); // Update containers lastResultsContainer.innerHTML = lastFiveHTML; } // Show notification function showNotification(message, type) { // Create notification element const notification = document.createElement('div'); notification.className = `notification ${type}`; notification.innerHTML = `
${type === 'win' ? '' : type === 'loss' ? '' : ''}
${message}
`; // Add to body document.body.appendChild(notification); // Remove after delay setTimeout(() => { notification.style.opacity = '0'; setTimeout(() => { document.body.removeChild(notification); }, 300); }, 3000); } // Update current time function updateTime() { const now = new Date(); const timeString = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); document.getElementById('currentTime').textContent = timeString; } // Initialize particles function initParticles() { particlesJS('particles-js', { particles: { number: { value: 100, density: { enable: true, value_area: 800 } }, color: { value: "#7e57c2" }, shape: { type: "circle" }, opacity: { value: 0.5, random: true }, size: { value: 3, random: true }, line_linked: { enable: true, distance: 150, color: "#7e57c2", opacity: 0.2, width: 1 }, move: { enable: true, speed: 2, direction: "none", random: true, straight: false, out_mode: "out", bounce: false } }, interactivity: { detect_on: "canvas", events: { onhover: { enable: true, mode: "repulse" }, onclick: { enable: true, mode: "push" }, resize: true } }, retina_detect: true }); } // Initialize function init() { updateTime(); setInterval(updateTime, 1000); initParticles(); // Start with empty history historyData = []; updateStats(); updateHistory(); // Start predictions setInterval(updatePrediction, 5000); } // Run initialization when DOM is loaded document.addEventListener('DOMContentLoaded', init);