Spaces:
Running
Running
File size: 2,368 Bytes
e98fb12 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
document.addEventListener('DOMContentLoaded', () => {
const predictBtn = document.getElementById('predict-btn');
const predictionResult = document.getElementById('prediction-result');
// Possible predictions
const predictions = [
"SAFE BET: Cash out between 3.5x - 5x",
"MEDIUM RISK: Target 7x - 10x",
"HIGH RISK POTENTIAL: Could go 15x+",
"VOLATILE: Cash out before 2x",
"STRONG START: Likely to hit 8x",
"CAUTION: High chance of early crash",
"BIG POTENTIAL: 20x+ possible",
"STEADY: Safe to 5x, moderate risk beyond"
];
// Generate random prediction
predictBtn.addEventListener('click', () => {
// Show loading state
predictionResult.innerHTML = '<div class="flex items-center justify-center space-x-2"><div class="w-4 h-4 rounded-full bg-cyan-400 animate-bounce" style="animation-delay: 0.1s"></div><div class="w-4 h-4 rounded-full bg-cyan-400 animate-bounce" style="animation-delay: 0.2s"></div><div class="w-4 h-4 rounded-full bg-cyan-400 animate-bounce" style="animation-delay: 0.3s"></div></div>';
// Simulate AI processing delay
setTimeout(() => {
const randomPrediction = predictions[Math.floor(Math.random() * predictions.length)];
const confidence = Math.floor(Math.random() * 25) + 75; // 75-100%
predictionResult.innerHTML = `
<div class="text-center">
<div class="text-xl font-bold mb-1">${randomPrediction}</div>
<div class="text-sm opacity-70">Confidence: ${confidence}%</div>
</div>
`;
// Add sparkle effect
const sparkles = ['β¨', 'π', 'β‘', 'π'];
const sparkle = sparkles[Math.floor(Math.random() * sparkles.length)];
const tempSpan = document.createElement('span');
tempSpan.className = 'absolute opacity-0 animate-ping';
tempSpan.textContent = sparkle;
tempSpan.style.left = `${Math.random() * 80 + 10}%`;
tempSpan.style.top = `${Math.random() * 80 + 10}%`;
predictionResult.appendChild(tempSpan);
setTimeout(() => {
tempSpan.remove();
}, 1000);
}, 1500);
});
}); |