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/src/app/app.component.css | 1 - ufund-ui/src/app/app.component.html | 7 ++++--- ufund-ui/src/app/app.component.ts | 6 ++++++ .../src/app/components/home-page/home-page.component.css | 16 ++++++++++++---- .../app/components/home-page/home-page.component.html | 10 +++++++--- .../src/app/components/home-page/home-page.component.ts | 16 ++++++++++++++-- 6 files changed, 43 insertions(+), 13 deletions(-) (limited to 'ufund-ui/src/app') 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 @@
- Dashboard - Cupboard - Basket + + + +
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 @@
-

Helping fund coral reef and marine life conservation

+

Helping fund coral reef and + marine life conservation.

View our online cupboard holding all needs related to sea life preservation

- +
diff --git a/ufund-ui/src/app/components/home-page/home-page.component.ts b/ufund-ui/src/app/components/home-page/home-page.component.ts index 95e8962..71c2549 100644 --- a/ufund-ui/src/app/components/home-page/home-page.component.ts +++ b/ufund-ui/src/app/components/home-page/home-page.component.ts @@ -1,4 +1,5 @@ -import {Component} from '@angular/core'; +import {Component, Inject, OnInit} from '@angular/core'; +import { DOCUMENT } from '@angular/common'; @Component({ selector: 'app-home-page', @@ -6,6 +7,17 @@ import {Component} from '@angular/core'; templateUrl: './home-page.component.html', styleUrl: './home-page.component.css' }) -export class HomePageComponent { +export class HomePageComponent implements OnInit { + + constructor( + @Inject(DOCUMENT) private document: Document + ) {} + ngOnInit(): void { + console.log(this.document.documentElement); + } + + + + } -- cgit v1.2.3 From ac6fa949a754778f268fb91f0b32464c153191ef Mon Sep 17 00:00:00 2001 From: Akash Keshav <112591754+domesticchores@users.noreply.github.com> Date: Fri, 4 Apr 2025 20:49:15 -0400 Subject: refactor login-page and need-list to support light/dark mode --- .../src/app/components/login/login.component.css | 54 ++++++++++++++++++---- .../src/app/components/login/login.component.html | 15 +++--- .../components/need-list/need-list.component.css | 14 ++++-- .../components/need-list/need-list.component.html | 4 +- .../components/need-page/need-page.component.css | 2 +- 5 files changed, 69 insertions(+), 20 deletions(-) (limited to 'ufund-ui/src/app') diff --git a/ufund-ui/src/app/components/login/login.component.css b/ufund-ui/src/app/components/login/login.component.css index b56b4eb..fc1d9da 100644 --- a/ufund-ui/src/app/components/login/login.component.css +++ b/ufund-ui/src/app/components/login/login.component.css @@ -2,29 +2,60 @@ display: flex; align-items: center; justify-content: center; - height: 100%; - /*background-image: url("https://www.fineshare.com/background/jellyfish-under-fluorescent-illumination.jpg");*/ - background: rgba(0, 0, 0, .65) url("https://4kwallpapers.com/images/wallpapers/blue-jellyfish-aquarium-underwater-glowing-marine-life-1920x1080-3546.jpg"); + width: 100vw; + height: 150vh; + overflow: hidden; + background-color: transparent; background-blend-mode: darken; - margin-top: -66px + margin-top: -150px; + overflow: hidden; +} + +#bg-cr { + position: absolute; + margin-top: -150px; + top:0; + width: 100vw; + height: calc(100vh + 150px); + background: linear-gradient(to bottom, rgba(84, 45, 0, 0) 30%, rgba(84, 45, 0, 0.1) 40%), url("/login-cr.png"); + opacity: calc(var(--opacity-cr)); + z-index: 1; +} +#bg-jf { + position: absolute; + top:0; + width: 100vw; + height: 100vh; + background: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 30%), url("/login-jf.png"); + opacity: var(--opacity-jf); + z-index: 1; } #box { display: flex; flex-direction: column; - max-width: 350px; + align-items: center; + aspect-ratio: 4/5; + min-height: 50vh; + margin-top: 15vh; gap: 10px; + /* background-color: var(--background-color); */ backdrop-filter: blur(10px); - background-color: rgba(0, 0, 0, 0.1); - padding: 30px; + padding: 50px 40px; color: white; border-radius: 5px; border-style: solid; border-width: 1px; - border-color: rgb(140, 140, 255); + border-color: var(--highlight-color); + z-index: 2; } +#greeting { + font-size: 32px; + /* text-decoration: underline; + text-decoration-color: var(--highlight-color); */ +} .border { border-style: solid; border-width: 1px; @@ -34,3 +65,10 @@ background-color: white; box-shadow: 0 0 10px 10px black; } + +#signup { + color: var(--highlight-color); + text-decoration: underline; + text-decoration-thickness: 1px; + text-decoration-color: var(--highlight-color); +} \ No newline at end of file diff --git a/ufund-ui/src/app/components/login/login.component.html b/ufund-ui/src/app/components/login/login.component.html index 1017d0f..27eab96 100644 --- a/ufund-ui/src/app/components/login/login.component.html +++ b/ufund-ui/src/app/components/login/login.component.html @@ -1,9 +1,12 @@
-

Login

- - - -
- New? Create an account +

Login

+ + + +
+

New?

Create an account.

+
+
+ diff --git a/ufund-ui/src/app/components/need-list/need-list.component.css b/ufund-ui/src/app/components/need-list/need-list.component.css index e17609b..0172ff4 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.css +++ b/ufund-ui/src/app/components/need-list/need-list.component.css @@ -5,7 +5,7 @@ } .needEntry { - background-color: #2e2e2e; + background-color: var(--tertiary-color); display: flex; flex-direction: column; border-radius: 5px; @@ -37,6 +37,14 @@ select { } } +.sort-scheme { + background-color: var(--background-color); + border-style: solid; + border-color: var(--foreground-color); + border-radius: 5px; + border-width: 1px; +} + #sortArea { display: flex; flex-direction: row; @@ -86,7 +94,7 @@ select { .clickable { padding: 10px; - background-color: #3a3a3a; + background-color: var(--secondary-color); border-radius: 5px; cursor: pointer; height: 130px; @@ -96,7 +104,7 @@ select { } .clickable:hover { - background-color: #444444; + background-color: var(--tertiary-color); } .actionArea { diff --git a/ufund-ui/src/app/components/need-list/need-list.component.html b/ufund-ui/src/app/components/need-list/need-list.component.html index 84f80dc..18da39c 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.html +++ b/ufund-ui/src/app/components/need-list/need-list.component.html @@ -7,7 +7,7 @@
- @@ -16,7 +16,7 @@ {{sortMode === 'Ascending' ? 'arrow_upward': 'arrow_downward'}} - +
diff --git a/ufund-ui/src/app/components/need-page/need-page.component.css b/ufund-ui/src/app/components/need-page/need-page.component.css index 44db4b4..47aa8b3 100644 --- a/ufund-ui/src/app/components/need-page/need-page.component.css +++ b/ufund-ui/src/app/components/need-page/need-page.component.css @@ -47,7 +47,7 @@ aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; - box-shadow: rgb(0, 40, 70) 0 0 50px; + box-shadow: var(--dark-highlight-clor) 0 0 50px; } .urgent { -- cgit v1.2.3 From 1ac878b4aaa19ab889c7a98b7dab6acd57c778b3 Mon Sep 17 00:00:00 2001 From: Akash Keshav <112591754+domesticchores@users.noreply.github.com> Date: Sat, 5 Apr 2025 22:00:00 -0400 Subject: finish styling basket and list; add persistent theme via localStorage. -ak --- ufund-ui/src/app/app.component.ts | 17 ++++++++++++++++- .../funding-basket/funding-basket.component.css | 6 +++--- .../funding-basket/funding-basket.component.html | 2 +- .../app/components/need-list/need-list.component.css | 8 -------- .../app/components/need-list/need-list.component.html | 2 +- 5 files changed, 21 insertions(+), 14 deletions(-) (limited to 'ufund-ui/src/app') diff --git a/ufund-ui/src/app/app.component.ts b/ufund-ui/src/app/app.component.ts index 635061c..2fecc2d 100644 --- a/ufund-ui/src/app/app.component.ts +++ b/ufund-ui/src/app/app.component.ts @@ -38,6 +38,15 @@ export class AppComponent implements OnInit { this.authService.restoreLogin(dataParsed.username, dataParsed.key) console.log("Key found", dataParsed.key) } + + let theme = localStorage.getItem("theme") + if(!theme) { + // if no color scheme is set, get the system settings + let preferredTheme = this.document.defaultView?.matchMedia('(prefers-color-scheme: light)').matches ? "light" : "dark"; + localStorage.setItem("theme",preferredTheme); + theme = preferredTheme; + } + this.document.body.parentElement!.setAttribute("theme",theme); } login() { @@ -50,8 +59,14 @@ export class AppComponent implements OnInit { } toggleColorScheme() { - let newTheme = this.document.body.parentElement!.getAttribute("theme") == "light" ? "dark" : "light"; + let theme = localStorage.getItem("theme"); + // fallback + if (!theme) { + theme = "light"; + } + let newTheme = theme == "light" ? "dark" : "light"; this.document.body.parentElement!.setAttribute("theme",newTheme); + localStorage.setItem("theme", newTheme); console.log(newTheme, this.document.body.parentElement); } diff --git a/ufund-ui/src/app/components/funding-basket/funding-basket.component.css b/ufund-ui/src/app/components/funding-basket/funding-basket.component.css index c46ef57..bd41fda 100644 --- a/ufund-ui/src/app/components/funding-basket/funding-basket.component.css +++ b/ufund-ui/src/app/components/funding-basket/funding-basket.component.css @@ -11,7 +11,7 @@ } .needEntry { - background-color: #2e2e2e; + background-color: var(--tertiary-color); display: flex; flex-direction: column; border-radius: 5px; @@ -66,13 +66,13 @@ .clickable { padding: 10px; - background-color: #3a3a3a; + background-color: var(--secondary-color); border-radius: 5px; cursor: pointer; } .clickable:hover { - background-color: #444444; + background-color: var(--tertiary-color); } .actionArea { diff --git a/ufund-ui/src/app/components/funding-basket/funding-basket.component.html b/ufund-ui/src/app/components/funding-basket/funding-basket.component.html index 52b35c1..b88ef31 100644 --- a/ufund-ui/src/app/components/funding-basket/funding-basket.component.html +++ b/ufund-ui/src/app/components/funding-basket/funding-basket.component.html @@ -63,7 +63,7 @@
- + diff --git a/ufund-ui/src/app/components/need-list/need-list.component.css b/ufund-ui/src/app/components/need-list/need-list.component.css index 0172ff4..56ae6a6 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.css +++ b/ufund-ui/src/app/components/need-list/need-list.component.css @@ -37,14 +37,6 @@ select { } } -.sort-scheme { - background-color: var(--background-color); - border-style: solid; - border-color: var(--foreground-color); - border-radius: 5px; - border-width: 1px; -} - #sortArea { display: flex; flex-direction: row; diff --git a/ufund-ui/src/app/components/need-list/need-list.component.html b/ufund-ui/src/app/components/need-list/need-list.component.html index 18da39c..e9f70f6 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.html +++ b/ufund-ui/src/app/components/need-list/need-list.component.html @@ -1,7 +1,7 @@
- - - + Dashboard + Cupboard + Basket - + brightness_7
-- cgit v1.2.3 From e89bcbad67886174463d8e36ce16d02012881779 Mon Sep 17 00:00:00 2001 From: sowgro Date: Sun, 6 Apr 2025 19:32:00 -0400 Subject: fix dashboard, make buttons use secondary color by default --- ufund-ui/src/app/components/dashboard/dashboard.component.css | 4 ++-- .../src/app/components/mini-need-list/mini-need-list.component.css | 6 +++--- ufund-ui/src/app/components/need-list/need-list.component.css | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'ufund-ui/src/app') diff --git a/ufund-ui/src/app/components/dashboard/dashboard.component.css b/ufund-ui/src/app/components/dashboard/dashboard.component.css index 54f362b..cb4ad74 100644 --- a/ufund-ui/src/app/components/dashboard/dashboard.component.css +++ b/ufund-ui/src/app/components/dashboard/dashboard.component.css @@ -17,7 +17,7 @@ } .card { - background-color: #2e2e2e; + background-color: var(--tertiary-color); width: 400px; height: 130px; border-radius: 5px; @@ -34,7 +34,7 @@ .listCard { display: flex; flex-direction: column; - background-color: #2e2e2e; + background-color: var(--tertiary-color); border-radius: 5px; padding: 10px; gap: 10px; diff --git a/ufund-ui/src/app/components/mini-need-list/mini-need-list.component.css b/ufund-ui/src/app/components/mini-need-list/mini-need-list.component.css index 6dceee1..67f2094 100644 --- a/ufund-ui/src/app/components/mini-need-list/mini-need-list.component.css +++ b/ufund-ui/src/app/components/mini-need-list/mini-need-list.component.css @@ -9,7 +9,7 @@ height: 175px; display: flex; align-items: center; - color: #878787; + color: gray; } #needList { @@ -25,7 +25,7 @@ padding: 10px; display: flex; flex-direction: column; - background-color: #3a3a3a; + background-color: var(--secondary-color); border-radius: 5px; height: 175px; width: 200px; @@ -41,7 +41,7 @@ } .needEntry:hover { - background-color: #444444; + background-color: var(--hover-color); } .needName { diff --git a/ufund-ui/src/app/components/need-list/need-list.component.css b/ufund-ui/src/app/components/need-list/need-list.component.css index b3af85f..bbbb024 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.css +++ b/ufund-ui/src/app/components/need-list/need-list.component.css @@ -98,7 +98,7 @@ } .clickable:hover { - background-color: var(--tertiary-color); + background-color: var(--hover-color); } .actionArea { -- cgit v1.2.3 From 88865595e2735784537e076a5b8d6edbf6fb6138 Mon Sep 17 00:00:00 2001 From: sowgro Date: Sun, 6 Apr 2025 19:52:12 -0400 Subject: Improve sort-scheme --- .../src/app/components/funding-basket/funding-basket.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ufund-ui/src/app') diff --git a/ufund-ui/src/app/components/funding-basket/funding-basket.component.html b/ufund-ui/src/app/components/funding-basket/funding-basket.component.html index 6363c68..7158194 100644 --- a/ufund-ui/src/app/components/funding-basket/funding-basket.component.html +++ b/ufund-ui/src/app/components/funding-basket/funding-basket.component.html @@ -3,7 +3,7 @@

Funding Basket

- + -- cgit v1.2.3 From 89aad1c2631ea9d02100273bd4ab89c7792e8da7 Mon Sep 17 00:00:00 2001 From: sowgro Date: Sun, 6 Apr 2025 19:58:03 -0400 Subject: Make need-edit dialog use variable colors --- ufund-ui/src/app/components/need-edit/need-edit.component.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ufund-ui/src/app') diff --git a/ufund-ui/src/app/components/need-edit/need-edit.component.css b/ufund-ui/src/app/components/need-edit/need-edit.component.css index b06e061..2d04510 100644 --- a/ufund-ui/src/app/components/need-edit/need-edit.component.css +++ b/ufund-ui/src/app/components/need-edit/need-edit.component.css @@ -11,8 +11,8 @@ padding: 10px; border-style: solid; border-width: 1px; - border-color: #6c6c6c; - background-color: #2e2e2e; + border-color: var(--secondary-color); + background-color: var(--tertiary-color); border-radius: 5px; position: relative; width: 500px; -- cgit v1.2.3 From 1a70784c75ba26713e040bb44e9fbc6867079010 Mon Sep 17 00:00:00 2001 From: sowgro Date: Sun, 6 Apr 2025 20:06:59 -0400 Subject: Remove color from * and fix toasts in light mode --- ufund-ui/src/app/app.component.css | 1 + ufund-ui/src/app/components/toast/toast.component.css | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'ufund-ui/src/app') diff --git a/ufund-ui/src/app/app.component.css b/ufund-ui/src/app/app.component.css index 3f3d053..ff1e58c 100644 --- a/ufund-ui/src/app/app.component.css +++ b/ufund-ui/src/app/app.component.css @@ -54,6 +54,7 @@ /*}*/ a { + color: var(--foreground-color); text-decoration: none; } diff --git a/ufund-ui/src/app/components/toast/toast.component.css b/ufund-ui/src/app/components/toast/toast.component.css index 82e2ff3..5d2a7df 100644 --- a/ufund-ui/src/app/components/toast/toast.component.css +++ b/ufund-ui/src/app/components/toast/toast.component.css @@ -20,7 +20,8 @@ display: flex; flex-direction: row; padding: 3px 15px; - background-color: #3a3a3a; + color: var(--foreground-color); + background-color: var(--secondary-color); border-radius: 100000px; gap: 10px; align-items: center; @@ -54,4 +55,5 @@ .toast.error { background-color: #d81a1a; + color: white; } -- cgit v1.2.3 From 512f00544e77c4e942a1813a774875bff86b5c2f Mon Sep 17 00:00:00 2001 From: sowgro Date: Sun, 6 Apr 2025 20:12:13 -0400 Subject: Improve contrast of urgent text --- ufund-ui/src/app/components/need-list/need-list.component.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ufund-ui/src/app') diff --git a/ufund-ui/src/app/components/need-list/need-list.component.css b/ufund-ui/src/app/components/need-list/need-list.component.css index bbbb024..02e170b 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.css +++ b/ufund-ui/src/app/components/need-list/need-list.component.css @@ -72,7 +72,7 @@ .urgent { font-size: 11pt; background-color: rgba(255, 165, 0, 0.27); - color: rgba(255, 165, 0, 1); + color: light-dark(rgb(138, 93, 0),rgba(255, 165, 0, 1)); padding: 2px; border-radius: 5px; } -- cgit v1.2.3 From a8aee88cdf95eea5aaeb450b0474aa85dc556cc2 Mon Sep 17 00:00:00 2001 From: sowgro Date: Mon, 7 Apr 2025 00:54:03 -0400 Subject: Other tweaks --- ufund-ui/src/app/components/need-page/need-page.component.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ufund-ui/src/app') diff --git a/ufund-ui/src/app/components/need-page/need-page.component.css b/ufund-ui/src/app/components/need-page/need-page.component.css index 6ca1350..7f357db 100644 --- a/ufund-ui/src/app/components/need-page/need-page.component.css +++ b/ufund-ui/src/app/components/need-page/need-page.component.css @@ -42,7 +42,7 @@ .urgent { font-size: 11pt; background-color: rgba(255, 165, 0, 0.27); - color: rgba(255, 165, 0, 1); + color: light-dark(rgb(138, 93, 0),rgba(255, 165, 0, 1)); padding: 2px; border-radius: 5px; } -- cgit v1.2.3 From c2afee3111e8c84993b491711c3c4eeb6b2df6db Mon Sep 17 00:00:00 2001 From: sowgro Date: Mon, 7 Apr 2025 01:02:29 -0400 Subject: Remove underline from highlight text --- ufund-ui/src/app/components/home-page/home-page.component.css | 1 - 1 file changed, 1 deletion(-) (limited to 'ufund-ui/src/app') 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 47e6ebd..c345a0b 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 @@ -27,7 +27,6 @@ h1 { } .text-highlight { - text-decoration: underline; color: var(--highlight-color); } -- cgit v1.2.3 From 5549a7b00b96cca229d09057bc08b55d30a0c349 Mon Sep 17 00:00:00 2001 From: sowgro Date: Mon, 7 Apr 2025 11:25:57 -0400 Subject: Adjust spacing between needs --- ufund-ui/src/app/components/need-list/need-list.component.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ufund-ui/src/app') diff --git a/ufund-ui/src/app/components/need-list/need-list.component.css b/ufund-ui/src/app/components/need-list/need-list.component.css index 02e170b..38ed4df 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.css +++ b/ufund-ui/src/app/components/need-list/need-list.component.css @@ -8,7 +8,7 @@ #needList { display: flex; flex-direction: column; - gap: 15px + gap: 10px } .needName { -- cgit v1.2.3 From 0d0959d6ac3e81869ba848371d9b6ea12710debc Mon Sep 17 00:00:00 2001 From: sowgro Date: Mon, 7 Apr 2025 11:52:24 -0400 Subject: Fix colors on login / signup pages --- ufund-ui/src/app/components/login/login.component.css | 6 ++---- ufund-ui/src/app/components/signup/signup.component.css | 7 +++---- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'ufund-ui/src/app') diff --git a/ufund-ui/src/app/components/login/login.component.css b/ufund-ui/src/app/components/login/login.component.css index fc1d9da..f38865b 100644 --- a/ufund-ui/src/app/components/login/login.component.css +++ b/ufund-ui/src/app/components/login/login.component.css @@ -8,7 +8,6 @@ background-color: transparent; background-blend-mode: darken; margin-top: -150px; - overflow: hidden; } #bg-cr { @@ -40,10 +39,9 @@ min-height: 50vh; margin-top: 15vh; gap: 10px; - /* background-color: var(--background-color); */ + background-color: color-mix(in srgb, var(--background-color), transparent 50%); backdrop-filter: blur(10px); padding: 50px 40px; - color: white; border-radius: 5px; border-style: solid; border-width: 1px; @@ -71,4 +69,4 @@ text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--highlight-color); -} \ No newline at end of file +} diff --git a/ufund-ui/src/app/components/signup/signup.component.css b/ufund-ui/src/app/components/signup/signup.component.css index aa90e04..207135f 100644 --- a/ufund-ui/src/app/components/signup/signup.component.css +++ b/ufund-ui/src/app/components/signup/signup.component.css @@ -15,14 +15,13 @@ flex-direction: column; max-width: 500px; gap: 10px; - backdrop-filter: blur(25px); - background-color: rgba(0, 0, 0, 0.1); + backdrop-filter: blur(10px); + background-color: color-mix(in srgb, var(--background-color), transparent 50%); padding: 30px; - color: white; border-radius: 5px; border-style: solid; border-width: 1px; - border-color: rgb(140, 140, 255); + border-color: var(--highlight-color); & > div { display: flex; -- cgit v1.2.3 From b6bc0e5e9be234c58ad5d8554f6614d22e2738f8 Mon Sep 17 00:00:00 2001 From: Tyler Ferrari <69283684+Sowgro@users.noreply.github.com> Date: Mon, 7 Apr 2025 12:09:49 -0400 Subject: Fix update need bug The current would reset to 0 --- ufund-ui/src/app/components/need-edit/need-edit.component.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'ufund-ui/src/app') diff --git a/ufund-ui/src/app/components/need-edit/need-edit.component.ts b/ufund-ui/src/app/components/need-edit/need-edit.component.ts index abfa543..b63d9c1 100644 --- a/ufund-ui/src/app/components/need-edit/need-edit.component.ts +++ b/ufund-ui/src/app/components/need-edit/need-edit.component.ts @@ -53,6 +53,7 @@ export class NeedEditComponent implements OnChanges { } updateNeed(need: Need) { + need.current = this.need?.current ?? 0 this.cupboardService.updateNeed(need.id, need) .pipe(catchError((ex, _) => { if (ex.status == 500) { -- cgit v1.2.3 From d2858b59e495186d51eebd188f84534fe68fc420 Mon Sep 17 00:00:00 2001 From: sowgro Date: Mon, 7 Apr 2025 13:37:01 -0400 Subject: Disable pagination in checkout --- .../app/components/funding-basket/funding-basket.component.html | 2 +- .../src/app/components/funding-basket/funding-basket.component.ts | 1 + ufund-ui/src/app/components/need-list/need-list.component.html | 8 ++++---- ufund-ui/src/app/components/need-list/need-list.component.ts | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) (limited to 'ufund-ui/src/app') diff --git a/ufund-ui/src/app/components/funding-basket/funding-basket.component.html b/ufund-ui/src/app/components/funding-basket/funding-basket.component.html index 7158194..a5fec6f 100644 --- a/ufund-ui/src/app/components/funding-basket/funding-basket.component.html +++ b/ufund-ui/src/app/components/funding-basket/funding-basket.component.html @@ -8,7 +8,7 @@ deleteRemove from Basket - +
+
+
-- cgit v1.2.3 From b45f42c348d5b6ea25e0c320843e613d40c4db61 Mon Sep 17 00:00:00 2001 From: sowgro Date: Mon, 7 Apr 2025 17:09:25 -0400 Subject: Fix alignment of color mode toggle --- ufund-ui/src/app/app.component.css | 6 +++++- ufund-ui/src/app/app.component.html | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'ufund-ui/src/app') diff --git a/ufund-ui/src/app/app.component.css b/ufund-ui/src/app/app.component.css index ab1e60f..6841606 100644 --- a/ufund-ui/src/app/app.component.css +++ b/ufund-ui/src/app/app.component.css @@ -61,5 +61,9 @@ } .current { - text-decoration: underline!important; + text-decoration: underline !important; +} + +#darkMode:hover { + text-decoration: none !important; } diff --git a/ufund-ui/src/app/app.component.html b/ufund-ui/src/app/app.component.html index 7277682..03c6338 100644 --- a/ufund-ui/src/app/app.component.html +++ b/ufund-ui/src/app/app.component.html @@ -11,7 +11,7 @@ Basket - brightness_7 + brightness_7 -- cgit v1.2.3 From eeec3e68327ed5b989680a74893e2dcee3ff3e22 Mon Sep 17 00:00:00 2001 From: sowgro Date: Mon, 7 Apr 2025 20:39:10 -0400 Subject: Fix sorting and searching bugs, save sort mode and algo to localStorage --- .../components/cupboard/cupboard.component.html | 4 +- .../app/components/cupboard/cupboard.component.ts | 69 ++++++++++------------ .../components/need-list/need-list.component.ts | 2 +- 3 files changed, 34 insertions(+), 41 deletions(-) (limited to 'ufund-ui/src/app') diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.html b/ufund-ui/src/app/components/cupboard/cupboard.component.html index 8f6901a..2d3fa7c 100644 --- a/ufund-ui/src/app/components/cupboard/cupboard.component.html +++ b/ufund-ui/src/app/components/cupboard/cupboard.component.html @@ -9,8 +9,8 @@
- - + +
diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.ts b/ufund-ui/src/app/components/cupboard/cupboard.component.ts index f571566..42d920c 100644 --- a/ufund-ui/src/app/components/cupboard/cupboard.component.ts +++ b/ufund-ui/src/app/components/cupboard/cupboard.component.ts @@ -1,4 +1,4 @@ -import {Component, OnInit, ViewChild} from '@angular/core'; +import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; import {CupboardService} from '../../services/cupboard.service'; import {Need} from '../../models/Need'; import {catchError, of} from 'rxjs'; @@ -18,16 +18,16 @@ import {ModalService} from '../../services/modal.service'; }) export class CupboardComponent implements OnInit { - // selectedForm?: string = undefined; - // needs: any; + @ViewChild("needList") needList?: NeedListComponent + @ViewChild("searchForm") searchForm!: ElementRef private searchDelay: any; needs: Need[] = []; searchResults: Need[] = []; - sortMode: 'Ascending' | 'Descending' = 'Ascending' + sortMode = localStorage.getItem('sortMode') as 'Ascending' | 'Descending' ?? 'Ascending'; itemsPerPage = parseInt(localStorage.getItem('itemsPerPage') ?? '5') ?? 5; - currentSortAlgo = 'sortByPriority'; + currentSortAlgo = localStorage.getItem('sortAlgo') ?? 'sortByPriority'; constructor( private cupboardService: CupboardService, @@ -39,52 +39,30 @@ export class CupboardComponent implements OnInit { ) {} ngOnInit(): void { - this.cupboardService.getNeeds().subscribe(n => { - this.needs = n; - // this.refresh() - this.search(null) - }); - this.authService.getCurrentUserSubject().subscribe( - () => this.usersService.refreshBasket()) + this.refresh() } refresh() { this.cupboardService.getNeeds().subscribe(n => { - if (this.sortMode == 'Ascending') { - this.needs = n.sort(SortingAlgoArrays[this.currentSortAlgo].func); - } else { - this.needs = n.sort(SortingAlgoArrays[this.currentSortAlgo].func).reverse(); - } - this.searchResults = this.needs; - // this.updateVisibleNeeds(); + this.needs = n; + this.searchResults = this.sortNeeds(this.needs); }); - - const form = document.getElementById('search-form') as HTMLFormElement; - form.reset(); - this.search(null); + this.searchForm.nativeElement.form?.reset() } - async search(form: any) { - console.log(this.currentSortAlgo) + async search(search: any) { //wait .25 seconds before searching but cancel if another search is made during the wait to prevent too many api calls //remove previous search if it exists if (this.searchDelay) { clearTimeout(this.searchDelay); } - if (form) { + if (search) { this.searchDelay = setTimeout(() => { - - if (form) { - - const currentSearchValue = form.search; //latest value of the search - this.cupboardService.searchNeeds(currentSearchValue).subscribe((n) => { - if (this.sortMode == 'Ascending') { - this.searchResults = n.sort(SortingAlgoArrays[this.currentSortAlgo].func); - } else { - this.searchResults = n.sort(SortingAlgoArrays[this.currentSortAlgo].func).reverse(); - } - // this.updateVisibleNeeds(); + if (search) { + console.log("IF BLOCK") + this.cupboardService.searchNeeds(search).subscribe((n) => { + this.searchResults = this.sortNeeds(n); }); } }, 250); @@ -92,10 +70,25 @@ export class CupboardComponent implements OnInit { //user has cleared the search bar, we can skip the timeout for a 1/4 second faster response //clear timeout to stop pending search clearTimeout(this.searchDelay); - this.searchResults = this.needs; + this.searchResults = this.sortNeeds(this.needs); + } + } + + sortNeeds(needs: Need[]) { + this.saveSortOptions() + needs = [...needs] // deep copy + if (this.sortMode == 'Ascending') { + return needs.sort(SortingAlgoArrays[this.currentSortAlgo].func); + } else { + return needs.sort(SortingAlgoArrays[this.currentSortAlgo].func).reverse(); } } + saveSortOptions() { + localStorage.setItem('sortMode', this.sortMode); + localStorage.setItem('sortAlgo', this.currentSortAlgo); + } + toggleSortMode(form : any) { if (this.sortMode == 'Ascending'){ this.sortMode = 'Descending' diff --git a/ufund-ui/src/app/components/need-list/need-list.component.ts b/ufund-ui/src/app/components/need-list/need-list.component.ts index 2fbf9d2..b0a012f 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.ts +++ b/ufund-ui/src/app/components/need-list/need-list.component.ts @@ -19,8 +19,8 @@ export class NeedListComponent implements OnChanges { totalPages: number = 0; ngOnChanges() { - this.updateVisibleNeeds() this.currentPage = parseInt(localStorage.getItem('currentPage'+this.uid) ?? '0') ?? 0; + this.updateVisibleNeeds() } getPrefix(need: Need) { -- cgit v1.2.3