From b4a9cd9d540d42a61bee9045d41ada392305a8d5 Mon Sep 17 00:00:00 2001 From: Akash Keshav <112591754+domesticchores@users.noreply.github.com> Date: Fri, 4 Apr 2025 14:53:32 -0400 Subject: add light/dark mode toggle, only homepage is fully functional. -ak --- ufund-ui/public/cr.png | Bin 0 -> 1548178 bytes ufund-ui/public/jf.png | Bin 1159826 -> 819422 bytes ufund-ui/src/app/app.component.css | 1 - ufund-ui/src/app/app.component.html | 7 ++-- ufund-ui/src/app/app.component.ts | 6 +++ .../components/home-page/home-page.component.css | 16 ++++++-- .../components/home-page/home-page.component.html | 10 +++-- .../components/home-page/home-page.component.ts | 16 +++++++- ufund-ui/src/index.html | 2 +- ufund-ui/src/styles.css | 45 ++++++++++++++++----- 10 files changed, 78 insertions(+), 25 deletions(-) create mode 100644 ufund-ui/public/cr.png (limited to 'ufund-ui') diff --git a/ufund-ui/public/cr.png b/ufund-ui/public/cr.png new file mode 100644 index 0000000..2d9a5a1 Binary files /dev/null and b/ufund-ui/public/cr.png differ diff --git a/ufund-ui/public/jf.png b/ufund-ui/public/jf.png index bbf95d5..94250ec 100644 Binary files a/ufund-ui/public/jf.png and b/ufund-ui/public/jf.png differ diff --git a/ufund-ui/src/app/app.component.css b/ufund-ui/src/app/app.component.css index f4ed668..6cb44f6 100644 --- a/ufund-ui/src/app/app.component.css +++ b/ufund-ui/src/app/app.component.css @@ -34,7 +34,6 @@ /*}*/ a { - color: light-dark(black, white); text-decoration: none; } diff --git a/ufund-ui/src/app/app.component.html b/ufund-ui/src/app/app.component.html index f697695..a6e6e6a 100644 --- a/ufund-ui/src/app/app.component.html +++ b/ufund-ui/src/app/app.component.html @@ -5,12 +5,13 @@
diff --git a/ufund-ui/src/app/app.component.ts b/ufund-ui/src/app/app.component.ts index bc0e71a..635061c 100644 --- a/ufund-ui/src/app/app.component.ts +++ b/ufund-ui/src/app/app.component.ts @@ -49,5 +49,11 @@ export class AppComponent implements OnInit { location.reload() } + toggleColorScheme() { + let newTheme = this.document.body.parentElement!.getAttribute("theme") == "light" ? "dark" : "light"; + this.document.body.parentElement!.setAttribute("theme",newTheme); + console.log(newTheme, this.document.body.parentElement); + } + protected readonly userType = userType; } diff --git a/ufund-ui/src/app/components/home-page/home-page.component.css b/ufund-ui/src/app/components/home-page/home-page.component.css index a10377f..f6e5631 100644 --- a/ufund-ui/src/app/components/home-page/home-page.component.css +++ b/ufund-ui/src/app/components/home-page/home-page.component.css @@ -6,7 +6,6 @@ justify-content: center; overflow: clip; } - #hero { display: flex; /*flex-direction: column;*/ @@ -19,12 +18,21 @@ h1 { max-width: 1200px; } +#cr { + opacity: var(--opacity-cr); +} + #jf { - /*position: absolute;*/ + opacity: var(--opacity-jf); +} + +.text-highlight { + text-decoration: underline; + color: var(--highlight-color); } #right { - max-width: 500px; + max-width: 450px; max-height: 500px; display: flex; justify-content: center; @@ -33,6 +41,6 @@ h1 { } #left { - max-width: 500px; + max-width: 550px; z-index: 1; } diff --git a/ufund-ui/src/app/components/home-page/home-page.component.html b/ufund-ui/src/app/components/home-page/home-page.component.html index 7a7ff96..051132e 100644 --- a/ufund-ui/src/app/components/home-page/home-page.component.html +++ b/ufund-ui/src/app/components/home-page/home-page.component.html @@ -1,10 +1,14 @@View our online cupboard holding all needs related to sea life preservation
- +