diff --git a/css/style.css b/css/style.css index 4e14f8a..85267a7 100644 --- a/css/style.css +++ b/css/style.css @@ -12,3 +12,20 @@ button { font-size: 18px; margin: 10px; } + +::placeholder{ + color: white; +} + +#bio { + color:white; + font-size: 20px; + background-color: black; + border: 0px solid black; + border-radius: 7px; +} + +.bio { + color:white; + font-size: 20px; +} diff --git a/views/otheruser.html b/views/otheruser.html new file mode 100644 index 0000000..2a4a62d --- /dev/null +++ b/views/otheruser.html @@ -0,0 +1,37 @@ + + + + + + + USERS Page + + + +

USER

+

Bio:

+ + + + + + diff --git a/views/user.html b/views/user.html index ab3f696..bc55943 100644 --- a/views/user.html +++ b/views/user.html @@ -6,10 +6,15 @@ Logged In +

Welcome Back!

User: USER

+
+ Bio: + +

@@ -19,9 +24,35 @@ async function setuser() { let user = await (await fetch("/api/getuser")).json(); let username + let bio username = user["username"]; + bio = user["bio"] if(user["error"])username=user["error"]; + if(user["error"])bio=user["error"]; + if(!bio)bio="wow such empty" document.getElementById("user").innerText = `User: ${username}`; + document.getElementById("bio").placeholder = bio; + + } + + async function bioChanger() { + document.getElementById("bio").disabled = !document.getElementById("bio").disabled + document.getElementById("changeBio").innerText = (document.getElementById("bio").disabled && "Change Bio") || "Submit" + if(document.getElementById("bio").disabled) { + document.querySelector('style').innerHTML = '::placeholder {color: white;} #bio {border: 0px solid black}' + } + else + { + document.querySelector('style').innerHTML = '::placeholder {color: black;} #bio {border: 2px solid gray}' + } + if(document.getElementById("bio").disabled) { + let response = await sendBio(document.getElementById("bio").value) + console.log(response); + } + } + + async function sendBio(str) { + return await post("/api/setBio",{"Bio":str}) }