diff options
author | metamuffin <metamuffin@disroot.org> | 2023-10-27 22:39:17 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-10-27 22:39:17 +0200 |
commit | 019ece5db107f5e4f096fdd2b8b20d1bfd0847d2 (patch) | |
tree | 0344be8efe9c154ebe043a5efe3a5ff45db02c23 | |
parent | 6b5fbb8c9864f370ef5daf870518f9d3c48f46c5 (diff) | |
download | jellything-019ece5db107f5e4f096fdd2b8b20d1bfd0847d2.tar jellything-019ece5db107f5e4f096fdd2b8b20d1bfd0847d2.tar.bz2 jellything-019ece5db107f5e4f096fdd2b8b20d1bfd0847d2.tar.zst |
purple theme
-rw-r--r-- | api.md | 2 | ||||
-rw-r--r-- | common/src/user.rs | 9 | ||||
-rw-r--r-- | server/src/routes/ui/account/settings.rs | 4 | ||||
-rw-r--r-- | server/src/routes/ui/layout.rs | 8 | ||||
-rw-r--r-- | web/style/themes.css | 6 |
5 files changed, 18 insertions, 11 deletions
@@ -34,7 +34,7 @@ Where `role` is one of `backdrop` or `poster` and `width` is the width of the resolution you want to image to be in. The actual returned resolution must not be exactly what you requested. Returns assets for a node. -## GET* `/stream/<id>?<format>&<abr>&<vbr>&<index>&<tracks>&<webm>` +## GET* `/stream/<id>?<format>&<index>&<profile>&<index>&<tracks>&<webm>` Responds with the stream directly or a redirect to the actual source in case of federation. diff --git a/common/src/user.rs b/common/src/user.rs index 17700a0..2b67de5 100644 --- a/common/src/user.rs +++ b/common/src/user.rs @@ -20,6 +20,15 @@ pub struct User { pub enum Theme { Dark, Light, + Purple, +} + +impl Theme { + pub const LIST: &'static [(Theme, &'static str)] = &[ + (Theme::Dark, "Dark"), + (Theme::Light, "Light"), + (Theme::Purple, "Purple"), + ]; } #[derive(Debug, Clone, Serialize, Deserialize, Default)] diff --git a/server/src/routes/ui/account/settings.rs b/server/src/routes/ui/account/settings.rs index 6a9a50e..2192d43 100644 --- a/server/src/routes/ui/account/settings.rs +++ b/server/src/routes/ui/account/settings.rs @@ -66,8 +66,8 @@ fn settings_page(session: Session, flash: Option<MyResult<String>>) -> DynLayout form[method="POST", action=uri!(r_account_settings_post())] { fieldset { legend { "Theme" } - @for (t, tlabel) in [(Theme::Dark, "Dark theme"), (Theme::Light, "Light theme")] { - label { input[type="radio", name="theme", value=A(t), checked=session.user.theme==t]; @tlabel } br; + @for (t, tlabel) in Theme::LIST { + label { input[type="radio", name="theme", value=A(*t), checked=session.user.theme==*t]; @tlabel } br; } } input[type="submit", value="Apply"]; diff --git a/server/src/routes/ui/layout.rs b/server/src/routes/ui/layout.rs index c4d1275..3ba5e88 100644 --- a/server/src/routes/ui/layout.rs +++ b/server/src/routes/ui/layout.rs @@ -104,16 +104,12 @@ impl<'r, Main: Render> Responder<'r, 'static> for LayoutPage<Main> { main: self.content, title: self.title, class: &format!( - "{} {}", + "{} theme-{:?}", self.class.as_deref().unwrap_or(""), - match session + session .as_ref() .map(|s| s.user.theme) .unwrap_or(Theme::Dark) - { - Theme::Dark => "theme-dark", - Theme::Light => "theme-light", - } ), session, } diff --git a/web/style/themes.css b/web/style/themes.css index 685b4e9..460da9d 100644 --- a/web/style/themes.css +++ b/web/style/themes.css @@ -6,7 +6,7 @@ body { --c-warn: rgb(252, 255, 78); --c-sucess: rgb(117, 255, 117); } -body.theme-dark { +body.theme-Dark { --c-nav: #1c1c1c9a; --c-nav-hover: #ffffff10; --c-fade: black; @@ -21,7 +21,7 @@ body.theme-dark { --font-dark: rgb(122, 122, 122); --font-highlight: white; } -body.theme-light { +body.theme-Light { --c-nav: #c4c4c4d7; --c-nav-hover: #ffffff10; --c-fade: white; @@ -36,3 +36,5 @@ body.theme-light { --font-dark: rgb(0, 0, 0); --font-highlight: rgb(0, 0, 0); } +body.theme-Purple { +} |