aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app
diff options
context:
space:
mode:
authorAkash Keshav <112591754+domesticchores@users.noreply.github.com>2025-04-04 14:53:32 -0400
committerAkash Keshav <112591754+domesticchores@users.noreply.github.com>2025-04-04 14:53:32 -0400
commitb4a9cd9d540d42a61bee9045d41ada392305a8d5 (patch)
tree3cddb6389800788cb5d8b397cf21dbd40142be1b /ufund-ui/src/app
parent8cdf84ae4a6765db8f462cc71e2685c1d3514f08 (diff)
downloadJellySolutions-b4a9cd9d540d42a61bee9045d41ada392305a8d5.tar.gz
JellySolutions-b4a9cd9d540d42a61bee9045d41ada392305a8d5.tar.bz2
JellySolutions-b4a9cd9d540d42a61bee9045d41ada392305a8d5.zip
add light/dark mode toggle, only homepage is fully functional. -ak
Diffstat (limited to 'ufund-ui/src/app')
-rw-r--r--ufund-ui/src/app/app.component.css1
-rw-r--r--ufund-ui/src/app/app.component.html7
-rw-r--r--ufund-ui/src/app/app.component.ts6
-rw-r--r--ufund-ui/src/app/components/home-page/home-page.component.css16
-rw-r--r--ufund-ui/src/app/components/home-page/home-page.component.html10
-rw-r--r--ufund-ui/src/app/components/home-page/home-page.component.ts16
6 files changed, 43 insertions, 13 deletions
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 @@
</a>
</div>
<div>
- <a *ngIf="(currentUser | async)?.type === userType.MANAGER" routerLink="/dashboard">Dashboard</a>
- <a routerLink="/cupboard">Cupboard</a>
- <a *ngIf="(currentUser | async)?.type === userType.HELPER" routerLink="/basket">Basket</a>
+ <button *ngIf="(currentUser | async)?.type === userType.MANAGER" routerLink="/dashboard">Dashboard</button>
+ <button routerLink="/cupboard">Cupboard</button>
+ <button *ngIf="(currentUser | async)?.type === userType.HELPER" routerLink="/basket">Basket</button>
<!-- <span>{{currentUser$ | async}}</span>-->
<button *ngIf="currentUser | async" (click)="logout()"> Log Out</button>
<button *ngIf="!(currentUser | async)" (click)="login()"> Log In</button>
+ <button class="button" (click)="toggleColorScheme()"><span class="icon">brightness_7</span></button>
</div>
</div>
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 @@
<div id="hero">
<div id="left">
- <h1>Helping fund coral reef and marine life conservation</h1>
+ <h1>Helping fund <span class="text-highlight">coral reef</span> and
+ <span class="text-highlight">marine life</span> conservation.</h1>
<p>View our online cupboard holding all needs related to sea life preservation</p>
- <button class="button2" routerLink="/cupboard">View needs</button>
+ <button class="button2" routerLink="/cupboard">View Needs</button>
</div>
<div id="right">
- <img id="jf" src="jf.png" height="1024" width="1024"/>
+ <!-- <img id="jf" src="jf.png" height="1024" width="1024"/> -->
+ <div style="width: 500px; height: 500px;"></div>
+ <img style="position: absolute;" id="cr" src="cr.png" height="700" width="700"/>
+ <img style="position: absolute;" id="jf" src="jf.png" height="700" width="700"/>
</div>
</div>
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);
+ }
+
+
+
+
}