From b9152ed12d91cbdfc8ff1080f8edf6f545f2aaed Mon Sep 17 00:00:00 2001 From: nuttylmao Date: Tue, 6 May 2025 22:55:19 +1000 Subject: [PATCH] Added box height info + alert duration to doAction calls --- multistream-alerts/script.js | 16 ++++++++++++++-- multistream-alerts/style.css | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/multistream-alerts/script.js b/multistream-alerts/script.js index f618883..86d6f59 100644 --- a/multistream-alerts/script.js +++ b/multistream-alerts/script.js @@ -1236,6 +1236,16 @@ function UpdateAlertBox(platform, avatarURL, headerText, descriptionText, attrib 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 if (globalShowAction) { console.debug('Running Streamer.bot action: ' + globalShowAction); @@ -1259,7 +1269,8 @@ function UpdateAlertBox(platform, avatarURL, headerText, descriptionText, attrib if (message && showMesesages) { - theContentThatShowsLastInsteadOfFirst.style.display = 'inline-block'; + //theContentThatShowsLastInsteadOfFirst.style.display = 'inline-block'; + theContentThatShowsLastInsteadOfFirst.style.visibility = 'visible'; alertBox.style.height = theContentThatShowsLastInsteadOfFirst.offsetHeight + "px"; theContentThatShowsLastInsteadOfFirst.style.opacity = 1; @@ -1276,7 +1287,8 @@ function UpdateAlertBox(platform, avatarURL, headerText, descriptionText, attrib alertBox.style.height = '0px'; theContentThatShowsFirstInsteadOfSecond.style.opacity = 1; theContentThatShowsLastInsteadOfFirst.style.opacity = 0; - theContentThatShowsLastInsteadOfFirst.style.display = 'none'; + //theContentThatShowsLastInsteadOfFirst.style.display = 'none'; + theContentThatShowsLastInsteadOfFirst.style.visibility = 'hidden'; widgetLocked = false; if (alertQueue.length > 0) { console.debug("Pulling next alert from the queue"); diff --git a/multistream-alerts/style.css b/multistream-alerts/style.css index 26c6327..1b6172e 100644 --- a/multistream-alerts/style.css +++ b/multistream-alerts/style.css @@ -70,7 +70,7 @@ html { align-items: center; z-index: 0; transition: inherit; - display: none; + /* display: none; */ width: 100%; }