Added box height info + alert duration to doAction calls

This commit is contained in:
nuttylmao
2025-05-06 22:55:19 +10:00
parent b9e9b60142
commit b9152ed12d
2 changed files with 15 additions and 3 deletions
+14 -2
View File
@@ -1236,6 +1236,16 @@ function UpdateAlertBox(platform, avatarURL, headerText, descriptionText, attrib
audio.play(); audio.play();
} }
// Add extra useful info to sbData
if (!sbData)
sbData = {};
sbData.boxHeight1 = theContentThatShowsFirstInsteadOfSecond.offsetHeight;
sbData.boxHeight2 = (message && showMesesages) ? theContentThatShowsLastInsteadOfFirst.offsetHeight : 0;
sbData.alertDuration = hideAfter * 1000;
console.log(sbData);
// Run the Streamer.bot action if there is one // Run the Streamer.bot action if there is one
if (globalShowAction) { if (globalShowAction) {
console.debug('Running Streamer.bot action: ' + globalShowAction); console.debug('Running Streamer.bot action: ' + globalShowAction);
@@ -1259,7 +1269,8 @@ function UpdateAlertBox(platform, avatarURL, headerText, descriptionText, attrib
if (message && showMesesages) { if (message && showMesesages) {
theContentThatShowsLastInsteadOfFirst.style.display = 'inline-block'; //theContentThatShowsLastInsteadOfFirst.style.display = 'inline-block';
theContentThatShowsLastInsteadOfFirst.style.visibility = 'visible';
alertBox.style.height = theContentThatShowsLastInsteadOfFirst.offsetHeight + "px"; alertBox.style.height = theContentThatShowsLastInsteadOfFirst.offsetHeight + "px";
theContentThatShowsLastInsteadOfFirst.style.opacity = 1; theContentThatShowsLastInsteadOfFirst.style.opacity = 1;
@@ -1276,7 +1287,8 @@ function UpdateAlertBox(platform, avatarURL, headerText, descriptionText, attrib
alertBox.style.height = '0px'; alertBox.style.height = '0px';
theContentThatShowsFirstInsteadOfSecond.style.opacity = 1; theContentThatShowsFirstInsteadOfSecond.style.opacity = 1;
theContentThatShowsLastInsteadOfFirst.style.opacity = 0; theContentThatShowsLastInsteadOfFirst.style.opacity = 0;
theContentThatShowsLastInsteadOfFirst.style.display = 'none'; //theContentThatShowsLastInsteadOfFirst.style.display = 'none';
theContentThatShowsLastInsteadOfFirst.style.visibility = 'hidden';
widgetLocked = false; widgetLocked = false;
if (alertQueue.length > 0) { if (alertQueue.length > 0) {
console.debug("Pulling next alert from the queue"); console.debug("Pulling next alert from the queue");
+1 -1
View File
@@ -70,7 +70,7 @@ html {
align-items: center; align-items: center;
z-index: 0; z-index: 0;
transition: inherit; transition: inherit;
display: none; /* display: none; */
width: 100%; width: 100%;
} }