Compare commits

...

3 Commits

Author SHA1 Message Date
Luna 231de3a257 Orgasnized files 2021-07-26 15:23:13 -07:00
Luna c59c46bcd5 Added a message if there is no stream and changed font 2021-07-26 15:02:41 -07:00
Luna 7c78c5572f Added command support 2021-07-26 15:02:20 -07:00
15 changed files with 106 additions and 85 deletions

View File

@ -1,9 +1,14 @@
html {
background: #F7A8B8;
text-align: center;
font-family: "Lucida Console", "Courier New", monospace;
font-family: "Linotte", "Lucida Console", monospace;
}
@font-face {
font-family: Linotte;
src: url(../assets/LinotteRegular.otf);
}
form {
width: 100%;
overflow:hidden;

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

View File

@ -1,55 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="120"
height="120"
viewBox="0 0 31.75 31.75"
version="1.1"
id="svg5"
inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)"
sodipodi:docname="favicon.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#505050"
bordercolor="#ffffff"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="1"
inkscape:document-units="px"
showgrid="false"
inkscape:zoom="3.4731066"
inkscape:cx="53.698323"
inkscape:cy="76.732456"
inkscape:window-width="1900"
inkscape:window-height="986"
inkscape:window-x="10"
inkscape:window-y="10"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<circle
style="fill:none;fill-opacity:1;stroke:#f7a8b8;stroke-width:3.71222;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path846"
cx="15.874998"
cy="15.874998"
r="14.018888" />
<ellipse
style="fill:#f7a8b8;fill-opacity:1;stroke:none;stroke-width:1.85611;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="circle1164"
cx="15.875"
cy="15.875"
rx="7.0094452"
ry="7.0094447" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -7,7 +7,7 @@
<meta name="description" content="Maya's Stream Chat">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charset="UTF-8">
<link rel="stylesheet" href="chat.css">
<link rel="stylesheet" href="../html/chat.css">
<link rel="icon" href="">
</head>
@ -34,8 +34,8 @@
<div id="errormessage"></div>
<script src="chat.js"></script>
<script src="logout.js"></script>
<script src="../js/chat.js"></script>
<script src="../js/logout.js"></script>
</body>

View File

@ -7,8 +7,8 @@
<meta name="description" content="Chat Login">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
<link rel="icon" href="/favicon.svg">
<link rel="stylesheet" href="../css/style.css">
<link rel="icon" href="../assets/favicon.svg">
</head>
<body>
@ -27,7 +27,7 @@
</form>
</div>
<script src="login.js"></script>
<script src="../js/login.js"></script>
<div id="errormessage"></div>

View File

@ -7,8 +7,8 @@
<meta name="description" content="Chat Register">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
<link rel="icon" href="/favicon.svg">
<link rel="stylesheet" href="../css/style.css">
<link rel="icon" href="../assets/favicon.svg">
</head>
<h1>Register:</h1>
@ -45,7 +45,7 @@
<div id="errormessage"></div>
<script src="register.js"></script>
<script src="../js/register.js"></script>
</body>
</html>

View File

@ -7,8 +7,8 @@
<meta name="description" content="Chat Login Change">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
<link rel="icon" href="/favicon.svg">
<link rel="stylesheet" href="../css/style.css">
<link rel="icon" href="../assets/favicon.svg">
</head>
<body>
@ -53,7 +53,7 @@
</form>
</div>
<script src="updateinfo.js"></script>
<script src="../js/updateinfo.js"></script>
<div id="errormessage"></div>
</body>

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charset="UTF-8">
<link rel="stylesheet" href="index.css">
<link rel="icon" href="/favicon.svg">
<link rel="icon" href="asssets/favicon.svg">
</head>
<body>
@ -18,16 +18,16 @@
<li><a href="index.html">
<div class="buttons">Stream</div>
</a></li>
<li><a href="chat.html">
<li><a href="/html/chat.html">
<div class="buttons">Just Chat</div>
</a></li>
<li><a href="register.html">
<li><a href="/html/register.html">
<div class="buttons">Register</div>
</a></li>
<li><a href="login.html">
<li><a href="/html/login.html">
<div class="buttons">Login</div>
</a></li>
<li><a href="updateinfo.html">
<li><a href="/html/updateinfo.html">
<div class="buttons">Update Info</div>
</a></li>
</ul>
@ -35,16 +35,33 @@
</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>
<iframe id="streamframe" src="https://live.on.chaos.stream/maya" title="mayas stream"
scrolling="no"></iframe>
</div>
<iframe id="chatbox" src="chat.html" title="chat box" scrolling="no"></iframe>
<iframe id="chatbox" src="/html/chat.html" title="chat box" scrolling="no"></iframe>
</div>

View File

@ -27,7 +27,7 @@ form.addEventListener("submit", async function (event) {
localStorage.removeItem('username')
form.reset()
}
return formMessage;
})
//SEND MESSAGE FETCH FUNCTION
@ -42,6 +42,7 @@ async function sendMessage() {
body: JSON.stringify(sendMessageInfo),
})
form.reset()
modCommand()
}
@ -55,7 +56,17 @@ async function fetchMessages() {
document.getElementById("chatbox").innerHTML = ""
for (const message of recievedMessages) {
printText(message.user.bold().toString() + ": " + message.body.toString());
let leftBracket = '('
let rightBracket = ')'
let space = ' '
if (message.pronouns === '' || message.pronouns === 'none' || message.pronouns === null) {
leftBracket = ''
rightBracket = ''
space = ''
}
printText(message.user.bold().toString() + space + leftBracket.small() + message.pronouns.small().toString() + rightBracket.small() + ": " + message.body.toString());
}
@ -90,12 +101,48 @@ function loggedIn() {
loggedIn()
//MODERATION
async function modCommand() {
let action = ''
let target = ''
if (formMessage.startsWith('/ban')) {
action = "Ban"
target = formMessage.replace('/ban ', '')
sendCommand()
} else if (formMessage.startsWith('/kick')) {
action = "Kick"
target = formMessage.replace('/kick ', '')
sendCommand()
} else if (formMessage.startsWith('/promote')) {
action = "Promote"
target = formMessage.replace('/promote ', '')
sendCommand()
} else if (formMessage.startsWith('/demote')) {
action = "Demote"
target = formMessage.replace('/demote ', '')
sendCommand()
} else {
return;
}
async function sendCommand() {
let sendCommand = { "name": username, "action": action, "target": target }
const response = await fetch('/api/mod/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(sendCommand),
});
if (response.status === 'ok') {
return;
} else {
printText('Error Issuing Command. Are you an Admin or Mod?')
}
}
}
//REVIECE USERS PRONOUNS
async function getPronouns() {
const response = await fetch(`api/users/${username}/`);
const data = await response.json();
pronouns = data.pronouns
return pronouns;
}