Oops I'm stupid lmao

This commit is contained in:
nuttylmao
2025-06-05 08:10:12 +10:00
parent 92295463cd
commit 14482edff3
+8 -6
View File
@@ -147,6 +147,13 @@ client.on('Twitch.UpcomingAd', (response) => {
function TwitchAdRun(data) { function TwitchAdRun(data) {
const duration = data.length_seconds; const duration = data.length_seconds;
// Unset the upcoming ad countdown warning
upcomingAdWarningStartTime = null;
// Slide the warning off screen
let width = upcomingAdWarningContainer.getBoundingClientRect().width;
upcomingAdWarningContainer.style.right = -width + "px";
TimerBarAnimation(duration); TimerBarAnimation(duration);
TimerLabelAnimation(duration); TimerLabelAnimation(duration);
@@ -162,7 +169,6 @@ function TwitchUpcomingAd(data) {
// Start the countdown animation // Start the countdown animation
setTimeout(() => { setTimeout(() => {
upcomingAdWarningStartTime = null;
UpcomingAdWarning(warningSeconds); UpcomingAdWarning(warningSeconds);
}, upcomingAdWarningStartTime * 1000); }, upcomingAdWarningStartTime * 1000);
} }
@@ -174,10 +180,6 @@ function TimerBarAnimation(duration) {
timerBarLocked = true; timerBarLocked = true;
// Slide the warning off screen
let width = upcomingAdWarningContainer.getBoundingClientRect().width;
upcomingAdWarningContainer.style.right = -width + "px";
// If the bar is top/bottom, animate horizontally // If the bar is top/bottom, animate horizontally
// If the bar is left/right, animate vertically // If the bar is left/right, animate vertically
switch (barPosition) { switch (barPosition) {
@@ -282,8 +284,8 @@ function UpcomingAdWarning(warningSeconds) {
startingTime--; startingTime--;
countdownLabel.innerText = formatTime(startingTime); countdownLabel.innerText = formatTime(startingTime);
if (startingTime == 0) { if (startingTime == 0) {
clearInterval(timerThingy);
countdownLabel.innerText = 'NOW!'; countdownLabel.innerText = 'NOW!';
clearInterval(timerThingy);
return; return;
} }
}, 1000) }, 1000)