From a605c28d9968773fc7166a903c3e113dba8bd6e7 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Fri, 6 Feb 2026 17:51:21 +0000 Subject: [PATCH] valentine 3.5 --- assets/js/main.js | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/assets/js/main.js b/assets/js/main.js index fc15cca..71d82a3 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -64,7 +64,7 @@ document.addEventListener('DOMContentLoaded', () => { .then(data => { if (data.success) { document.documentElement.style.setProperty('--bg-image', `url('${data.path}?t=${new Date().getTime()}')`); - location.reload(); // Reload to update the "Remove" button visibility + location.reload(); } else { alert(data.error || 'Failed to upload background image'); } @@ -130,7 +130,7 @@ document.addEventListener('DOMContentLoaded', () => { } }); - // "No" Button Dodging Logic + // "No" Button Proximity Evasion Logic const dodgeThreshold = 100; // pixels document.addEventListener('mousemove', (e) => { @@ -140,11 +140,14 @@ document.addEventListener('DOMContentLoaded', () => { const btnCenterX = rect.left + rect.width / 2; const btnCenterY = rect.top + rect.height / 2; - const distance = Math.hypot(e.clientX - btnCenterX, e.clientY - btnCenterY); + const dx = e.clientX - btnCenterX; + const dy = e.clientY - btnCenterY; + const distance = Math.hypot(dx, dy); if (distance < dodgeThreshold) { - const angle = Math.atan2(e.clientY - btnCenterY, e.clientX - btnCenterX); - const moveDist = dodgeThreshold - distance + 20; + const angle = Math.atan2(dy, dx); + // Move away an equal distance to maintain the threshold + const moveDist = dodgeThreshold - distance; let newX = rect.left - Math.cos(angle) * moveDist; let newY = rect.top - Math.sin(angle) * moveDist; @@ -161,11 +164,12 @@ document.addEventListener('DOMContentLoaded', () => { } }); - // "No" Click Logic + // "No" Click Logic - On the off chance it is pressed if (noBtn) { noBtn.addEventListener('click', (e) => { e.preventDefault(); - yesScale += 0.15; + // Does nothing (no navigation/success), just grows the yes button + yesScale += 0.2; yesBtn.style.transform = `scale(${yesScale})`; }); } @@ -177,7 +181,8 @@ document.addEventListener('DOMContentLoaded', () => { successBox.style.display = 'block'; // Hide controls during celebration - document.querySelector('.admin-controls').style.display = 'none'; + const adminControls = document.querySelector('.admin-controls'); + if (adminControls) adminControls.style.display = 'none'; // Confetti effect const duration = 15 * 1000; @@ -206,4 +211,4 @@ document.addEventListener('DOMContentLoaded', () => { }, 15000); }); } -}); +}); \ No newline at end of file