diff --git a/frontend/assets/internet.svg b/frontend/assets/internet.svg new file mode 100644 index 0000000..a3bf248 --- /dev/null +++ b/frontend/assets/internet.svg @@ -0,0 +1,34 @@ + + + + + + + + + + \ No newline at end of file diff --git a/frontend/assets/logout.svg b/frontend/assets/logout.svg new file mode 100644 index 0000000..33d5139 --- /dev/null +++ b/frontend/assets/logout.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/frontend/assets/logout2.svg b/frontend/assets/logout2.svg new file mode 100644 index 0000000..5a2ffde --- /dev/null +++ b/frontend/assets/logout2.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/frontend/html/dashboard.html b/frontend/html/dashboard.html index 59065b4..1803cd4 100644 --- a/frontend/html/dashboard.html +++ b/frontend/html/dashboard.html @@ -9,24 +9,29 @@
+ -
+
+
+ + + +
- -
+
+
+
+
+
-
-
-
- -
diff --git a/frontend/scripts/dashboard.js b/frontend/scripts/dashboard.js index 3bd59eb..bba312f 100644 --- a/frontend/scripts/dashboard.js +++ b/frontend/scripts/dashboard.js @@ -18,6 +18,7 @@ async function getData() { getFieldName(userdata) } else if(!response.ok) { const errorMessage = await response.text(); + window.location.href = "../html/index.html"; throw new Error(errorMessage); } } catch (error) { @@ -33,7 +34,7 @@ function updateListGui(field) { let content = contentbox.innerHTML.concat( `
- +

${field["fieldname"]}

@@ -129,6 +130,36 @@ function updateInfoGui(call) { //----------------------------------------------------------------------------------------- +async function logOut() { + try{ + await fetch("/logout", { + method:'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({}) + }) + window.location.href = "../html/index.html"; + } catch(err) { + console.log(err) + } +} + +const logoutbtn = document.querySelector("#logout") + +logoutbtn.addEventListener('click', () => { + console.log("logging out") + logOut() +}) + + +//----------------------------------------------------------------------------------------- + +// window.addEventListener('unload', function() { +// logOut() +// }); + + window.onload = function() { getData(); }; \ No newline at end of file diff --git a/frontend/styles/dashboard.css b/frontend/styles/dashboard.css index ad1202f..ad56d68 100644 --- a/frontend/styles/dashboard.css +++ b/frontend/styles/dashboard.css @@ -30,10 +30,11 @@ body { backdrop-filter: blur(15px); border-radius: 30px; position: relative; - width: 1100px; + width: 1200px; height: 600px; box-shadow: 0px 0px 30px rgba(0, 0, 0, 0.8); overflow: hidden; + justify-content: center; } footer{ @@ -53,14 +54,15 @@ footer p{ display: flex; position: absolute; right: 30px; + bottom: 0; background-color: rgb(0, 255, 255,0.3); border-radius: 20px; - height: 85%; - width: 40%; - /* height: 70vh; - width: 40vw; */ + height: 100%; + width: 45%; justify-content: center; align-items: center; + max-height: 100%; + overflow: auto; } .searchbar { @@ -129,8 +131,8 @@ footer p{ background-color: rgb(255, 255, 255, 0.8); border-radius: 0 0 10px 10px; overflow: auto; - padding-top: 10px; - padding-bottom: 10px; + padding-top: 20px; + padding-bottom: 20px; align-items: center; } @@ -145,6 +147,7 @@ footer p{ border: rgba(0, 255, 255, 0.5) 1px solid; overflow: hidden; align-items: center; + flex-shrink: 0; } .objcontainer div:hover { @@ -193,25 +196,37 @@ footer p{ bottom: 40px; background-color: rgb(0, 255, 255,0.3); border-radius: 20px; - height: 60%; - width: 50%; + height: 70%; + width: 40%; + position: absolute; + bottom: 0; } .infopanel { width: 90%; - height: 80%; + height: 90%; + background-color: rgb(255, 255, 255, 0.8); + border-radius: 10px; +} + +.buttonpanel { + width: 90%; + height: 70%; background-color: rgb(255, 255, 255, 0.8); border-radius: 10px; } .buttonbox { + display: flex; + justify-content: center; + align-items: center; position: absolute; left: 30px; - top: 40px; + top: 0; background-color: rgb(0, 255, 255,0.3); border-radius: 20px; height: 20%; - width: 50%; + width: 40%; } ::-webkit-scrollbar { @@ -230,10 +245,41 @@ footer p{ background: hsl(0, 0%, 33%); } +#logout{ + width: 40px; + height: 40px; + position: absolute; + top: 20px; + right: 20px; + border-radius: 10px; + background-image: url(../assets/logout2.svg); + background-size: cover; + background-color: transparent; + border: none; +} + +#logout:hover{ + background-image: url(../assets/logout2.svg); + opacity: 0.8; +} + +#logout:not(:hover){ + background-image: url(../assets/logout.svg); + opacity: 0.7; +} + +.innerwrapper { + height: 90%; + width: 90%; + padding: 10px; + position: relative; +} + @media (max-width: 860px) { .container{ position: fixed; width: 774px; } -} \ No newline at end of file +} +