From 69790c32d5cd271e57953e2820bd5d2e16dc900b Mon Sep 17 00:00:00 2001 From: Mystikfluu Date: Thu, 26 May 2022 14:37:13 +0200 Subject: [PATCH] made the index webpage into two parts added register/login links when not logged in when logged in, chat and profile links are shown --- js/index.js | 8 ++++++++ views/index.html | 36 ++++++++++++++++++++++++------------ 2 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 js/index.js diff --git a/js/index.js b/js/index.js new file mode 100644 index 0000000..f949edb --- /dev/null +++ b/js/index.js @@ -0,0 +1,8 @@ +window.addEventListener("load",async function(){ + let data = await(await fetch("/api/getuser")).json() + if(data["username"] != undefined) { + document.getElementById("HasAccount").style="" + } else { + document.getElementById("NoAccount").style="" + } +}) diff --git a/views/index.html b/views/index.html index 22b3909..339baf8 100644 --- a/views/index.html +++ b/views/index.html @@ -1,27 +1,39 @@ - +
-

Auth website

+

IPost

- Do you not have an account? Register now! + + IPost is a revolutionary chatting website
+ featuring an innovative design


- Do you already have an account? Login now! -
-
- This is open source, find more about this project on github + + + + + This is open source, find more about this project on github