lilachat-frontend/index.html
2021-07-26 15:48:24 -07:00

73 lines
No EOL
2.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Maya's Stream</title>
<meta name="author" content="Luna">
<meta name="description" content="Maya's Stream">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charset="UTF-8">
<link rel="stylesheet" href="css/index.css">
<link rel="icon" href="assets/favicon.svg">
</head>
<body>
<nav>
<ul class="navigation-list">
<li><a href="index.html">
<div class="buttons">Stream</div>
</a></li>
<li><a href="/html/chat.html">
<div class="buttons">Just Chat</div>
</a></li>
<li><a href="/html/register.html">
<div class="buttons">Register</div>
</a></li>
<li><a href="/html/login.html">
<div class="buttons">Login</div>
</a></li>
<li><a href="/html/updateinfo.html">
<div class="buttons">Update Info</div>
</a></li>
</ul>
</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>
<section>
<div id="streamchat">
<div id="stream">
<iframe id="streamframe" src="https://live.on.chaos.stream/maya" title="mayas stream"
scrolling="no"></iframe>
</div>
<iframe id="chatbox" src="/html/chat.html" title="chat box" scrolling="no"></iframe>
</div>
</section>
</main>
</body>
</html>