From cfe40fa1e416fbf4586ef36b63a145453a4d6224 Mon Sep 17 00:00:00 2001 From: sowgro Date: Mon, 31 Mar 2025 00:38:37 -0400 Subject: Continue working on css (1) --- ufund-ui/src/app/app.component.css | 28 +++++ ufund-ui/src/app/app.component.html | 8 ++ ufund-ui/src/app/app.component.ts | 13 ++- .../app/components/cupboard/cupboard.component.css | 13 +-- .../components/cupboard/cupboard.component.html | 6 +- .../mini-need-list/mini-need-list.component.css | 1 + .../components/need-list/need-list.component.css | 126 ++++++++++----------- .../components/need-list/need-list.component.html | 73 ++++++------ .../components/need-list/need-list.component.ts | 4 +- ufund-ui/src/app/services/toasts.service.ts | 19 ++++ 10 files changed, 179 insertions(+), 112 deletions(-) create mode 100644 ufund-ui/src/app/services/toasts.service.ts (limited to 'ufund-ui/src') diff --git a/ufund-ui/src/app/app.component.css b/ufund-ui/src/app/app.component.css index 5596cf8..5af3958 100644 --- a/ufund-ui/src/app/app.component.css +++ b/ufund-ui/src/app/app.component.css @@ -43,3 +43,31 @@ text-decoration: underline; } } + +.toast { + transform: translateY(-90px); + transition: transform .5s; + align-self: center; + z-index: 3; + position: absolute; + top: 15px; + display: flex; + flex-direction: row; + padding: 3px 15px; + background-color: #3a3a3a; + border-radius: 100000px; + gap: 10px; + align-items: center; + + button { + aspect-ratio: 1/1; + margin-right: -11px; + padding: 8px; + display: flex; + align-items: center; + } +} + +.toast.active { + transform: translateY(0); +} diff --git a/ufund-ui/src/app/app.component.html b/ufund-ui/src/app/app.component.html index b0ee329..b41a225 100644 --- a/ufund-ui/src/app/app.component.html +++ b/ufund-ui/src/app/app.component.html @@ -1,3 +1,11 @@ +
+ + + + + +
+ + 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 af8cab4..47114c3 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 @@ -66,7 +66,7 @@ export class NeedListComponent { selectedNeed: Need | null = null; needs: Need[] = []; searchResults: Need[] = []; - sortMode = 'Ascending' + sortMode: 'Ascending' | 'Descending' = 'Ascending' currentSortAlgo: sortAlgo = sortByPriority; sortSelection: string = 'sortByPriority'; @@ -98,7 +98,7 @@ export class NeedListComponent { }); const form = document.getElementById('search-form') as HTMLFormElement; - form.reset(); + form.reset(); this.search(null); } diff --git a/ufund-ui/src/app/services/toasts.service.ts b/ufund-ui/src/app/services/toasts.service.ts new file mode 100644 index 0000000..0c35e45 --- /dev/null +++ b/ufund-ui/src/app/services/toasts.service.ts @@ -0,0 +1,19 @@ +import {Injectable} from '@angular/core'; + +export enum ToastType { + INFO, + WARNING, + ERROR +} + +@Injectable({ + providedIn: 'root' +}) +export class ToastsService { + + constructor() {} + + sendToast(type: ToastType, message: string, action?: {label: string, onAction: () => void}) { + + } +} -- cgit v1.2.3