mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-18 19:50:58 -04:00
Oops I'm stupid lmao
This commit is contained in:
@@ -147,6 +147,13 @@ client.on('Twitch.UpcomingAd', (response) => {
|
||||
|
||||
function TwitchAdRun(data) {
|
||||
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);
|
||||
TimerLabelAnimation(duration);
|
||||
@@ -162,7 +169,6 @@ function TwitchUpcomingAd(data) {
|
||||
|
||||
// Start the countdown animation
|
||||
setTimeout(() => {
|
||||
upcomingAdWarningStartTime = null;
|
||||
UpcomingAdWarning(warningSeconds);
|
||||
}, upcomingAdWarningStartTime * 1000);
|
||||
}
|
||||
@@ -174,10 +180,6 @@ function TimerBarAnimation(duration) {
|
||||
|
||||
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 left/right, animate vertically
|
||||
switch (barPosition) {
|
||||
@@ -282,8 +284,8 @@ function UpcomingAdWarning(warningSeconds) {
|
||||
startingTime--;
|
||||
countdownLabel.innerText = formatTime(startingTime);
|
||||
if (startingTime == 0) {
|
||||
clearInterval(timerThingy);
|
||||
countdownLabel.innerText = 'NOW!';
|
||||
clearInterval(timerThingy);
|
||||
return;
|
||||
}
|
||||
}, 1000)
|
||||
|
||||
Reference in New Issue
Block a user