Added a message if there is no stream and changed font

main
Luna 2021-07-26 15:02:41 -07:00
parent 7c78c5572f
commit c59c46bcd5
3 changed files with 26 additions and 2 deletions

BIN
LinotteRegular.otf Normal file

Binary file not shown.

View File

@ -1,6 +1,11 @@
html { html {
background: #F7A8B8; background: #F7A8B8;
font-family: "Lucida Console", "Courier New", monospace; font-family: "Linotte", "Lucida Console", monospace;
}
@font-face {
font-family: Linotte;
src: url(LinotteRegular.otf);
} }
a { a {
@ -25,6 +30,8 @@ a {
margin-left: -40%; margin-left: -40%;
margin-top: auto; margin-top: auto;
margin-bottom: 20%; margin-bottom: 20%;
font-size: 250%;
text-align: center;
} }
#streamframe { #streamframe {

View File

@ -35,13 +35,30 @@
</nav> </nav>
<script>
// Checking if the stream is down and displays a message if it is.
async function isStreamDown() {
const response = await fetch(`https://cdn.chaos.stream/hls/src/maya.m3u8`);
if (response.status === 404) {
document.getElementById("streamframe").style.display = "none";
document.getElementById("stream").style.border = 'double'
document.getElementById("stream").innerHTML = 'Currently not streaming.'
}
}
window.onload = isStreamDown()
</script>
<main> <main>
<section> <section>
<div id="streamchat"> <div id="streamchat">
<div id="stream"> <div id="stream">
<iframe id="streamframe" src="https://live.on.chaos.stream/maya" title="mayas stream" scrolling="no"></iframe> <iframe id="streamframe" src="https://live.on.chaos.stream/maya" title="mayas stream"
scrolling="no"></iframe>
</div> </div>
<iframe id="chatbox" src="chat.html" title="chat box" scrolling="no"></iframe> <iframe id="chatbox" src="chat.html" title="chat box" scrolling="no"></iframe>