Merge branch 'main' of lavender.software:erin/lila-chat

pull/13/head
~erin 2021-07-24 13:00:48 -04:00
commit 475729b1a0
2 changed files with 88 additions and 0 deletions

65
frontend/index.css Normal file
View File

@ -0,0 +1,65 @@
html {
background: #F7A8B8;
font-family: "Lucida Console", "Courier New", monospace;
}
a {
color: black;
font-weight: bold;
text-decoration: none;
}
#streamchat {
display: flex;
height: 100%;
max-width: 960px;
margin: 0 auto;
}
#stream {
background-color: white;
padding: 5%;
box-shadow: 10px 10px 10px black;
border-radius: 5px;
width: 854px;
height: 480px;
margin-right: 0.3em;
margin-left: -40%;
margin-top: auto;
margin-bottom: 20%;
}
#chatbox {
flex: 1;
height: 53rem;
margin-left: 0.3em;
margin-right: -30%;
border: none;
}
.navigation-list {
display: flex;
list-style-type: none;
flex-wrap: wrap;
gap: 10px;
justify-content: center;
padding: 0;
}
.buttons {
width: 150px;
background-color: #55CDFC;
margin: auto;
margin-bottom: 2%;
display: inline-flex;
justify-content: center;
opacity: 0.8;
font-size: larger;
color: black;
padding: 15px;
border-bottom: solid;
border-left: solid;
border-color: white;
border-width: 1px;
}

23
frontend/logout.js Normal file
View File

@ -0,0 +1,23 @@
//VARIBLES
// //IF NOT LOGGED IN DON'T SHOW LOG IN BUTTON
// if (username === '') {
// document.getElementById("logoutlink").style.display = "none";
// }
//LOGOUT FETCH FUNCTION
async function logout() {
let sendLogoutInfo = { "name": username }
fetch('/api/logout/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(sendLogoutInfo),
});
document.querySelector("#errormessage").innerHTML = 'Logged out.'
localStorage.removeItem('username')
username = null;
loggedIn()
}