Spaces:
Running
Running
| const canvas = document.getElementById('bgCanvas'); | |
| const ctx = canvas.getContext('2d'); | |
| canvas.width = window.innerWidth; | |
| canvas.height = window.innerHeight; | |
| let stars = []; | |
| for (let i = 0; i < 100; i++) { | |
| stars.push({ | |
| x: Math.random() * canvas.width, | |
| y: Math.random() * canvas.height, | |
| radius: Math.random() * 2, | |
| speed: Math.random() * 0.5 + 0.1 | |
| }); | |
| } | |
| function drawStars() { | |
| ctx.clearRect(0, 0, canvas.width, canvas.height); | |
| ctx.fillStyle = 'white'; | |
| stars.forEach(star => { | |
| ctx.beginPath(); | |
| ctx.arc(star.x, star.y, star.radius, 0, Math.PI * 2); | |
| ctx.fill(); | |
| star.y += star.speed; | |
| if (star.y > canvas.height) star.y = 0; | |
| }); | |
| } | |
| function animate() { | |
| drawStars(); | |
| requestAnimationFrame(animate); | |
| } | |
| animate(); | |
| async function startStep(step) { | |
| document.getElementById('outputText').innerText = 'Processing ' + step + ' with AI...'; | |
| // Here you can connect to an AI API (OpenAI/HuggingFace) to get real outputs | |
| setTimeout(() => { | |
| document.getElementById('outputText').innerText = '✅ Completed: ' + step + '\n\n(This is a placeholder for AI output)'; | |
| }, 2000); | |
| } | |