mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-19 04:00:59 -04:00
Oops I'm stupid lmao
This commit is contained in:
@@ -148,6 +148,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)
|
||||||
|
|||||||
Reference in New Issue
Block a user