diff --git a/ambiant.mp3 b/ambiant.mp3 new file mode 100644 index 0000000..349e443 Binary files /dev/null and b/ambiant.mp3 differ diff --git a/home.mp3 b/home.mp3 new file mode 100644 index 0000000..f45c063 Binary files /dev/null and b/home.mp3 differ diff --git a/index.html b/index.html index 836a349..c2ee956 100644 --- a/index.html +++ b/index.html @@ -148,8 +148,12 @@ body { #timer-fill { height: 100%; background: #FFD600; border-radius: 99px; transition: background .35s; } #timer-num { font-size: .95rem; color: #ffe066; font-weight: 900; min-width: 28px; text-align: right; transition: color .35s; } -@keyframes timerPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.3); } } -#timer-num.urgent { color: #FF2255; animation: timerPulse .45s ease-in-out infinite; } +@keyframes timerPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.3); } } +@keyframes timerBarBlink { 0%,100% { opacity: 1; } 50% { opacity: .35; } } +#timer-num.warn { color: #FF2255; animation: timerPulse .55s ease-in-out infinite; } +#timer-num.urgent { color: #FF2255; animation: timerPulse .28s ease-in-out infinite; } +#timer-fill.urgent { animation: timerBarBlink .28s ease-in-out infinite; } +#timer-wrap.urgent { filter: drop-shadow(0 0 10px rgba(255,34,85,.75)); } /* ── No-Queen button ── */ #no-queen-btn { @@ -366,7 +370,8 @@ body { // Config // ───────────────────────────────────────────────────── const CFG = { - NUM_BEES: 2500, + NUM_BEES_MIN: 500, // abeilles au 1er cadre + NUM_BEES_MAX: 2500, // abeilles au dernier cadre (progression linéaire) BEE_SPEED: 0.35, // multiplicateur global de vitesse (1.0 = vitesse d'origine) BEE_SCALE: 0.20, // taille des abeilles (1.0 = taille d'origine) @@ -705,6 +710,7 @@ const G = (() => { const elScore = document.getElementById('h-score'); const elTimerF = document.getElementById('timer-fill'); const elTimerN = document.getElementById('timer-num'); + const elTimerW = document.getElementById('timer-wrap'); // ── Screen helpers ── function enterGame() { @@ -730,11 +736,16 @@ const G = (() => { } function timerUI() { - const pct = timeLeft / CFG.FRAME_SECS; + const pct = timeLeft / CFG.FRAME_SECS; + const warn = timeLeft <= 10; + const urgent = timeLeft <= 5; elTimerF.style.width = (pct * 100) + '%'; - elTimerF.style.background = pct < .3 ? '#FF2255' : pct < .6 ? '#ffaa00' : '#FFD600'; + elTimerF.style.background = urgent ? '#FF2255' : warn ? '#ffaa00' : '#FFD600'; elTimerN.textContent = Math.ceil(timeLeft); - elTimerN.classList.toggle('urgent', timeLeft < 10); + elTimerN.classList.toggle('warn', warn && !urgent); + elTimerN.classList.toggle('urgent', urgent); + elTimerF.classList.toggle('urgent', urgent); + elTimerW.classList.toggle('urgent', urgent); } // ── Bees ── @@ -742,8 +753,10 @@ const G = (() => { bees = []; queen = null; hasQueen = Math.random() < CFG.QUEEN_PROB; const W = canvas.width, H = canvas.height; + const t = CFG.NUM_FRAMES > 1 ? frameIdx / (CFG.NUM_FRAMES - 1) : 1; + const numBees = Math.round(CFG.NUM_BEES_MIN + (CFG.NUM_BEES_MAX - CFG.NUM_BEES_MIN) * t); - for (let i = 0; i < CFG.NUM_BEES; i++) { + for (let i = 0; i < numBees; i++) { const type = Math.random() < .9 ? 'worker' : 'drone'; const layer = (Math.random() * 2) | 0; bees.push(new Bee( @@ -777,20 +790,37 @@ const G = (() => { if (!locked) bees.forEach(b => b.update(W, H)); bees.forEach(b => b.draw()); - // Queen reveal ring + // Queen reveal : spotlight + golden ring if (reveal) { - const pulse = .5 + .5 * Math.sin(Date.now() / 130); + const pulse = .5 + .5 * Math.sin(Date.now() / 140); ctx.save(); - ctx.strokeStyle = `rgba(255,55,55,${.55 + pulse * .45})`; - ctx.lineWidth = 3.5; + + // Radial vignette — darken everything outside queen zone + const grad = ctx.createRadialGradient(reveal.x, reveal.y, 70, reveal.x, reveal.y, Math.max(W, H)); + grad.addColorStop(0, 'rgba(0,0,0,0)'); + grad.addColorStop(0.35,'rgba(0,0,0,.55)'); + grad.addColorStop(1, 'rgba(0,0,0,.82)'); + ctx.fillStyle = grad; + ctx.fillRect(0, 0, W, H); + + // Golden pulsing ring + ctx.shadowColor = '#ffd600'; + ctx.shadowBlur = 20 + pulse * 18; + ctx.strokeStyle = `rgba(255,214,0,${.65 + pulse * .35})`; + ctx.lineWidth = 4 + pulse * 2; ctx.beginPath(); - ctx.arc(reveal.x, reveal.y, 44 + pulse * 9, 0, Math.PI * 2); + ctx.arc(reveal.x, reveal.y, 54 + pulse * 10, 0, Math.PI * 2); ctx.stroke(); - ctx.fillStyle = `rgba(255,55,55,${.7 + pulse * .3})`; - ctx.font = 'bold 13px Georgia'; - ctx.textAlign = 'center'; + ctx.shadowBlur = 0; + + // Crown label + ctx.font = 'bold 900 15px Nunito, sans-serif'; + ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; - ctx.fillText('♛ REINE', reveal.x, reveal.y - 58); + ctx.shadowColor = 'rgba(0,0,0,.9)'; + ctx.shadowBlur = 8; + ctx.fillStyle = `rgba(255,220,0,${.85 + pulse * .15})`; + ctx.fillText('♛ REINE', reveal.x, reveal.y - 75); ctx.restore(); } } diff --git a/specs spot.pdf b/specs spot.pdf deleted file mode 100644 index 4e1c85a..0000000 Binary files a/specs spot.pdf and /dev/null differ