From dc8ba099da3818e81de4f56856ce5a331d609133 Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Sat, 8 Jun 2024 11:14:00 -0500 Subject: [PATCH] Updated fullscreen and started work for themes --- index.js | 4 +- webpage/fullscreen.js | 23 +++++- webpage/index.html | 3 + webpage/index.js | 10 ++- webpage/light.css | 186 ++++++++++++++++++++++++++++++++++++++++++ webpage/style.css | 4 +- 6 files changed, 224 insertions(+), 6 deletions(-) create mode 100644 webpage/light.css diff --git a/index.js b/index.js index e9d4a04..a780fdc 100755 --- a/index.js +++ b/index.js @@ -51,7 +51,9 @@ app.get('/fullscreen.js', (req, res) => { app.get('/style.css', (req, res) => { res.sendFile("./webpage/style.css", {root: __dirname}) }) - +app.get('/light.css', (req, res) => { + res.sendFile("./webpage/light.css", {root: __dirname}) +}) app.get('/manifest.json', (req, res) => { res.sendFile("./webpage/manifest.json", {root: __dirname}) }) diff --git a/webpage/fullscreen.js b/webpage/fullscreen.js index eda7535..923cb97 100644 --- a/webpage/fullscreen.js +++ b/webpage/fullscreen.js @@ -131,6 +131,7 @@ class fullscreen{ const legend=document.createElement("legend"); legend.innerText=array[1]; fieldset.appendChild(legend); + let i=0; for(const thing of array[2]){ const div=document.createElement("div"); const input=document.createElement("input"); @@ -138,7 +139,9 @@ class fullscreen{ input.type="radio"; input.name=array[1]; input.value=thing; - + if(i===array[4]){ + input.checked=true; + } const label=document.createElement("label"); label.appendChild(input); @@ -147,6 +150,7 @@ class fullscreen{ label.appendChild(span); div.appendChild(label); fieldset.appendChild(div); + i++ } div.appendChild(fieldset); return div; @@ -154,6 +158,23 @@ class fullscreen{ case "html":{ return array[1]; } + case "select":{ + const div=document.createElement("div"); + const label=document.createElement("label"); + const select=document.createElement("select"); + + label.innerText=array[1]; + div.append(label); + div.appendChild(select); + for(const thing of array[2]){ + const option = document.createElement("option"); + option.innerText=thing; + select.appendChild(option); + } + select.selectedIndex=array[4]; + select.addEventListener("change",array[3]); + return div; + } default: console.error("can't find element:"+array[0]," full element:"+array) return; diff --git a/webpage/index.html b/webpage/index.html index b486624..69aff77 100644 --- a/webpage/index.html +++ b/webpage/index.html @@ -1,7 +1,10 @@ + + + diff --git a/webpage/index.js b/webpage/index.js index 78be2aa..dd49ee6 100644 --- a/webpage/index.js +++ b/webpage/index.js @@ -50,7 +50,7 @@ function lacechannel(c){ function createchannels(fincall){ let name=""; - let catagory=1; + let catagory=2; console.log(fincall) channelselect=new fullscreen( ["vdiv", @@ -59,7 +59,8 @@ function createchannels(fincall){ function(e){ console.log(e) catagory={"text":0,"voice":2,"announcement":5,"catagory":4}[e] - } + }, + 1 ], ["textbox","Name of channel","",function(){ console.log(this) @@ -630,7 +631,10 @@ function genusersettings(){ if(newbio!==null){ thisuser.updatebio(newbio); } - }] + }], + ["select","Theme:",["Dark","Light"],e=>{ + localStorage.setItem("theme",["Dark","Light"][e.target.selectedIndex]); + },["Dark","Light"].indexOf(localStorage.getItem("theme"))] ], ["vdiv", ["html",hypothetcialprofie] diff --git a/webpage/light.css b/webpage/light.css new file mode 100644 index 0000000..6d4bb17 --- /dev/null +++ b/webpage/light.css @@ -0,0 +1,186 @@ +.centeritem { + background: #a3b8e9; +} +.nonimagecenter{ + border-color: #b1afd8; +} +.background{ + background:#000000bf; +} +.messagediv:hover{ + background:rgb(162 162 198); +} +pre{ + background:#101014; + color: white; +} +samp{ + background:#101014; +} +.contextbutton{ + background:rgb(139 139 255); + color:#01021a; +} +.infosection{ + background:#57577c; +} +.profile{ + background:#a4a0bb; +} +.hypoprofile{ + background:#a4a0bb; +} +.contextbutton:hover{ + background:rgb(84 84 166); +} +.contextmenu{ + background:#a4a2b1; +} +.blankserver{ + background:#8b8b98; +} +body{ + background:rgb(160 160 229); + color:black; +} +#channels{ + background:rgb(123 123 196); +} +input{ + background:rgb(163 163 210); + color:black; +} +.spoiler{ + background:black; + color:black; +} +.spoiler:hover{ + background:#111111; + color:#111111; +} +.unspoiled{ + background:#454545; + color: black; +} + +.unspoiled:before { + background-color: rgb(0 0 0); + background-clip: content-box; +} +.replying{ + background:#5f68bb; +} +#typing{ + background:#161616; +} +.lightbr{ + border-color: #929292; + color:black; + background-color:#9ea7dd; +} +.Home{ + background:#7ea6b9; +} +.timestamp{ + color:#2c2b31; + +} +.reply{ + border-color:#000000; +} +.replytext{ + padding:.05in; + color:#1f1f21; +} +::-webkit-scrollbar-track { + + + background: #978fae; +} + +::-webkit-scrollbar-thumb { + background: #52515a; + box-shadow: 0px 2px 5px #000000; +} + +::-webkit-scrollbar-thumb:hover { + background: #63636a; + box-shadow: 0px 2px 5px #000000; +} +.pronouns{ + color: #111111; +} +textarea{ + background:#9ea9e3; +} + +.Channel:hover{ + background:#5a4fb9; +} +.servertd{ + background:#a5a5dc; + border-color:#8c8cb0; +} + +.channeleffects:hover{ + background:#554ab8; +} +.tag{ + color:black; +} +#userdock{ + background:#626292; +} +#settings:hover{ + background:#473962; +} +#userinfo{ + background:#4e3c8f; +} +button{ + color:black; + background:#6363c6; +} +input::file-selector-button{ + color:black; + background:#6363c6; +} +#logindiv{ + background: #33363d; + border-color:#131315; +} +.addchannel:hover{ + background:#524089; +} +input[type="checkbox"] { + accent-color:#5b5dbf; + color:black; +} +.quoteline{ + background:#636274; +} +#loading{ + background:#9ba0cd; +} +.unkownfile{ + background:#a69cbb; + border-color:#474555; +} +.filename{ + color:#47bbff; +} + +.unread{ + background:#ffffff; + border-color:black; +} +.pinged{ + background:red; +} +.cunread{ + box-shadow: inset .024in 0 white; +} + +.startreply{ + background: black; +} \ No newline at end of file diff --git a/webpage/style.css b/webpage/style.css index d642770..9870969 100644 --- a/webpage/style.css +++ b/webpage/style.css @@ -617,7 +617,9 @@ span{ .notiunread{ transform:translate(0in,.2in); } -.h2md{font-size: .25in;} +.h2md{ + font-size: .25in; +} .pinged{ aspect-ratio : 1 / 1; transform:translate(0in,.4in);