diff --git a/index.php b/index.php index b94c010..3334773 100644 --- a/index.php +++ b/index.php @@ -112,6 +112,18 @@ $liveIndex = get_live_index($schedule); justify-content: center; } + @keyframes shake { + 0% { transform: translate(0, 0); } + 25% { transform: translate(-8px, 8px); } + 50% { transform: translate(8px, -8px); } + 75% { transform: translate(-8px, -8px); } + 100% { transform: translate(0, 0); } + } + + .shake { + animation: shake 0.15s cubic-bezier(.36,.07,.19,.97) both; + } + .background-container { position: fixed; top: 0; @@ -707,6 +719,7 @@ $liveIndex = get_live_index($schedule); const playIcon = document.getElementById("play-icon"); const trackTitle = document.getElementById("track-title"); const bgContainer = document.querySelector(".background-container"); + const appContainer = document.querySelector(".app-container"); const canvas = document.getElementById("visualizer"); const canvasCtx = canvas.getContext("2d"); @@ -782,6 +795,12 @@ $liveIndex = get_live_index($schedule); const flashColor = useWhite ? "#ffffff" : getComplementaryColor(waveColor); document.documentElement.style.setProperty("--flash-color", flashColor); flashEl.style.opacity = "0.3"; + + // Shake UI effect + appContainer.classList.remove("shake"); + void appContainer.offsetWidth; // Trigger reflow + appContainer.classList.add("shake"); + setTimeout(() => { flashEl.style.transition = "opacity 0.4s ease-out"; flashEl.style.opacity = "0";