Pronouns now have color

main
Luna 2021-07-28 10:44:29 -07:00
parent ba36c159fc
commit 169ee4f792
1 changed files with 1 additions and 8 deletions

View File

@ -4,7 +4,6 @@ let username = localStorage.getItem('username');
const form = document.querySelector('form'); const form = document.querySelector('form');
// SEND A MESSAGE // SEND A MESSAGE
// GRABS MESSAGE FROM FORM & SENDS // GRABS MESSAGE FROM FORM & SENDS
form.addEventListener("submit", async function (event) { form.addEventListener("submit", async function (event) {
event.preventDefault(); event.preventDefault();
@ -31,7 +30,6 @@ form.addEventListener("submit", async function (event) {
}) })
//SEND MESSAGE FETCH FUNCTION //SEND MESSAGE FETCH FUNCTION
async function sendMessage() { async function sendMessage() {
sendMessageInfo = { "name": username, "body": formMessage } sendMessageInfo = { "name": username, "body": formMessage }
fetch('../api/message/send', { fetch('../api/message/send', {
@ -47,7 +45,6 @@ async function sendMessage() {
// RECIEVE MESSAGES // RECIEVE MESSAGES
let messageUpdate = window.setInterval(fetchMessages, 1000); let messageUpdate = window.setInterval(fetchMessages, 1000);
async function fetchMessages() { async function fetchMessages() {
@ -66,7 +63,7 @@ async function fetchMessages() {
rightBracket = '' rightBracket = ''
space = '' space = ''
} }
printText(message.user.bold().toString() + space + leftBracket.small() + message.pronouns.small().toString() + rightBracket.small() + ": " + message.body.toString()); printText(message.user.bold().toString() + space + "<i style='color:#b8d1e7'>" + leftBracket.small() + message.pronouns.small().toString() + rightBracket.small() + "</i>" + " : " + "<span style='color:#e4e4ef'>" + message.body.toString() + "</span>");
} }
@ -80,7 +77,6 @@ async function fetchMessages() {
// FUNCTION TO PRINT MESSAGES IN THE CHAT BOX // FUNCTION TO PRINT MESSAGES IN THE CHAT BOX
function printText(text) { function printText(text) {
let p = document.createElement("p"); let p = document.createElement("p");
const div = document.getElementById("chatbox"); const div = document.getElementById("chatbox");
@ -102,7 +98,6 @@ function loggedIn() {
loggedIn() loggedIn()
//MODERATION //MODERATION
async function modCommand() { async function modCommand() {
let action = '' let action = ''
let target = '' let target = ''
@ -144,5 +139,3 @@ async function sendCommand() {
} }
} }