pub / tw2html

Checks online status of streams on twitch.tv and lets you watch them
git clone https://https://src.jayvii.de/pub/tw2html.git
Home | Log | Files | Exports | Refs | README | RSS

commit 9c87ba1f57de6a076ba00f4ab496946fd06a45ed
parent f29deb646c5e1ec2af37294cb11c4d76981d8d20
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Mon, 29 Jul 2024 15:17:49 +0200

fix: color save button if cookie dies not fit

Diffstat:
Mindex.php | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/index.php b/index.php @@ -53,8 +53,15 @@ $streams = array( <header> <nav> <!-- Save Button --> - <a href="#" onclick="document.cookie='streams=<?php echo implode(",", $streams["stream"]); ?>;path=/;max-age=31536000;';" - style="<?php echo "color:" . $save_col; ?>" + <a + id="savebtn" + href="#" + onclick="document.cookie='streams=<?php echo implode(",", $streams["stream"]); ?>;path=/;max-age=31536000;';document.querySelector('#savebtn').style.color='inherit';" + <?php + if (implode(",", $streams["stream"]) != $_COOKIE["streams"]) { + echo "style=color:#db4325"; + } + ?> > Save </a>