commit 93704f8e7429bd269392f7a1be101a7bfa4ca7e6 Author: CJ Date: Sun Jan 18 11:57:54 2026 +0000 Upload files to "/" diff --git a/README.md b/README.md new file mode 100644 index 0000000..c9862cb --- /dev/null +++ b/README.md @@ -0,0 +1,244 @@ +# Studio Buy Me a Coffee at ko-fi.com + +This was originally a project to create a studio style clock you would find in a radio or television studio. + +Once the basic clock was designed I decided to add an indicator for if the microphone is muted or not, as the browser does not have access to the audio panel it polls the microphone looking for sound and reports when sound is detected as an green `ACTIVE` status and red `MUTED` when it does not detect sound. Your browser should prompt you for access to the microphone to perform this check, my browser only presents the default microphone but there is a drop down in case more than one is available to it. + +As the clock is designed for a studio status I also included a green `LIVE` and red `OFF AIR` status indicator, this polls `https://decapi.me/twitch/uptime/${streamer}` on page load and every 60 seconds there after to checks if `offline` is contained within the response, if it is the status will report a red `OFF AIR`. + +As different iterations were made a text box to type the streamers handle was added, to handle if there are any errors the script will also check if `Error` is returned (if the streamer does not exist the website will respond `[Error from Twitch API] 400: Bad Request - Malformed query params.`) and will respond with a yellow `ERROR` status indicator. + +If `Error` and `offline` are not detected it will respond with a green `LIVE` status indicator (the website returns how long the stream has been live at the point it is checked, such as `1 hour, 17 minutes, 45 seconds`). If the streamer is live then the script polls `https://decapi.me/twitch/game/${streamer}` to get the current category and place this below the `LIVE` status indicator, it then passes this to `https://static-cdn.jtvnw.net/ttv-boxart/` to obtain the box art Twitch presents and place this below the category. + +You can find information on the different iterations and testing below along with some documentation on how you can personalise the page to make it your own. If you find any of this useful and would like to buy us a coffee please use the link at the top of this page. + +## [Clock](Clock.html) +A studio style clock with coloured dots at five minute intervals, showing the date and time. + +To change the 5 minute interval dot colour update the `stroke` on row 32 to your desired colour: +``` + stroke: #228B22; +``` + +To change the seconds interval dot colour update the `stroke` on row 36 to your desired colour: +``` + stroke: #880808; +``` + +To change the time and date colour update the `fill` on row 64: +``` + fill: #FF0000; + font-size: 62pt; + font-family: play, sans-serif; + text-anchor: middle; + letter-spacing: -0.05em; +} +``` + +To change the time and date font update the `font-family` on row 66: +``` + font-family: play, sans-serif; +``` + +If you would like seporate colours, sizes, or fonts for the time and date you will need to split the above into two: +``` +svg .hours.minutes, svg .seconds { + fill: #FF0000; + font-size: 62pt; + font-family: play, sans-serif; + text-anchor: middle; + letter-spacing: -0.05em; +} +svg .date { + fill: #FF0000; + font-size: 62pt; + font-family: play, sans-serif; + text-anchor: middle; + letter-spacing: -0.05em; +} +``` +![Studio Clock](img/Studio%20Clock.PNG?raw=true) + +## [Mic Check](Mic%20Check.html) +A webpage to check if sound is being recieved from your mic or not. + +This code will check if audio is being detected, not if the microphone is muted. It uses the MediaStream API to get access to the user's microphone and listens for audio data using the AnalyserNode interface. If audio is being detected, the volume variable will be greater than the threshold value. If no audio is detected then `MUTED` is displayed, when audio is detected `ACTIVE` is displayed on the page. + +![Mic Test - Mic Active](img/Mic%20Test%20Active.PNG?raw=true) +![Mic Test - Mic Muted](img/Mic%20Test%20Muted.PNG?raw=true) + +## [Hard Coded Stream Status](Hard%20Coded%20Stream%20Status.html) +Display whether a Twitch streamer is online or offline using decapi. + +![Streamer Status - Online](img/Stream%20Status%20Hard%20Coded%20Online.png?raw=true) +![Streamer Status - Offline](img/Stream%20Status%20Hard%20Coded%20Offine.png?raw=true) + +To change the stream being monitored update row 37 to your desired Twitch streamers handle: +``` +https://decapi.me/twitch/uptime/ +``` + +To poll more/less frequently update row 56 to your desired interval in milliseconds (default to once a minute): +``` +setInterval(checkStatus, 60000) +``` + +## [Selected Streamer Stream Status](Selected%20Streamer%20Stream%20Status.html) +Display whether a Twitch streamer is online or offline using decapi, users can enter their own stream to monitor. + +To change the default stream being monitored update `value=` on row 72 to your desired Twitch streamers handle: +``` + +``` + +To poll more/less frequently update row 62 to your desired interval in milliseconds (default to once a minute): +``` +}, 60000); +``` + +![Select Streamer - Online](img/Stream%20Status%20Enter%20Name%20Online.PNG?raw=true) +![Select Streamer - Offline](img/Stream%20Status%20Enter%20Name%20Offline.png?raw=true) + +## [Studio Dashboard V1](Studio%20Dashboard.html) +This web page combines [Clock](Clock.html), [Mic Check](Mic%20Check.html), and [Selected Streamer Stream Status](Selected%20Streamer%20Stream%20Status.html) to display a studio clock in the main body of the page, and a mic/stream indicators on the right of the page. + +To change the 5 minute interval dot colour update the `stroke` on row 156 to your desired colour: +``` +stroke: #228B22; +``` + +To change the seconds interval dot colour update the `stroke` on row 161 to your desired colour: +``` +stroke: #880808; +``` + +To change the time and date colour update the `fill` on row 193: +``` +fill: #FF0000; +``` + +To change the time and date font update the `font-family` on row 195: +``` +font-family: play, sans-serif; +``` + +To change the default stream being monitored update `value=` on row 234 to your desired Twitch streamers handle: +``` +
+``` + +To poll more/less frequently update row 322 to your desired interval in milliseconds (default to once a minute): +``` +}, 60000); +``` + +![Studio Dashboard V1](img/Everything.PNG?raw=true) + +To hide the mic selector and streamer selector update their class to `hidden` on rows 230: +``` + +``` +234 and 235: +``` +
+ +``` +![Studio Dashboard - Class Hidden](img/Everything%20With%20Hidden%20Class.PNG?raw=true) + +## [Studio Dashboard V2](Studio%20Dashboard%20V2.html) +This web page combines [Clock](Clock.html), [Mic Check](Mic%20Check.html), and [Selected Streamer Stream Status](Selected%20Streamer%20Stream%20Status.html) to display a studio clock in the main body of the page, and a mic/stream indicators on the right of the page. V2 also adds a button to show or hide the mic select and streamer inputs. + +To change the 5 minute interval dot colour update the `stroke` on row 206 to your desired colour: +``` +stroke: #228B22; +``` + +To change the seconds interval dot colour update the `stroke` on row 211 to your desired colour: +``` +stroke: #880808; +``` + +To change the time and date colour update the `fill` on row 243: +``` +fill: #FF0000; +``` + +To change the time and date font update the `font-family` on row 245: +``` +font-family: play, sans-serif; +``` + +To change the default stream being monitored update `value=` on row 289 to your desired Twitch streamers handle: +``` + +``` + +To poll more/less frequently update row 376 to your desired interval in milliseconds (default to once a minute): +``` +}, 60000); +``` + +![Studio Clock V2 - Show Settings](img/Studio%20Dashboard%20V2%20Show%20Settings.PNG?raw=true) +![Studio Clock V2 - Hide Settings](img/Studio%20Dashboard%20V2%20Hide%20Settings.PNG?raw=true) + +## [Studio Dashboard V3.2](Studio%20Dashboard%20V3.2.html) +This web page combines [Clock](Clock.html), [Mic Check](Mic%20Check.html), and [Selected Streamer Stream Status](Selected%20Streamer%20Stream%20Status.html) to display a studio clock in the main body of the page, and a mic/stream indicators on the right of the page. There is a button to show or hide the mic select and streamer inputs. V3 adds the stream category and art to the dashboard. + +Version 3.1 cleared up some of the CSS from version 3 and ensures the art work resizes with the window. Version 3.2 embeds the fonts in the webpage, changes some of the resizing fonts, and removes some superfluous code from previous iterations. + +To change the 5 minute interval dot colour update the `stroke` on row 218 to your desired colour: +``` +stroke: #4eff4e; +``` + +To change the seconds interval dot colour update the `stroke` on row 223 to your desired colour: +``` +stroke: #FF0000; +``` + +To change the time and date colour update the `fill` on row 255: +``` +fill: #FF0000; +``` + +To change the time and date font update the `font-family` on row 258: +``` +font-family: 'LED Dot-Matrix', sans-serif; +``` +If this font is removed you can also remove rows 4 and 8: +``` + +``` +``` +@import url('https://fonts.cdnfonts.com/css/led-dot-matrix'); +``` + +To change the default stream being monitored update `value=` on row 305 to your desired Twitch streamers handle: +``` + +``` + +To poll more/less frequently update row 409 to your desired interval in milliseconds (default to once a minute): +``` +}, 60000); +``` + +If you want to replace the `Play` font you will need to change rows 46, 76, 105, 111, 118, 142, 155, and 175: +``` +font-family: 'Play', sans-serif; +``` +You can also remove rows 5 and 9: +``` + +``` +``` +@import url('https://fonts.googleapis.com/css2?family=Play&display=swap'); +``` + +### Large Screen +![Studio Clock V3.2 - Off Air](img/Studio%20Dashboard%20V3.2%20Off%20Air.PNG?raw=true) +![Studio Clock V3.2 - On Air](img/Studio%20Dashboard%20V3.2%20Live.PNG?raw=true) + +### Small Screen +![Studio Clock V3.2 - Off Air](img/Studio%20Dashboard%20V3.2%20Off%20Air%20%28Small%29.PNG?raw=true) +![Studio Clock V3.2 - On Air](img/Studio%20Dashboard%20V3.2%20Live%20%28Small%29.PNG?raw=true) \ No newline at end of file diff --git a/Selected Streamer Stream Status.html b/Selected Streamer Stream Status.html new file mode 100644 index 0000000..87bef7f --- /dev/null +++ b/Selected Streamer Stream Status.html @@ -0,0 +1,76 @@ + + + + Status Checker + + + + + + + +
OFFLINE
+ + diff --git a/Studio Dashboard V2.html b/Studio Dashboard V2.html new file mode 100644 index 0000000..e2dbd0f --- /dev/null +++ b/Studio Dashboard V2.html @@ -0,0 +1,441 @@ + + + + Studio Dashboard + + + + +
+
+ + + + + + + + + + Dec 31 + + + +
+ +
+ + + + +

Mic Status

+ +

MUTED

+ + +

Stream Status

+ + +

OFFLINE

+
+ + + + + diff --git a/Studio Dashboard V3.2.html b/Studio Dashboard V3.2.html new file mode 100644 index 0000000..fafd1e7 --- /dev/null +++ b/Studio Dashboard V3.2.html @@ -0,0 +1,474 @@ + + + + + + Studio Dashboard + + + + + +
+ +
+ + + + + + + + + + Dec 31 + + + +
+ +
+ + + +
+
+ +

Mic Status

+ +

MUTED

+ + +

Stream Status

+ + +

OFFLINE

+

+ +
+
+ + + + diff --git a/Studio Dashboard.html b/Studio Dashboard.html new file mode 100644 index 0000000..4591d26 --- /dev/null +++ b/Studio Dashboard.html @@ -0,0 +1,369 @@ + + + + Studio Dashboard + + + +
+
+ + + + + + + + + + Dec 31 + + + +
+ +
+ + +

MUTED

+ + +
+ +

OFFLINE

+
+ + + + + \ No newline at end of file