From cd99fea48398d8802a6bc1b39ec0056371b9f092 Mon Sep 17 00:00:00 2001 From: MCorange Date: Wed, 3 Sep 2025 21:20:40 +0300 Subject: [PATCH] iwannadriveintoapoleat200kilometersperhourpleasesendhelp --- res/css/global.css | 16 +++++++++++++--- res/js/global.js | 15 +++++++++++++++ src/pages/documents.rs | 2 +- src/pages/events.rs | 2 +- src/pages/roster.rs | 2 +- templates/base.html | 28 ++++++++++++++-------------- templates/documents.html | 2 +- templates/events.html | 2 +- templates/index.html | 2 +- templates/roster.html | 2 +- 10 files changed, 49 insertions(+), 24 deletions(-) create mode 100644 res/js/global.js diff --git a/res/css/global.css b/res/css/global.css index 484d70b..85e847b 100644 --- a/res/css/global.css +++ b/res/css/global.css @@ -8,6 +8,7 @@ } body { + margin: 0; background: var(--bg-color); font-family: Arial, Helvetica, sans-serif; } @@ -52,12 +53,12 @@ body { height: 3rem; } - #topnav_profile span { font-size: 21px; } #topnav_profile img { + cursor: pointer; /*position: absolute;*/ width: 3rem; height: 100%; @@ -69,16 +70,25 @@ body { position: relative; } + +#topnav_profile_dropdown:hover { + +} #topnav_profile_dropdown { + display: none; + padding: 5px; + background: var(--bg-color-l); + border: 2px solid var(--bg-color-d); + border-radius: 5px; position: absolute; margin-top: 0.5rem; - display: flex; right: 0px; flex-direction: column; } .topnav_profile_button { - width: 6rem; + width: 8rem; + height: 2.5rem; background: var(--bg-color-ll); border: 2px solid var(--bg-color); border-radius: 10px; diff --git a/res/js/global.js b/res/js/global.js new file mode 100644 index 0000000..25f0e11 --- /dev/null +++ b/res/js/global.js @@ -0,0 +1,15 @@ + +document.addEventListener("keydown", (event) => { + if (event.key === "Escape") on_pfp_click(true); +}); + + + +function on_pfp_click(close = false) { + const el = document.getElementById("topnav_profile_dropdown"); + if (!close && (el.style.display === "none" || el.style.display === "")) { + el.style.display = "flex"; + } else { + el.style.display = "none"; + } +} diff --git a/src/pages/documents.rs b/src/pages/documents.rs index a83c750..a00c0c2 100644 --- a/src/pages/documents.rs +++ b/src/pages/documents.rs @@ -2,7 +2,7 @@ use askama::Template; use axum::{http::StatusCode, response::Html}; #[derive(Debug, Template, Clone)] -#[template(path = "index.html")] +#[template(path = "documents.html")] pub struct PageTemplate {} pub async fn page() -> (StatusCode, Html) { diff --git a/src/pages/events.rs b/src/pages/events.rs index a83c750..b56ad3a 100644 --- a/src/pages/events.rs +++ b/src/pages/events.rs @@ -2,7 +2,7 @@ use askama::Template; use axum::{http::StatusCode, response::Html}; #[derive(Debug, Template, Clone)] -#[template(path = "index.html")] +#[template(path = "events.html")] pub struct PageTemplate {} pub async fn page() -> (StatusCode, Html) { diff --git a/src/pages/roster.rs b/src/pages/roster.rs index a83c750..845c422 100644 --- a/src/pages/roster.rs +++ b/src/pages/roster.rs @@ -2,7 +2,7 @@ use askama::Template; use axum::{http::StatusCode, response::Html}; #[derive(Debug, Template, Clone)] -#[template(path = "index.html")] +#[template(path = "roster.html")] pub struct PageTemplate {} pub async fn page() -> (StatusCode, Html) { diff --git a/templates/base.html b/templates/base.html index d992fca..3f6dcf7 100644 --- a/templates/base.html +++ b/templates/base.html @@ -5,6 +5,7 @@ {% block title %}{% endblock %} + {% block headers %}{% endblock %} @@ -26,23 +27,22 @@
MCorange - Profile Picture + Profile Picture
- - - - - + + + +
diff --git a/templates/documents.html b/templates/documents.html index d076169..f8ff409 100644 --- a/templates/documents.html +++ b/templates/documents.html @@ -7,5 +7,5 @@ {% block content %} -

Hello!!!!!!!

+

Hello documents!!!!!!!

{% endblock %} diff --git a/templates/events.html b/templates/events.html index d076169..8ae3082 100644 --- a/templates/events.html +++ b/templates/events.html @@ -7,5 +7,5 @@ {% block content %} -

Hello!!!!!!!

+

Hello events!!!!!!!

{% endblock %} diff --git a/templates/index.html b/templates/index.html index d076169..1d8bcbb 100644 --- a/templates/index.html +++ b/templates/index.html @@ -7,5 +7,5 @@ {% block content %} -

Hello!!!!!!!

+

Hello Dashboard!!!!!!!!

{% endblock %} diff --git a/templates/roster.html b/templates/roster.html index d076169..ff77d66 100644 --- a/templates/roster.html +++ b/templates/roster.html @@ -7,5 +7,5 @@ {% block content %} -

Hello!!!!!!!

+

Hello roster!!!!!!!

{% endblock %}