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 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 @@
- 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); + } + + + + } diff --git a/ufund-ui/src/index.html b/ufund-ui/src/index.html index b6ae1a2..34b631c 100644 --- a/ufund-ui/src/index.html +++ b/ufund-ui/src/index.html @@ -1,5 +1,5 @@ - + UfundUi diff --git a/ufund-ui/src/styles.css b/ufund-ui/src/styles.css index 75d6b36..a1902fd 100644 --- a/ufund-ui/src/styles.css +++ b/ufund-ui/src/styles.css @@ -1,17 +1,38 @@ /* You can add global styles to this file, and also import other style files */ :root { - color-scheme: /*light*/ dark; + color-scheme: dark; } * { box-sizing: border-box; + color: var(--foreground-color); + transition: all ease-in-out .3s; +} + +[theme="light"] { + --background-color: #e6e4df; + --foreground-color: #000000; + --highlight-color: #cf9451; + --hover-color: #d8cdc0; + --opacity-cr: 1; + --opacity-jf: 0; +} + +[theme="dark"] { + --background-color: #000715; + --foreground-color: #ffffff; + --highlight-color: #6091e8; + --hover-color: #394559; + --opacity-cr: 0; + --opacity-jf: 1; } html, body { margin: 0; height: 100%; - background-color: light-dark(white, #000715); + background-color: var(--background-color); + color: var(--foreground-color); } body { @@ -25,37 +46,39 @@ input { border-radius: 5px; border-style: solid; border-width: 1px; - background-color: light-dark(#ebebeb, #3a3a3a); + background-color: var(--background-color); &:hover { - background-color: light-dark(#e1e1e1, #444444); + background-color: var(--hover-color); } } button, input[type=button], input[type=reset], input[type=submit], .button { - font-size: 14pt; + font-size: 12pt; padding: 6px 16px; border-radius: 9999px; border-style: none; - background-color: light-dark(#ebebeb, #3a3a3a); + font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + background-color: var(--background-color); display: flex; gap: 5px; text-align: center; justify-content: center; &:hover { - background-color: light-dark(#e1e1e1, #444444); + background-color: var(--hover-color); } } .button2 { - text-transform: uppercase; - border: 1px solid #5cdbff; + /* text-transform: uppercase; */ + border: 3px solid var(--highlight-color); padding: 10px 25px; + font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 12pt; - font-weight: 600; + font-weight: 700; background-color: transparent; - text-shadow: #5cdbff 0 0 50px; + text-shadow: var(--highlight-color) 0 0 50px; } .icon { -- 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 --- ufund-api/data/userAuths.json | 2 +- ufund-ui/public/login-cr.png | Bin 0 -> 1750592 bytes ufund-ui/public/login-jf.png | Bin 0 -> 1978783 bytes .../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 +- ufund-ui/src/styles.css | 10 +++- 9 files changed, 78 insertions(+), 23 deletions(-) create mode 100644 ufund-ui/public/login-cr.png create mode 100644 ufund-ui/public/login-jf.png diff --git a/ufund-api/data/userAuths.json b/ufund-api/data/userAuths.json index f86b1a4..2fccd4c 100644 --- a/ufund-api/data/userAuths.json +++ b/ufund-api/data/userAuths.json @@ -1 +1 @@ -[{"key":"3fdd4e7e-bc59-4e3a-ba5c-177d0833022a","username":"sowgro","expiration":"2025-04-14T18:35:26.42935739"},{"key":"5d0182e2-247e-4b4e-b165-cd95710c2402","username":"phil","expiration":"2025-04-17T08:17:09.1886771"},{"key":"13d12a6d-6825-4c1d-8b22-ba960de140b8","username":"phil","expiration":"2025-04-14T17:20:58.531711142"},{"key":"960ef9a5-021d-49a1-a752-ad9dfd8a40f3","username":"phil","expiration":"2025-04-17T10:53:51.2661748"},{"key":"20529784-361d-4111-8b2e-13a23b24d6cc","username":"phil","expiration":"2025-04-17T09:07:11.4534752"},{"key":"342977bc-2095-4325-96d8-ea4cdaa241c6","username":"phil","expiration":"2025-04-17T08:47:07.5445119"},{"key":"e2c17a24-ad11-4e63-8b01-74baf3ae6b4a","username":"phil","expiration":"2025-04-17T10:14:03.2239052"},{"key":"f9f6bc24-7a69-4bfe-92c3-c1166d20f0db","username":"phil","expiration":"2025-04-17T10:50:51.9716943"},{"key":"1dc114a0-f5d7-410e-8664-2ca9af3393ac","username":"phil","expiration":"2025-04-17T09:06:49.5204299"},{"key":"ff1e80a8-344f-4578-9ead-a6d46c8ed1c2","username":"phil","expiration":"2025-04-17T10:51:00.0607854"},{"key":"eeea7b02-7265-4a26-96de-a8ad1860c533","username":"phil","expiration":"2025-03-31T23:04:47.455490668"},{"key":"e121c7c6-e534-4fde-8a78-4f175e9db9c8","username":"phil","expiration":"2025-04-14T17:23:23.218442063"},{"key":"4df8bb43-f597-49ca-863a-6e0da5280d79","username":"phil","expiration":"2025-04-14T01:13:53.799331844"},{"key":"05e8790e-67fa-45de-adfe-82c6f5fdd15b","username":"phil","expiration":"2025-04-17T08:18:05.2696558"},{"key":"4eafe9d9-1b05-4fbd-90f1-c7f856d338dd","username":"phil","expiration":"2025-04-17T09:46:48.0123639"},{"key":"1a9b7e5a-d19c-43ef-bb02-838b6fc695e0","username":"phil","expiration":"2025-04-17T09:37:48.4955941"},{"key":"718be1e2-cfc7-44a6-b3c6-965684d1d0a9","username":"adf","expiration":"2025-04-14T18:35:58.888847176"},{"key":"85319427-4603-4a16-af33-2e9525dda8c0","username":"phil","expiration":"2025-04-14T00:39:34.952183453"},{"key":"f14f187c-355f-444a-88bf-42202f82f947","username":"phil","expiration":"2025-04-17T09:07:05.5541299"},{"key":"004f9f22-2b7e-4448-9c37-7437de47f1e0","username":"phil","expiration":"2025-04-17T08:27:28.3862592"},{"key":"24e8cf17-ad76-45b1-bfb6-79a790035231","username":"admin","expiration":"2025-04-17T08:17:27.7488131"},{"key":"f1d6a110-4232-4ef3-b6ec-9a2962664158","username":"phil","expiration":"2025-04-14T17:23:40.834526839"},{"key":"e48872fa-b89f-494a-b681-11a809d32ff4","username":"phil","expiration":"2025-04-14T17:20:23.265745224"},{"key":"31fcbc15-9902-41d2-8d6f-5b0e40ebddd2","username":"phil","expiration":"2025-04-14T16:45:41.082560826"},{"key":"98c11c42-4e7c-4601-b591-a4af1a5163f9","username":"phil","expiration":"2025-04-17T08:54:04.5078852"},{"key":"27583604-609f-4dac-bb88-01c6035c4142","username":"phil","expiration":"2025-04-17T11:15:56.8479454"},{"key":"967de418-4f86-44ac-b364-eb3a1653aa7d","username":"phil","expiration":"2025-04-17T10:54:19.237888"},{"key":"f20b64c5-a7ed-48c0-a813-6d9802cf9109","username":"phil","expiration":"2025-04-17T08:41:02.6531587"},{"key":"10ea39c2-3869-47da-8630-87b21a88681d","username":"phil","expiration":"2025-04-17T08:45:33.1781528"},{"key":"92d0d6cb-ceb0-4f84-bab3-d959dfb5df9d","username":"phil","expiration":"2025-04-17T08:30:04.2567034"},{"key":"7a7d2e8b-4242-4c18-b7dd-d0565ab5c725","username":"phil","expiration":"2025-04-17T10:10:44.3380846"},{"key":"e14f8ee5-5780-4b9b-bf34-7a41c2bbfcb4","username":"phil","expiration":"2025-04-05T13:46:10.90733016"},{"key":"e1905fc6-ca86-43d7-b1e7-60d458c75a04","username":"phil","expiration":"2025-04-17T09:12:05.990995"},{"key":"a1417644-2b43-4a18-bf5a-26bf3b7ac1fc","username":"phil","expiration":"2025-04-17T10:23:26.122743"},{"key":"7e312d55-bf3e-4dc3-b44a-74d8be591287","username":"phil","expiration":"2025-04-17T10:56:38.9103348"},{"key":"af38add5-b100-4b96-9ffb-5afaccd59979","username":"adf","expiration":"2025-04-14T18:18:47.670506361"},{"key":"4ae3922b-7d5d-45c2-83eb-f8c77e3ce218","username":"phil","expiration":"2025-04-17T08:18:53.5158112"},{"key":"0eb494c8-2fa4-4ef4-915d-4b9fcb3c75ef","username":"phil","expiration":"2025-04-17T08:24:20.412242"},{"key":"0d81e2b4-d9f2-4bc0-b93f-084c086e3707","username":"phil","expiration":"2025-04-17T08:52:41.0723771"},{"key":"04900729-cdcf-4758-9c6e-4f70f03ddb86","username":"phil","expiration":"2025-04-17T11:15:05.0632779"},{"key":"0c8da4b1-bca8-42df-a5b6-65023eadab05","username":"phil","expiration":"2025-04-17T08:15:37.7698648"},{"key":"a3703b55-c7fd-4c5a-9b6a-160c1906aa1a","username":"phil","expiration":"2025-04-17T11:35:39.9101516"},{"key":"ba426671-db67-4d2f-a701-3aa0f284f497","username":"phil","expiration":"2025-04-17T08:54:43.230802"},{"key":"639ea3fa-854a-4052-b1cf-80ea1d3d5917","username":"phil","expiration":"2025-04-17T09:38:47.9716959"},{"key":"a1825159-2e62-48a3-beba-74a3daaca5b5","username":"phil","expiration":"2025-04-17T08:12:28.2166599"},{"key":"799ed420-e843-4777-8c1a-c6d061cca773","username":"phil","expiration":"2025-04-17T08:39:38.8493536"},{"key":"cdd4df80-8139-4479-86ec-953190796d7b","username":"phil","expiration":"2025-04-17T10:02:07.6745458"},{"key":"3d3fb646-9954-496b-98bf-73136c7792ea","username":"phil","expiration":"2025-04-17T10:04:11.7737565"},{"key":"da61796e-402a-4a80-88ae-7607a37989a4","username":"phil","expiration":"2025-04-14T17:07:10.618039573"},{"key":"3beac724-e9f9-4969-9634-60826ad9db43","username":"phil","expiration":"2025-04-17T11:20:36.8424562"},{"key":"0d6e6910-b5dc-45ae-ba8e-c28604939f83","username":"phil","expiration":"2025-04-17T11:19:21.9682553"},{"key":"b7b403a0-d81f-4f7d-bd28-ccf3e2ac706b","username":"phil","expiration":"2025-04-17T10:28:53.9964744"},{"key":"125a4847-3a1c-4834-961f-7f96e997f92e","username":"sowgro","expiration":"2025-04-14T18:35:38.922687686"},{"key":"ce4accc3-0fa8-40fc-a480-1290d12caaed","username":"phil","expiration":"2025-04-17T09:12:58.9504986"},{"key":"adc5ce2f-5a40-4ee5-b9a6-6154860e6861","username":"phil","expiration":"2025-04-17T08:28:48.4584821"},{"key":"50019b5d-25ad-40fe-bd21-19d4dbe57a92","username":"phil","expiration":"2025-04-29T20:23:12.415416825"},{"key":"2aeaab28-99c9-4b45-bdef-82096c70945e","username":"phil","expiration":"2025-04-14T17:19:48.552121268"},{"key":"7805de89-9b38-46dc-8f59-09c06ef9d2dd","username":"phil","expiration":"2025-04-17T08:52:44.6283659"},{"key":"ad6d92d4-c496-407c-823a-edaa386e67ed","username":"phil","expiration":"2025-04-14T17:07:36.032623002"},{"key":"fbdf7ac2-cf01-4dad-baec-ed9310a4eba7","username":"phil","expiration":"2025-04-17T08:38:12.8162926"},{"key":"7907ccb2-bf01-4962-a280-ebb6aa9c5b20","username":"phil","expiration":"2025-04-17T09:45:01.6777324"},{"key":"904f6de1-10ab-465d-abd8-be0612311251","username":"phil","expiration":"2025-04-29T20:24:45.666998397"},{"key":"a69796dd-734c-4545-ac91-e5fe0387d0ad","username":"phil","expiration":"2025-04-17T08:29:32.671782"},{"key":"9f3e380d-fead-4d40-a1c0-278e857dd674","username":"phil","expiration":"2025-04-17T08:52:29.4148814"},{"key":"efc531fb-ab24-4d5a-a2f5-7f4ede74819f","username":"phil","expiration":"2025-04-13T19:41:51.017327545"},{"key":"88b539a9-3986-41b4-a6ed-a79672042ccf","username":"phil","expiration":"2025-04-17T08:23:45.5712888"},{"key":"68bc53af-e21a-4364-adf5-8f163f642235","username":"phil","expiration":"2025-04-17T08:24:43.3201656"},{"key":"a07ae51f-f80b-4001-95f1-48c11d4917a4","username":"phil","expiration":"2025-04-05T15:04:30.900359001"},{"key":"cc49c007-fd36-4828-b8fa-f5b85ad0676d","username":"phil","expiration":"2025-04-14T16:46:12.80566798"},{"key":"fb2d7dd5-783e-47d8-9a43-8b7693c5f070","username":"phil","expiration":"2025-04-17T11:13:05.9489267"},{"key":"49a0ad40-3223-4f62-94e8-0f9e96241a85","username":"phil","expiration":"2025-04-17T09:13:39.9633546"},{"key":"db53acf2-61d1-45ea-9d01-5c710b80bdaf","username":"phil","expiration":"2025-04-17T08:53:47.487545"},{"key":"d7cef571-0f76-49fe-941f-ecbeae69557a","username":"phil","expiration":"2025-04-05T15:14:00.363201102"},{"key":"25d6a49b-c185-460c-adbe-a874419d20aa","username":"phil","expiration":"2025-04-29T20:22:19.629805123"},{"key":"3fc557b6-0306-4779-9b74-b7292a5cf1cc","username":"phil","expiration":"2025-04-14T16:06:08.564069822"},{"key":"77392d17-6e0c-45ec-857d-6595a55ddd97","username":"phil","expiration":"2025-04-14T16:06:48.335542315"},{"key":"58e4e2a2-3a36-4fd6-8bb1-ad0831664d01","username":"phil","expiration":"2025-04-12T23:17:42.638952959"},{"key":"6083ae1d-a761-4ed3-8c48-a429afa2c521","username":"phil","expiration":"2025-04-17T08:32:25.3500545"},{"key":"1c438301-e8f5-4c12-a40b-e20b8a282814","username":"keshey","expiration":"2025-04-17T10:26:04.7690496"},{"key":"fe2146e2-7982-4226-b215-96879939f485","username":"phil","expiration":"2025-04-17T08:34:59.3412483"},{"key":"6d2ea170-50aa-4c48-9247-9310a29ae753","username":"phil","expiration":"2025-04-17T11:29:10.0637357"},{"key":"f5f53053-ef5e-4850-93a0-3dc20646f78b","username":"sowgro","expiration":"2025-04-14T18:11:29.438554549"},{"key":"03424ad1-376c-47aa-8553-7f2ea8099d45","username":"phil","expiration":"2025-04-17T08:05:35.7264696"},{"key":"568e4738-70b5-4be7-bfa6-1367cd22ce3f","username":"admin","expiration":"2025-04-17T08:16:59.0542222"},{"key":"7a634e0a-628b-4b31-8950-dc33d4ee5d95","username":"phil","expiration":"2025-04-17T08:15:47.1663258"},{"key":"9c6a36b8-7f71-4b09-b26b-682f1f0be4cb","username":"phil","expiration":"2025-04-17T09:12:15.5425885"},{"key":"f6951471-2578-4a6a-b3e5-b7e97ed9207a","username":"phil","expiration":"2025-04-17T10:23:45.9450825"},{"key":"cb658550-aafc-4a45-89be-f7899e44d7ba","username":"phil","expiration":"2025-04-17T10:50:40.0249774"}] \ No newline at end of file +[{"key":"3fdd4e7e-bc59-4e3a-ba5c-177d0833022a","username":"sowgro","expiration":"2025-04-14T18:35:26.42935739"},{"key":"5d0182e2-247e-4b4e-b165-cd95710c2402","username":"phil","expiration":"2025-04-17T08:17:09.1886771"},{"key":"13d12a6d-6825-4c1d-8b22-ba960de140b8","username":"phil","expiration":"2025-04-14T17:20:58.531711142"},{"key":"960ef9a5-021d-49a1-a752-ad9dfd8a40f3","username":"phil","expiration":"2025-04-17T10:53:51.2661748"},{"key":"20529784-361d-4111-8b2e-13a23b24d6cc","username":"phil","expiration":"2025-04-17T09:07:11.4534752"},{"key":"342977bc-2095-4325-96d8-ea4cdaa241c6","username":"phil","expiration":"2025-04-17T08:47:07.5445119"},{"key":"e2c17a24-ad11-4e63-8b01-74baf3ae6b4a","username":"phil","expiration":"2025-04-17T10:14:03.2239052"},{"key":"f9f6bc24-7a69-4bfe-92c3-c1166d20f0db","username":"phil","expiration":"2025-04-17T10:50:51.9716943"},{"key":"1dc114a0-f5d7-410e-8664-2ca9af3393ac","username":"phil","expiration":"2025-04-17T09:06:49.5204299"},{"key":"ff1e80a8-344f-4578-9ead-a6d46c8ed1c2","username":"phil","expiration":"2025-04-17T10:51:00.0607854"},{"key":"e121c7c6-e534-4fde-8a78-4f175e9db9c8","username":"phil","expiration":"2025-04-14T17:23:23.218442063"},{"key":"b03ebcd3-da6e-4ddf-bea9-1cf8de06325f","username":"phil","expiration":"2025-05-04T14:10:20.2248131"},{"key":"4df8bb43-f597-49ca-863a-6e0da5280d79","username":"phil","expiration":"2025-04-14T01:13:53.799331844"},{"key":"05e8790e-67fa-45de-adfe-82c6f5fdd15b","username":"phil","expiration":"2025-04-17T08:18:05.2696558"},{"key":"4eafe9d9-1b05-4fbd-90f1-c7f856d338dd","username":"phil","expiration":"2025-04-17T09:46:48.0123639"},{"key":"1a9b7e5a-d19c-43ef-bb02-838b6fc695e0","username":"phil","expiration":"2025-04-17T09:37:48.4955941"},{"key":"718be1e2-cfc7-44a6-b3c6-965684d1d0a9","username":"adf","expiration":"2025-04-14T18:35:58.888847176"},{"key":"66a5f97b-c86a-4554-a74b-8c37e54becb2","username":"phil","expiration":"2025-05-04T14:12:15.1825709"},{"key":"85319427-4603-4a16-af33-2e9525dda8c0","username":"phil","expiration":"2025-04-14T00:39:34.952183453"},{"key":"f14f187c-355f-444a-88bf-42202f82f947","username":"phil","expiration":"2025-04-17T09:07:05.5541299"},{"key":"004f9f22-2b7e-4448-9c37-7437de47f1e0","username":"phil","expiration":"2025-04-17T08:27:28.3862592"},{"key":"24e8cf17-ad76-45b1-bfb6-79a790035231","username":"admin","expiration":"2025-04-17T08:17:27.7488131"},{"key":"f1d6a110-4232-4ef3-b6ec-9a2962664158","username":"phil","expiration":"2025-04-14T17:23:40.834526839"},{"key":"e48872fa-b89f-494a-b681-11a809d32ff4","username":"phil","expiration":"2025-04-14T17:20:23.265745224"},{"key":"31fcbc15-9902-41d2-8d6f-5b0e40ebddd2","username":"phil","expiration":"2025-04-14T16:45:41.082560826"},{"key":"98c11c42-4e7c-4601-b591-a4af1a5163f9","username":"phil","expiration":"2025-04-17T08:54:04.5078852"},{"key":"27583604-609f-4dac-bb88-01c6035c4142","username":"phil","expiration":"2025-04-17T11:15:56.8479454"},{"key":"967de418-4f86-44ac-b364-eb3a1653aa7d","username":"phil","expiration":"2025-04-17T10:54:19.237888"},{"key":"f20b64c5-a7ed-48c0-a813-6d9802cf9109","username":"phil","expiration":"2025-04-17T08:41:02.6531587"},{"key":"10ea39c2-3869-47da-8630-87b21a88681d","username":"phil","expiration":"2025-04-17T08:45:33.1781528"},{"key":"92d0d6cb-ceb0-4f84-bab3-d959dfb5df9d","username":"phil","expiration":"2025-04-17T08:30:04.2567034"},{"key":"7a7d2e8b-4242-4c18-b7dd-d0565ab5c725","username":"phil","expiration":"2025-04-17T10:10:44.3380846"},{"key":"e14f8ee5-5780-4b9b-bf34-7a41c2bbfcb4","username":"phil","expiration":"2025-04-05T13:46:10.90733016"},{"key":"e1905fc6-ca86-43d7-b1e7-60d458c75a04","username":"phil","expiration":"2025-04-17T09:12:05.990995"},{"key":"a1417644-2b43-4a18-bf5a-26bf3b7ac1fc","username":"phil","expiration":"2025-04-17T10:23:26.122743"},{"key":"7e312d55-bf3e-4dc3-b44a-74d8be591287","username":"phil","expiration":"2025-04-17T10:56:38.9103348"},{"key":"af38add5-b100-4b96-9ffb-5afaccd59979","username":"adf","expiration":"2025-04-14T18:18:47.670506361"},{"key":"4ae3922b-7d5d-45c2-83eb-f8c77e3ce218","username":"phil","expiration":"2025-04-17T08:18:53.5158112"},{"key":"0eb494c8-2fa4-4ef4-915d-4b9fcb3c75ef","username":"phil","expiration":"2025-04-17T08:24:20.412242"},{"key":"0d81e2b4-d9f2-4bc0-b93f-084c086e3707","username":"phil","expiration":"2025-04-17T08:52:41.0723771"},{"key":"04900729-cdcf-4758-9c6e-4f70f03ddb86","username":"phil","expiration":"2025-04-17T11:15:05.0632779"},{"key":"0c8da4b1-bca8-42df-a5b6-65023eadab05","username":"phil","expiration":"2025-04-17T08:15:37.7698648"},{"key":"a3703b55-c7fd-4c5a-9b6a-160c1906aa1a","username":"phil","expiration":"2025-04-17T11:35:39.9101516"},{"key":"ba426671-db67-4d2f-a701-3aa0f284f497","username":"phil","expiration":"2025-04-17T08:54:43.230802"},{"key":"639ea3fa-854a-4052-b1cf-80ea1d3d5917","username":"phil","expiration":"2025-04-17T09:38:47.9716959"},{"key":"a1825159-2e62-48a3-beba-74a3daaca5b5","username":"phil","expiration":"2025-04-17T08:12:28.2166599"},{"key":"799ed420-e843-4777-8c1a-c6d061cca773","username":"phil","expiration":"2025-04-17T08:39:38.8493536"},{"key":"cdd4df80-8139-4479-86ec-953190796d7b","username":"phil","expiration":"2025-04-17T10:02:07.6745458"},{"key":"3d3fb646-9954-496b-98bf-73136c7792ea","username":"phil","expiration":"2025-04-17T10:04:11.7737565"},{"key":"da61796e-402a-4a80-88ae-7607a37989a4","username":"phil","expiration":"2025-04-14T17:07:10.618039573"},{"key":"3beac724-e9f9-4969-9634-60826ad9db43","username":"phil","expiration":"2025-04-17T11:20:36.8424562"},{"key":"0d6e6910-b5dc-45ae-ba8e-c28604939f83","username":"phil","expiration":"2025-04-17T11:19:21.9682553"},{"key":"b7b403a0-d81f-4f7d-bd28-ccf3e2ac706b","username":"phil","expiration":"2025-04-17T10:28:53.9964744"},{"key":"125a4847-3a1c-4834-961f-7f96e997f92e","username":"sowgro","expiration":"2025-04-14T18:35:38.922687686"},{"key":"ce4accc3-0fa8-40fc-a480-1290d12caaed","username":"phil","expiration":"2025-04-17T09:12:58.9504986"},{"key":"adc5ce2f-5a40-4ee5-b9a6-6154860e6861","username":"phil","expiration":"2025-04-17T08:28:48.4584821"},{"key":"50019b5d-25ad-40fe-bd21-19d4dbe57a92","username":"phil","expiration":"2025-04-29T20:23:12.415416825"},{"key":"2aeaab28-99c9-4b45-bdef-82096c70945e","username":"phil","expiration":"2025-04-14T17:19:48.552121268"},{"key":"7805de89-9b38-46dc-8f59-09c06ef9d2dd","username":"phil","expiration":"2025-04-17T08:52:44.6283659"},{"key":"14093348-a7ea-4a33-918f-fdb97162ab75","username":"phil","expiration":"2025-05-04T20:48:04.9471896"},{"key":"ad6d92d4-c496-407c-823a-edaa386e67ed","username":"phil","expiration":"2025-04-14T17:07:36.032623002"},{"key":"fbdf7ac2-cf01-4dad-baec-ed9310a4eba7","username":"phil","expiration":"2025-04-17T08:38:12.8162926"},{"key":"7907ccb2-bf01-4962-a280-ebb6aa9c5b20","username":"phil","expiration":"2025-04-17T09:45:01.6777324"},{"key":"904f6de1-10ab-465d-abd8-be0612311251","username":"phil","expiration":"2025-04-29T20:24:45.666998397"},{"key":"a69796dd-734c-4545-ac91-e5fe0387d0ad","username":"phil","expiration":"2025-04-17T08:29:32.671782"},{"key":"9f3e380d-fead-4d40-a1c0-278e857dd674","username":"phil","expiration":"2025-04-17T08:52:29.4148814"},{"key":"efc531fb-ab24-4d5a-a2f5-7f4ede74819f","username":"phil","expiration":"2025-04-13T19:41:51.017327545"},{"key":"88b539a9-3986-41b4-a6ed-a79672042ccf","username":"phil","expiration":"2025-04-17T08:23:45.5712888"},{"key":"68bc53af-e21a-4364-adf5-8f163f642235","username":"phil","expiration":"2025-04-17T08:24:43.3201656"},{"key":"a07ae51f-f80b-4001-95f1-48c11d4917a4","username":"phil","expiration":"2025-04-05T15:04:30.900359001"},{"key":"cc49c007-fd36-4828-b8fa-f5b85ad0676d","username":"phil","expiration":"2025-04-14T16:46:12.80566798"},{"key":"fb2d7dd5-783e-47d8-9a43-8b7693c5f070","username":"phil","expiration":"2025-04-17T11:13:05.9489267"},{"key":"49a0ad40-3223-4f62-94e8-0f9e96241a85","username":"phil","expiration":"2025-04-17T09:13:39.9633546"},{"key":"db53acf2-61d1-45ea-9d01-5c710b80bdaf","username":"phil","expiration":"2025-04-17T08:53:47.487545"},{"key":"d7cef571-0f76-49fe-941f-ecbeae69557a","username":"phil","expiration":"2025-04-05T15:14:00.363201102"},{"key":"25d6a49b-c185-460c-adbe-a874419d20aa","username":"phil","expiration":"2025-04-29T20:22:19.629805123"},{"key":"3fc557b6-0306-4779-9b74-b7292a5cf1cc","username":"phil","expiration":"2025-04-14T16:06:08.564069822"},{"key":"77392d17-6e0c-45ec-857d-6595a55ddd97","username":"phil","expiration":"2025-04-14T16:06:48.335542315"},{"key":"58e4e2a2-3a36-4fd6-8bb1-ad0831664d01","username":"phil","expiration":"2025-04-12T23:17:42.638952959"},{"key":"6083ae1d-a761-4ed3-8c48-a429afa2c521","username":"phil","expiration":"2025-04-17T08:32:25.3500545"},{"key":"1c438301-e8f5-4c12-a40b-e20b8a282814","username":"keshey","expiration":"2025-04-17T10:26:04.7690496"},{"key":"fe2146e2-7982-4226-b215-96879939f485","username":"phil","expiration":"2025-04-17T08:34:59.3412483"},{"key":"6d2ea170-50aa-4c48-9247-9310a29ae753","username":"phil","expiration":"2025-04-17T11:29:10.0637357"},{"key":"ae2af91b-f3c7-4701-822c-d174200044f6","username":"phil","expiration":"2025-05-04T19:14:49.7138545"},{"key":"f5f53053-ef5e-4850-93a0-3dc20646f78b","username":"sowgro","expiration":"2025-04-14T18:11:29.438554549"},{"key":"03424ad1-376c-47aa-8553-7f2ea8099d45","username":"phil","expiration":"2025-04-17T08:05:35.7264696"},{"key":"568e4738-70b5-4be7-bfa6-1367cd22ce3f","username":"admin","expiration":"2025-04-17T08:16:59.0542222"},{"key":"440bf2cc-558f-4dad-93dd-8f28c455e1a4","username":"phil","expiration":"2025-05-04T14:49:32.2300318"},{"key":"7a634e0a-628b-4b31-8950-dc33d4ee5d95","username":"phil","expiration":"2025-04-17T08:15:47.1663258"},{"key":"9c6a36b8-7f71-4b09-b26b-682f1f0be4cb","username":"phil","expiration":"2025-04-17T09:12:15.5425885"},{"key":"f6951471-2578-4a6a-b3e5-b7e97ed9207a","username":"phil","expiration":"2025-04-17T10:23:45.9450825"},{"key":"cb658550-aafc-4a45-89be-f7899e44d7ba","username":"phil","expiration":"2025-04-17T10:50:40.0249774"}] \ No newline at end of file diff --git a/ufund-ui/public/login-cr.png b/ufund-ui/public/login-cr.png new file mode 100644 index 0000000..6419821 Binary files /dev/null and b/ufund-ui/public/login-cr.png differ diff --git a/ufund-ui/public/login-jf.png b/ufund-ui/public/login-jf.png new file mode 100644 index 0000000..ef0e111 Binary files /dev/null and b/ufund-ui/public/login-jf.png differ 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 { diff --git a/ufund-ui/src/styles.css b/ufund-ui/src/styles.css index a1902fd..9fce47d 100644 --- a/ufund-ui/src/styles.css +++ b/ufund-ui/src/styles.css @@ -1,8 +1,8 @@ /* You can add global styles to this file, and also import other style files */ -:root { +/* :root { color-scheme: dark; -} +} */ * { box-sizing: border-box; @@ -12,8 +12,11 @@ [theme="light"] { --background-color: #e6e4df; + --secondary-color: #e0dcd4; + --tertiary-color: #cac6be; --foreground-color: #000000; --highlight-color: #cf9451; + --dark-highlight-clor: #582f00; --hover-color: #d8cdc0; --opacity-cr: 1; --opacity-jf: 0; @@ -21,8 +24,11 @@ [theme="dark"] { --background-color: #000715; + --secondary-color: #444444; + --tertiary-color: #3a3a3a; --foreground-color: #ffffff; --highlight-color: #6091e8; + --dark-highlight-clor: #002846; --hover-color: #394559; --opacity-cr: 0; --opacity-jf: 1; -- 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-api/data/userAuths.json | 2 +- 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 +- ufund-ui/src/styles.css | 10 +++++++++- 7 files changed, 31 insertions(+), 16 deletions(-) diff --git a/ufund-api/data/userAuths.json b/ufund-api/data/userAuths.json index 2fccd4c..fcaa78d 100644 --- a/ufund-api/data/userAuths.json +++ b/ufund-api/data/userAuths.json @@ -1 +1 @@ -[{"key":"3fdd4e7e-bc59-4e3a-ba5c-177d0833022a","username":"sowgro","expiration":"2025-04-14T18:35:26.42935739"},{"key":"5d0182e2-247e-4b4e-b165-cd95710c2402","username":"phil","expiration":"2025-04-17T08:17:09.1886771"},{"key":"13d12a6d-6825-4c1d-8b22-ba960de140b8","username":"phil","expiration":"2025-04-14T17:20:58.531711142"},{"key":"960ef9a5-021d-49a1-a752-ad9dfd8a40f3","username":"phil","expiration":"2025-04-17T10:53:51.2661748"},{"key":"20529784-361d-4111-8b2e-13a23b24d6cc","username":"phil","expiration":"2025-04-17T09:07:11.4534752"},{"key":"342977bc-2095-4325-96d8-ea4cdaa241c6","username":"phil","expiration":"2025-04-17T08:47:07.5445119"},{"key":"e2c17a24-ad11-4e63-8b01-74baf3ae6b4a","username":"phil","expiration":"2025-04-17T10:14:03.2239052"},{"key":"f9f6bc24-7a69-4bfe-92c3-c1166d20f0db","username":"phil","expiration":"2025-04-17T10:50:51.9716943"},{"key":"1dc114a0-f5d7-410e-8664-2ca9af3393ac","username":"phil","expiration":"2025-04-17T09:06:49.5204299"},{"key":"ff1e80a8-344f-4578-9ead-a6d46c8ed1c2","username":"phil","expiration":"2025-04-17T10:51:00.0607854"},{"key":"e121c7c6-e534-4fde-8a78-4f175e9db9c8","username":"phil","expiration":"2025-04-14T17:23:23.218442063"},{"key":"b03ebcd3-da6e-4ddf-bea9-1cf8de06325f","username":"phil","expiration":"2025-05-04T14:10:20.2248131"},{"key":"4df8bb43-f597-49ca-863a-6e0da5280d79","username":"phil","expiration":"2025-04-14T01:13:53.799331844"},{"key":"05e8790e-67fa-45de-adfe-82c6f5fdd15b","username":"phil","expiration":"2025-04-17T08:18:05.2696558"},{"key":"4eafe9d9-1b05-4fbd-90f1-c7f856d338dd","username":"phil","expiration":"2025-04-17T09:46:48.0123639"},{"key":"1a9b7e5a-d19c-43ef-bb02-838b6fc695e0","username":"phil","expiration":"2025-04-17T09:37:48.4955941"},{"key":"718be1e2-cfc7-44a6-b3c6-965684d1d0a9","username":"adf","expiration":"2025-04-14T18:35:58.888847176"},{"key":"66a5f97b-c86a-4554-a74b-8c37e54becb2","username":"phil","expiration":"2025-05-04T14:12:15.1825709"},{"key":"85319427-4603-4a16-af33-2e9525dda8c0","username":"phil","expiration":"2025-04-14T00:39:34.952183453"},{"key":"f14f187c-355f-444a-88bf-42202f82f947","username":"phil","expiration":"2025-04-17T09:07:05.5541299"},{"key":"004f9f22-2b7e-4448-9c37-7437de47f1e0","username":"phil","expiration":"2025-04-17T08:27:28.3862592"},{"key":"24e8cf17-ad76-45b1-bfb6-79a790035231","username":"admin","expiration":"2025-04-17T08:17:27.7488131"},{"key":"f1d6a110-4232-4ef3-b6ec-9a2962664158","username":"phil","expiration":"2025-04-14T17:23:40.834526839"},{"key":"e48872fa-b89f-494a-b681-11a809d32ff4","username":"phil","expiration":"2025-04-14T17:20:23.265745224"},{"key":"31fcbc15-9902-41d2-8d6f-5b0e40ebddd2","username":"phil","expiration":"2025-04-14T16:45:41.082560826"},{"key":"98c11c42-4e7c-4601-b591-a4af1a5163f9","username":"phil","expiration":"2025-04-17T08:54:04.5078852"},{"key":"27583604-609f-4dac-bb88-01c6035c4142","username":"phil","expiration":"2025-04-17T11:15:56.8479454"},{"key":"967de418-4f86-44ac-b364-eb3a1653aa7d","username":"phil","expiration":"2025-04-17T10:54:19.237888"},{"key":"f20b64c5-a7ed-48c0-a813-6d9802cf9109","username":"phil","expiration":"2025-04-17T08:41:02.6531587"},{"key":"10ea39c2-3869-47da-8630-87b21a88681d","username":"phil","expiration":"2025-04-17T08:45:33.1781528"},{"key":"92d0d6cb-ceb0-4f84-bab3-d959dfb5df9d","username":"phil","expiration":"2025-04-17T08:30:04.2567034"},{"key":"7a7d2e8b-4242-4c18-b7dd-d0565ab5c725","username":"phil","expiration":"2025-04-17T10:10:44.3380846"},{"key":"e14f8ee5-5780-4b9b-bf34-7a41c2bbfcb4","username":"phil","expiration":"2025-04-05T13:46:10.90733016"},{"key":"e1905fc6-ca86-43d7-b1e7-60d458c75a04","username":"phil","expiration":"2025-04-17T09:12:05.990995"},{"key":"a1417644-2b43-4a18-bf5a-26bf3b7ac1fc","username":"phil","expiration":"2025-04-17T10:23:26.122743"},{"key":"7e312d55-bf3e-4dc3-b44a-74d8be591287","username":"phil","expiration":"2025-04-17T10:56:38.9103348"},{"key":"af38add5-b100-4b96-9ffb-5afaccd59979","username":"adf","expiration":"2025-04-14T18:18:47.670506361"},{"key":"4ae3922b-7d5d-45c2-83eb-f8c77e3ce218","username":"phil","expiration":"2025-04-17T08:18:53.5158112"},{"key":"0eb494c8-2fa4-4ef4-915d-4b9fcb3c75ef","username":"phil","expiration":"2025-04-17T08:24:20.412242"},{"key":"0d81e2b4-d9f2-4bc0-b93f-084c086e3707","username":"phil","expiration":"2025-04-17T08:52:41.0723771"},{"key":"04900729-cdcf-4758-9c6e-4f70f03ddb86","username":"phil","expiration":"2025-04-17T11:15:05.0632779"},{"key":"0c8da4b1-bca8-42df-a5b6-65023eadab05","username":"phil","expiration":"2025-04-17T08:15:37.7698648"},{"key":"a3703b55-c7fd-4c5a-9b6a-160c1906aa1a","username":"phil","expiration":"2025-04-17T11:35:39.9101516"},{"key":"ba426671-db67-4d2f-a701-3aa0f284f497","username":"phil","expiration":"2025-04-17T08:54:43.230802"},{"key":"639ea3fa-854a-4052-b1cf-80ea1d3d5917","username":"phil","expiration":"2025-04-17T09:38:47.9716959"},{"key":"a1825159-2e62-48a3-beba-74a3daaca5b5","username":"phil","expiration":"2025-04-17T08:12:28.2166599"},{"key":"799ed420-e843-4777-8c1a-c6d061cca773","username":"phil","expiration":"2025-04-17T08:39:38.8493536"},{"key":"cdd4df80-8139-4479-86ec-953190796d7b","username":"phil","expiration":"2025-04-17T10:02:07.6745458"},{"key":"3d3fb646-9954-496b-98bf-73136c7792ea","username":"phil","expiration":"2025-04-17T10:04:11.7737565"},{"key":"da61796e-402a-4a80-88ae-7607a37989a4","username":"phil","expiration":"2025-04-14T17:07:10.618039573"},{"key":"3beac724-e9f9-4969-9634-60826ad9db43","username":"phil","expiration":"2025-04-17T11:20:36.8424562"},{"key":"0d6e6910-b5dc-45ae-ba8e-c28604939f83","username":"phil","expiration":"2025-04-17T11:19:21.9682553"},{"key":"b7b403a0-d81f-4f7d-bd28-ccf3e2ac706b","username":"phil","expiration":"2025-04-17T10:28:53.9964744"},{"key":"125a4847-3a1c-4834-961f-7f96e997f92e","username":"sowgro","expiration":"2025-04-14T18:35:38.922687686"},{"key":"ce4accc3-0fa8-40fc-a480-1290d12caaed","username":"phil","expiration":"2025-04-17T09:12:58.9504986"},{"key":"adc5ce2f-5a40-4ee5-b9a6-6154860e6861","username":"phil","expiration":"2025-04-17T08:28:48.4584821"},{"key":"50019b5d-25ad-40fe-bd21-19d4dbe57a92","username":"phil","expiration":"2025-04-29T20:23:12.415416825"},{"key":"2aeaab28-99c9-4b45-bdef-82096c70945e","username":"phil","expiration":"2025-04-14T17:19:48.552121268"},{"key":"7805de89-9b38-46dc-8f59-09c06ef9d2dd","username":"phil","expiration":"2025-04-17T08:52:44.6283659"},{"key":"14093348-a7ea-4a33-918f-fdb97162ab75","username":"phil","expiration":"2025-05-04T20:48:04.9471896"},{"key":"ad6d92d4-c496-407c-823a-edaa386e67ed","username":"phil","expiration":"2025-04-14T17:07:36.032623002"},{"key":"fbdf7ac2-cf01-4dad-baec-ed9310a4eba7","username":"phil","expiration":"2025-04-17T08:38:12.8162926"},{"key":"7907ccb2-bf01-4962-a280-ebb6aa9c5b20","username":"phil","expiration":"2025-04-17T09:45:01.6777324"},{"key":"904f6de1-10ab-465d-abd8-be0612311251","username":"phil","expiration":"2025-04-29T20:24:45.666998397"},{"key":"a69796dd-734c-4545-ac91-e5fe0387d0ad","username":"phil","expiration":"2025-04-17T08:29:32.671782"},{"key":"9f3e380d-fead-4d40-a1c0-278e857dd674","username":"phil","expiration":"2025-04-17T08:52:29.4148814"},{"key":"efc531fb-ab24-4d5a-a2f5-7f4ede74819f","username":"phil","expiration":"2025-04-13T19:41:51.017327545"},{"key":"88b539a9-3986-41b4-a6ed-a79672042ccf","username":"phil","expiration":"2025-04-17T08:23:45.5712888"},{"key":"68bc53af-e21a-4364-adf5-8f163f642235","username":"phil","expiration":"2025-04-17T08:24:43.3201656"},{"key":"a07ae51f-f80b-4001-95f1-48c11d4917a4","username":"phil","expiration":"2025-04-05T15:04:30.900359001"},{"key":"cc49c007-fd36-4828-b8fa-f5b85ad0676d","username":"phil","expiration":"2025-04-14T16:46:12.80566798"},{"key":"fb2d7dd5-783e-47d8-9a43-8b7693c5f070","username":"phil","expiration":"2025-04-17T11:13:05.9489267"},{"key":"49a0ad40-3223-4f62-94e8-0f9e96241a85","username":"phil","expiration":"2025-04-17T09:13:39.9633546"},{"key":"db53acf2-61d1-45ea-9d01-5c710b80bdaf","username":"phil","expiration":"2025-04-17T08:53:47.487545"},{"key":"d7cef571-0f76-49fe-941f-ecbeae69557a","username":"phil","expiration":"2025-04-05T15:14:00.363201102"},{"key":"25d6a49b-c185-460c-adbe-a874419d20aa","username":"phil","expiration":"2025-04-29T20:22:19.629805123"},{"key":"3fc557b6-0306-4779-9b74-b7292a5cf1cc","username":"phil","expiration":"2025-04-14T16:06:08.564069822"},{"key":"77392d17-6e0c-45ec-857d-6595a55ddd97","username":"phil","expiration":"2025-04-14T16:06:48.335542315"},{"key":"58e4e2a2-3a36-4fd6-8bb1-ad0831664d01","username":"phil","expiration":"2025-04-12T23:17:42.638952959"},{"key":"6083ae1d-a761-4ed3-8c48-a429afa2c521","username":"phil","expiration":"2025-04-17T08:32:25.3500545"},{"key":"1c438301-e8f5-4c12-a40b-e20b8a282814","username":"keshey","expiration":"2025-04-17T10:26:04.7690496"},{"key":"fe2146e2-7982-4226-b215-96879939f485","username":"phil","expiration":"2025-04-17T08:34:59.3412483"},{"key":"6d2ea170-50aa-4c48-9247-9310a29ae753","username":"phil","expiration":"2025-04-17T11:29:10.0637357"},{"key":"ae2af91b-f3c7-4701-822c-d174200044f6","username":"phil","expiration":"2025-05-04T19:14:49.7138545"},{"key":"f5f53053-ef5e-4850-93a0-3dc20646f78b","username":"sowgro","expiration":"2025-04-14T18:11:29.438554549"},{"key":"03424ad1-376c-47aa-8553-7f2ea8099d45","username":"phil","expiration":"2025-04-17T08:05:35.7264696"},{"key":"568e4738-70b5-4be7-bfa6-1367cd22ce3f","username":"admin","expiration":"2025-04-17T08:16:59.0542222"},{"key":"440bf2cc-558f-4dad-93dd-8f28c455e1a4","username":"phil","expiration":"2025-05-04T14:49:32.2300318"},{"key":"7a634e0a-628b-4b31-8950-dc33d4ee5d95","username":"phil","expiration":"2025-04-17T08:15:47.1663258"},{"key":"9c6a36b8-7f71-4b09-b26b-682f1f0be4cb","username":"phil","expiration":"2025-04-17T09:12:15.5425885"},{"key":"f6951471-2578-4a6a-b3e5-b7e97ed9207a","username":"phil","expiration":"2025-04-17T10:23:45.9450825"},{"key":"cb658550-aafc-4a45-89be-f7899e44d7ba","username":"phil","expiration":"2025-04-17T10:50:40.0249774"}] \ No newline at end of file +[{"key":"3fdd4e7e-bc59-4e3a-ba5c-177d0833022a","username":"sowgro","expiration":"2025-04-14T18:35:26.42935739"},{"key":"960ef9a5-021d-49a1-a752-ad9dfd8a40f3","username":"phil","expiration":"2025-04-17T10:53:51.2661748"},{"key":"20529784-361d-4111-8b2e-13a23b24d6cc","username":"phil","expiration":"2025-04-17T09:07:11.4534752"},{"key":"342977bc-2095-4325-96d8-ea4cdaa241c6","username":"phil","expiration":"2025-04-17T08:47:07.5445119"},{"key":"f9f6bc24-7a69-4bfe-92c3-c1166d20f0db","username":"phil","expiration":"2025-04-17T10:50:51.9716943"},{"key":"b03ebcd3-da6e-4ddf-bea9-1cf8de06325f","username":"phil","expiration":"2025-05-04T14:10:20.2248131"},{"key":"4df8bb43-f597-49ca-863a-6e0da5280d79","username":"phil","expiration":"2025-04-14T01:13:53.799331844"},{"key":"4eafe9d9-1b05-4fbd-90f1-c7f856d338dd","username":"phil","expiration":"2025-04-17T09:46:48.0123639"},{"key":"85319427-4603-4a16-af33-2e9525dda8c0","username":"phil","expiration":"2025-04-14T00:39:34.952183453"},{"key":"db88f290-7a51-45b3-8cf9-416fc48d8e88","username":"admin","expiration":"2025-05-05T21:22:32.5030299"},{"key":"f1d6a110-4232-4ef3-b6ec-9a2962664158","username":"phil","expiration":"2025-04-14T17:23:40.834526839"},{"key":"27583604-609f-4dac-bb88-01c6035c4142","username":"phil","expiration":"2025-04-17T11:15:56.8479454"},{"key":"967de418-4f86-44ac-b364-eb3a1653aa7d","username":"phil","expiration":"2025-04-17T10:54:19.237888"},{"key":"f20b64c5-a7ed-48c0-a813-6d9802cf9109","username":"phil","expiration":"2025-04-17T08:41:02.6531587"},{"key":"92d0d6cb-ceb0-4f84-bab3-d959dfb5df9d","username":"phil","expiration":"2025-04-17T08:30:04.2567034"},{"key":"e1905fc6-ca86-43d7-b1e7-60d458c75a04","username":"phil","expiration":"2025-04-17T09:12:05.990995"},{"key":"a1417644-2b43-4a18-bf5a-26bf3b7ac1fc","username":"phil","expiration":"2025-04-17T10:23:26.122743"},{"key":"6e27d1cd-b23a-49e0-9305-7d16cc418694","username":"phil","expiration":"2025-05-05T21:18:12.5678247"},{"key":"4ae3922b-7d5d-45c2-83eb-f8c77e3ce218","username":"phil","expiration":"2025-04-17T08:18:53.5158112"},{"key":"0eb494c8-2fa4-4ef4-915d-4b9fcb3c75ef","username":"phil","expiration":"2025-04-17T08:24:20.412242"},{"key":"04900729-cdcf-4758-9c6e-4f70f03ddb86","username":"phil","expiration":"2025-04-17T11:15:05.0632779"},{"key":"0c8da4b1-bca8-42df-a5b6-65023eadab05","username":"phil","expiration":"2025-04-17T08:15:37.7698648"},{"key":"a3703b55-c7fd-4c5a-9b6a-160c1906aa1a","username":"phil","expiration":"2025-04-17T11:35:39.9101516"},{"key":"ba426671-db67-4d2f-a701-3aa0f284f497","username":"phil","expiration":"2025-04-17T08:54:43.230802"},{"key":"639ea3fa-854a-4052-b1cf-80ea1d3d5917","username":"phil","expiration":"2025-04-17T09:38:47.9716959"},{"key":"3d3fb646-9954-496b-98bf-73136c7792ea","username":"phil","expiration":"2025-04-17T10:04:11.7737565"},{"key":"3beac724-e9f9-4969-9634-60826ad9db43","username":"phil","expiration":"2025-04-17T11:20:36.8424562"},{"key":"125a4847-3a1c-4834-961f-7f96e997f92e","username":"sowgro","expiration":"2025-04-14T18:35:38.922687686"},{"key":"ce4accc3-0fa8-40fc-a480-1290d12caaed","username":"phil","expiration":"2025-04-17T09:12:58.9504986"},{"key":"adc5ce2f-5a40-4ee5-b9a6-6154860e6861","username":"phil","expiration":"2025-04-17T08:28:48.4584821"},{"key":"50019b5d-25ad-40fe-bd21-19d4dbe57a92","username":"phil","expiration":"2025-04-29T20:23:12.415416825"},{"key":"14093348-a7ea-4a33-918f-fdb97162ab75","username":"phil","expiration":"2025-05-04T20:48:04.9471896"},{"key":"ad6d92d4-c496-407c-823a-edaa386e67ed","username":"phil","expiration":"2025-04-14T17:07:36.032623002"},{"key":"88b539a9-3986-41b4-a6ed-a79672042ccf","username":"phil","expiration":"2025-04-17T08:23:45.5712888"},{"key":"cc49c007-fd36-4828-b8fa-f5b85ad0676d","username":"phil","expiration":"2025-04-14T16:46:12.80566798"},{"key":"fb2d7dd5-783e-47d8-9a43-8b7693c5f070","username":"phil","expiration":"2025-04-17T11:13:05.9489267"},{"key":"49a0ad40-3223-4f62-94e8-0f9e96241a85","username":"phil","expiration":"2025-04-17T09:13:39.9633546"},{"key":"db53acf2-61d1-45ea-9d01-5c710b80bdaf","username":"phil","expiration":"2025-04-17T08:53:47.487545"},{"key":"b3daa0a9-2d5e-4545-afc5-56d69bbfca52","username":"phil","expiration":"2025-05-05T21:22:44.8130897"},{"key":"77392d17-6e0c-45ec-857d-6595a55ddd97","username":"phil","expiration":"2025-04-14T16:06:48.335542315"},{"key":"58e4e2a2-3a36-4fd6-8bb1-ad0831664d01","username":"phil","expiration":"2025-04-12T23:17:42.638952959"},{"key":"1c438301-e8f5-4c12-a40b-e20b8a282814","username":"keshey","expiration":"2025-04-17T10:26:04.7690496"},{"key":"6d2ea170-50aa-4c48-9247-9310a29ae753","username":"phil","expiration":"2025-04-17T11:29:10.0637357"},{"key":"ae2af91b-f3c7-4701-822c-d174200044f6","username":"phil","expiration":"2025-05-04T19:14:49.7138545"},{"key":"f5f53053-ef5e-4850-93a0-3dc20646f78b","username":"sowgro","expiration":"2025-04-14T18:11:29.438554549"},{"key":"03424ad1-376c-47aa-8553-7f2ea8099d45","username":"phil","expiration":"2025-04-17T08:05:35.7264696"},{"key":"568e4738-70b5-4be7-bfa6-1367cd22ce3f","username":"admin","expiration":"2025-04-17T08:16:59.0542222"},{"key":"440bf2cc-558f-4dad-93dd-8f28c455e1a4","username":"phil","expiration":"2025-05-04T14:49:32.2300318"},{"key":"5d0182e2-247e-4b4e-b165-cd95710c2402","username":"phil","expiration":"2025-04-17T08:17:09.1886771"},{"key":"13d12a6d-6825-4c1d-8b22-ba960de140b8","username":"phil","expiration":"2025-04-14T17:20:58.531711142"},{"key":"a379fbf8-3aad-40d4-b205-bebf2526500a","username":"admin","expiration":"2025-05-05T21:59:26.6896899"},{"key":"e2c17a24-ad11-4e63-8b01-74baf3ae6b4a","username":"phil","expiration":"2025-04-17T10:14:03.2239052"},{"key":"1dc114a0-f5d7-410e-8664-2ca9af3393ac","username":"phil","expiration":"2025-04-17T09:06:49.5204299"},{"key":"ff1e80a8-344f-4578-9ead-a6d46c8ed1c2","username":"phil","expiration":"2025-04-17T10:51:00.0607854"},{"key":"e121c7c6-e534-4fde-8a78-4f175e9db9c8","username":"phil","expiration":"2025-04-14T17:23:23.218442063"},{"key":"05e8790e-67fa-45de-adfe-82c6f5fdd15b","username":"phil","expiration":"2025-04-17T08:18:05.2696558"},{"key":"1a9b7e5a-d19c-43ef-bb02-838b6fc695e0","username":"phil","expiration":"2025-04-17T09:37:48.4955941"},{"key":"718be1e2-cfc7-44a6-b3c6-965684d1d0a9","username":"adf","expiration":"2025-04-14T18:35:58.888847176"},{"key":"66a5f97b-c86a-4554-a74b-8c37e54becb2","username":"phil","expiration":"2025-05-04T14:12:15.1825709"},{"key":"a601d9f2-3c98-458f-ac21-632e0b01e9ae","username":"phil","expiration":"2025-05-05T21:27:09.0438482"},{"key":"f14f187c-355f-444a-88bf-42202f82f947","username":"phil","expiration":"2025-04-17T09:07:05.5541299"},{"key":"004f9f22-2b7e-4448-9c37-7437de47f1e0","username":"phil","expiration":"2025-04-17T08:27:28.3862592"},{"key":"24e8cf17-ad76-45b1-bfb6-79a790035231","username":"admin","expiration":"2025-04-17T08:17:27.7488131"},{"key":"e48872fa-b89f-494a-b681-11a809d32ff4","username":"phil","expiration":"2025-04-14T17:20:23.265745224"},{"key":"31fcbc15-9902-41d2-8d6f-5b0e40ebddd2","username":"phil","expiration":"2025-04-14T16:45:41.082560826"},{"key":"98c11c42-4e7c-4601-b591-a4af1a5163f9","username":"phil","expiration":"2025-04-17T08:54:04.5078852"},{"key":"10ea39c2-3869-47da-8630-87b21a88681d","username":"phil","expiration":"2025-04-17T08:45:33.1781528"},{"key":"7a7d2e8b-4242-4c18-b7dd-d0565ab5c725","username":"phil","expiration":"2025-04-17T10:10:44.3380846"},{"key":"7e312d55-bf3e-4dc3-b44a-74d8be591287","username":"phil","expiration":"2025-04-17T10:56:38.9103348"},{"key":"af38add5-b100-4b96-9ffb-5afaccd59979","username":"adf","expiration":"2025-04-14T18:18:47.670506361"},{"key":"0d81e2b4-d9f2-4bc0-b93f-084c086e3707","username":"phil","expiration":"2025-04-17T08:52:41.0723771"},{"key":"1abcdf8c-d09d-4a54-915e-4fc92649f7fb","username":"admin","expiration":"2025-05-05T21:27:34.0229375"},{"key":"a1825159-2e62-48a3-beba-74a3daaca5b5","username":"phil","expiration":"2025-04-17T08:12:28.2166599"},{"key":"799ed420-e843-4777-8c1a-c6d061cca773","username":"phil","expiration":"2025-04-17T08:39:38.8493536"},{"key":"cdd4df80-8139-4479-86ec-953190796d7b","username":"phil","expiration":"2025-04-17T10:02:07.6745458"},{"key":"da61796e-402a-4a80-88ae-7607a37989a4","username":"phil","expiration":"2025-04-14T17:07:10.618039573"},{"key":"0d6e6910-b5dc-45ae-ba8e-c28604939f83","username":"phil","expiration":"2025-04-17T11:19:21.9682553"},{"key":"b7b403a0-d81f-4f7d-bd28-ccf3e2ac706b","username":"phil","expiration":"2025-04-17T10:28:53.9964744"},{"key":"2aeaab28-99c9-4b45-bdef-82096c70945e","username":"phil","expiration":"2025-04-14T17:19:48.552121268"},{"key":"7805de89-9b38-46dc-8f59-09c06ef9d2dd","username":"phil","expiration":"2025-04-17T08:52:44.6283659"},{"key":"fbdf7ac2-cf01-4dad-baec-ed9310a4eba7","username":"phil","expiration":"2025-04-17T08:38:12.8162926"},{"key":"7907ccb2-bf01-4962-a280-ebb6aa9c5b20","username":"phil","expiration":"2025-04-17T09:45:01.6777324"},{"key":"904f6de1-10ab-465d-abd8-be0612311251","username":"phil","expiration":"2025-04-29T20:24:45.666998397"},{"key":"a69796dd-734c-4545-ac91-e5fe0387d0ad","username":"phil","expiration":"2025-04-17T08:29:32.671782"},{"key":"9f3e380d-fead-4d40-a1c0-278e857dd674","username":"phil","expiration":"2025-04-17T08:52:29.4148814"},{"key":"efc531fb-ab24-4d5a-a2f5-7f4ede74819f","username":"phil","expiration":"2025-04-13T19:41:51.017327545"},{"key":"1e5e4b2b-2599-416e-8e8b-709daf4814af","username":"phil","expiration":"2025-05-05T21:39:39.3016116"},{"key":"68bc53af-e21a-4364-adf5-8f163f642235","username":"phil","expiration":"2025-04-17T08:24:43.3201656"},{"key":"25d6a49b-c185-460c-adbe-a874419d20aa","username":"phil","expiration":"2025-04-29T20:22:19.629805123"},{"key":"3fc557b6-0306-4779-9b74-b7292a5cf1cc","username":"phil","expiration":"2025-04-14T16:06:08.564069822"},{"key":"6083ae1d-a761-4ed3-8c48-a429afa2c521","username":"phil","expiration":"2025-04-17T08:32:25.3500545"},{"key":"fe2146e2-7982-4226-b215-96879939f485","username":"phil","expiration":"2025-04-17T08:34:59.3412483"},{"key":"71509c1b-d7ee-4f7a-aa27-dca7b49fe950","username":"phil","expiration":"2025-05-05T21:42:47.0603281"},{"key":"4829495e-52a3-4382-9ad7-191f5f75e487","username":"admin","expiration":"2025-05-05T21:23:11.420181"},{"key":"825e97c8-df9e-4144-a9b2-f8fa6a19792a","username":"phil","expiration":"2025-05-05T21:41:58.9443962"},{"key":"7a634e0a-628b-4b31-8950-dc33d4ee5d95","username":"phil","expiration":"2025-04-17T08:15:47.1663258"},{"key":"9c6a36b8-7f71-4b09-b26b-682f1f0be4cb","username":"phil","expiration":"2025-04-17T09:12:15.5425885"},{"key":"f6951471-2578-4a6a-b3e5-b7e97ed9207a","username":"phil","expiration":"2025-04-17T10:23:45.9450825"},{"key":"cb658550-aafc-4a45-89be-f7899e44d7ba","username":"phil","expiration":"2025-04-17T10:50:40.0249774"}] \ No newline at end of file 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 6b4c2952e52ee2b8b23067688055011e393f8e4b Mon Sep 17 00:00:00 2001 From: sowgro Date: Sun, 6 Apr 2025 16:04:30 -0400 Subject: Increase animation speed --- ufund-ui/src/styles.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ufund-ui/src/styles.css b/ufund-ui/src/styles.css index 44f6107..876c6f6 100644 --- a/ufund-ui/src/styles.css +++ b/ufund-ui/src/styles.css @@ -7,7 +7,7 @@ * { box-sizing: border-box; color: var(--foreground-color); - transition: all ease-in-out .3s; + transition: color, background-color ease-in-out .1s; } [theme="light"] { -- 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 --- .../src/app/components/dashboard/dashboard.component.css | 4 ++-- .../components/mini-need-list/mini-need-list.component.css | 6 +++--- .../src/app/components/need-list/need-list.component.css | 2 +- ufund-ui/src/styles.css | 12 +++++------- 4 files changed, 11 insertions(+), 13 deletions(-) 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 { diff --git a/ufund-ui/src/styles.css b/ufund-ui/src/styles.css index 876c6f6..f3491e1 100644 --- a/ufund-ui/src/styles.css +++ b/ufund-ui/src/styles.css @@ -1,9 +1,5 @@ /* You can add global styles to this file, and also import other style files */ -/* :root { - color-scheme: dark; -} */ - * { box-sizing: border-box; color: var(--foreground-color); @@ -11,6 +7,7 @@ } [theme="light"] { + color-scheme: light; --background-color: #e6e4df; --secondary-color: #e0dcd4; --tertiary-color: #cac6be; @@ -23,6 +20,7 @@ } [theme="dark"] { + color-scheme: dark; --background-color: #000715; --secondary-color: #444444; --tertiary-color: #3a3a3a; @@ -66,8 +64,8 @@ button, input[type=button], input[type=reset], input[type=submit], .button { padding: 6px 16px; border-radius: 9999px; border-style: none; - font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; - background-color: var(--tertiary-color); + /*font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;*/ + background-color: var(--secondary-color); display: flex; gap: 5px; text-align: center; @@ -83,7 +81,7 @@ button, input[type=button], input[type=reset], input[type=submit], .button { /* text-transform: uppercase; */ border: 3px solid var(--highlight-color); padding: 10px 25px; - font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + /*font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;*/ font-size: 12pt; font-weight: 700; background-color: transparent; -- 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 --- .../funding-basket/funding-basket.component.html | 2 +- ufund-ui/src/styles.css | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) 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

- + diff --git a/ufund-ui/src/styles.css b/ufund-ui/src/styles.css index f3491e1..7f3f973 100644 --- a/ufund-ui/src/styles.css +++ b/ufund-ui/src/styles.css @@ -44,7 +44,7 @@ body { font-optical-sizing: auto; } -input, textarea { +input, textarea, select { resize: none; font-family: Inter, sans-serif; font-size: 14pt; @@ -52,11 +52,16 @@ input, textarea { border-radius: 5px; border-style: solid; border-width: 1px; - background-color: var(--background-color); + background-color: var(--secondary-color); &:hover { background-color: var(--hover-color); } + + &.sort-scheme { + background-color: transparent; + border-color: var(--secondary-color); + } } button, input[type=button], input[type=reset], input[type=submit], .button { @@ -75,6 +80,10 @@ button, input[type=button], input[type=reset], input[type=submit], .button { &:hover { background-color: var(--hover-color); } + + &.sort-scheme { + background-color: transparent; + } } .button2 { @@ -92,14 +101,6 @@ button, input[type=button], input[type=reset], input[type=submit], .button { font-family: 'Material Symbols Outlined' } -.sort-scheme { - background-color: var(--background-color); - border-style: solid; - border-color: var(--tertiary-color); - border-radius: 5px; - border-width: 1px; -} - h1 { font-size: 40px; } -- 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(-) 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 +++- ufund-ui/src/styles.css | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) 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; } diff --git a/ufund-ui/src/styles.css b/ufund-ui/src/styles.css index 7f3f973..eae5b50 100644 --- a/ufund-ui/src/styles.css +++ b/ufund-ui/src/styles.css @@ -2,7 +2,6 @@ * { box-sizing: border-box; - color: var(--foreground-color); transition: color, background-color ease-in-out .1s; } -- 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(-) 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 bc7a0069afac85617fa7724628aac6b3da0d0d2c Mon Sep 17 00:00:00 2001 From: sowgro Date: Sun, 6 Apr 2025 20:16:39 -0400 Subject: Tweak light theme for improved contrast --- ufund-ui/src/styles.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ufund-ui/src/styles.css b/ufund-ui/src/styles.css index eae5b50..c4034ad 100644 --- a/ufund-ui/src/styles.css +++ b/ufund-ui/src/styles.css @@ -8,8 +8,8 @@ [theme="light"] { color-scheme: light; --background-color: #e6e4df; - --secondary-color: #e0dcd4; - --tertiary-color: #cac6be; + --secondary-color: #d7d1c7; + --tertiary-color: #e0dcd4; --foreground-color: #000000; --highlight-color: #cf9451; --dark-highlight-clor: #582f00; -- cgit v1.2.3 From d06ed8ce0a08896e16c353d8b165c9161095228a Mon Sep 17 00:00:00 2001 From: sowgro Date: Sun, 6 Apr 2025 20:43:34 -0400 Subject: Add better hover color for sort-scheme --- ufund-ui/src/styles.css | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/ufund-ui/src/styles.css b/ufund-ui/src/styles.css index c4034ad..82db502 100644 --- a/ufund-ui/src/styles.css +++ b/ufund-ui/src/styles.css @@ -21,16 +21,20 @@ [theme="dark"] { color-scheme: dark; --background-color: #000715; - --secondary-color: #444444; - --tertiary-color: #3a3a3a; - --foreground-color: #ffffff; - --highlight-color: #6091e8; - --dark-highlight-clor: #002846; - --hover-color: #394559; + --secondary-color: #444444; /* color of cards and buttons*/ + --tertiary-color: #3a3a3a; /* color of dark cards */ + --foreground-color: #ffffff; /* used on text */ + --highlight-color: #6091e8; /* accent color */ + --dark-highlight-clor: #002846; /* not used currently */ + --hover-color: #394559; /* hover color for cards and buttons*/ --opacity-cr: 0; --opacity-jf: 1; } +:root { + --background-hover: color-mix(in oklch, var(--background-color) 60%, var(--hover-color) 40%); +} + html, body { margin: 0; height: 100%; @@ -60,6 +64,10 @@ input, textarea, select { &.sort-scheme { background-color: transparent; border-color: var(--secondary-color); + + &:hover { + background-color: var(--background-hover); + } } } @@ -82,6 +90,10 @@ button, input[type=button], input[type=reset], input[type=submit], .button { &.sort-scheme { background-color: transparent; + + &:hover { + background-color: var(--background-hover); + } } } @@ -94,6 +106,10 @@ button, input[type=button], input[type=reset], input[type=submit], .button { font-weight: 700; background-color: transparent; text-shadow: var(--highlight-color) 0 0 50px; + + &:hover { + background-color: var(--background-hover) !important; + } } .icon { -- cgit v1.2.3 From 660d1df5b67bcedb2abc9cb9abc555e9b78ff510 Mon Sep 17 00:00:00 2001 From: sowgro Date: Sun, 6 Apr 2025 20:50:26 -0400 Subject: Make links follow the highlight color --- ufund-ui/src/styles.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ufund-ui/src/styles.css b/ufund-ui/src/styles.css index 82db502..3e923b1 100644 --- a/ufund-ui/src/styles.css +++ b/ufund-ui/src/styles.css @@ -123,3 +123,7 @@ h1 { progress { min-width: 100%; } + +a { + color: var(--highlight-color); +} -- 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 --- .../components/need-page/need-page.component.css | 2 +- ufund-ui/src/styles.css | 26 +++++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) 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; } diff --git a/ufund-ui/src/styles.css b/ufund-ui/src/styles.css index 3e923b1..98e13de 100644 --- a/ufund-ui/src/styles.css +++ b/ufund-ui/src/styles.css @@ -21,14 +21,23 @@ [theme="dark"] { color-scheme: dark; --background-color: #000715; - --secondary-color: #444444; /* color of cards and buttons*/ - --tertiary-color: #3a3a3a; /* color of dark cards */ + --secondary-color: #3a3a3a; /* color of cards and buttons*/ + --tertiary-color: #2e2e2e; /* color of dark cards */ --foreground-color: #ffffff; /* used on text */ --highlight-color: #6091e8; /* accent color */ --dark-highlight-clor: #002846; /* not used currently */ - --hover-color: #394559; /* hover color for cards and buttons*/ + --hover-color: #323c4e; /* hover color for cards and buttons*/ --opacity-cr: 0; --opacity-jf: 1; + + /* Experimental blue dark theme: + --secondary-color: #19212e; + --tertiary-color: #121722; + --foreground-color: #ffffff; + --highlight-color: #6091e8; + --dark-highlight-clor: #002846; + --hover-color: #192940; + */ } :root { @@ -72,7 +81,7 @@ input, textarea, select { } button, input[type=button], input[type=reset], input[type=submit], .button { - font-size: 12pt; + font-size: 14pt; padding: 6px 16px; border-radius: 9999px; border-style: none; @@ -83,6 +92,11 @@ button, input[type=button], input[type=reset], input[type=submit], .button { text-align: center; justify-content: center; align-items: center; + cursor: pointer; + + &:disabled { + pointer-events: none; + } &:hover { background-color: var(--hover-color); @@ -98,8 +112,8 @@ button, input[type=button], input[type=reset], input[type=submit], .button { } .button2 { - /* text-transform: uppercase; */ - border: 3px solid var(--highlight-color); + text-transform: uppercase; + border: 1px solid var(--highlight-color); padding: 10px 25px; /*font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;*/ font-size: 12pt; -- 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(-) 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(-) 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(-) 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(+) 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(-) 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(-) 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(-) 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 From 7617db08a43d873a65abd47b02e23ad8cb4cb5cd Mon Sep 17 00:00:00 2001 From: sowgro Date: Mon, 7 Apr 2025 20:56:03 -0400 Subject: Tweak spacing in ul --- ufund-ui/src/styles.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ufund-ui/src/styles.css b/ufund-ui/src/styles.css index 6bb6970..c3e2c99 100644 --- a/ufund-ui/src/styles.css +++ b/ufund-ui/src/styles.css @@ -141,3 +141,10 @@ progress { a { color: var(--highlight-color); } + +ul { + display: flex; + flex-direction: column; + gap: 5px; + margin: 0; +} -- cgit v1.2.3