} @else {-}
- | {{ tripitem.comment || '-' }} |
+ {{ tripitem.comment || '-' }} |
@if (tripitem.lat) { {{ tripitem.lat }}, {{ tripitem.lng }} }
@@ -231,7 +233,7 @@
-
@@ -242,7 +244,8 @@
Places
{{ trip?.name }} places
-
+
@@ -250,7 +253,8 @@
@defer {
- {{ places.length }}
+ {{
+ places.length }}
} @placeholder (minimum 0.4s) {
}
@@ -262,28 +266,30 @@
@defer {
@for (p of places; track p.id) {
-
- {{ p.name }}
+ {{ p.name }}
{{ p.place }}
{{ p.category.name }}
@if (isPlaceUsed(p.id)) {
-
} @else {
-
}
- {{ p.price || '-'
+ {{
+ p.price || '-'
}} {{ currency$ | async }}
@@ -311,7 +317,8 @@
Days
{{ trip?.name }} days
-
+
@@ -325,14 +332,16 @@
@defer {
@for (d of trip?.days; track d.id) {
-
+ class="group flex items-center gap-4 rounded-md justify-between h-10 px-4 py-2 hover:bg-gray-50 w-full max-w-full dark:hover:bg-gray-800">
+
{{ d.label }}
- {{
+ {{
getDayStats(d).price || '-' }} {{ currency$ | async }}
- {{
+ {{
getDayStats(d).places }}
@@ -364,7 +373,8 @@
Watchlist
{{ trip?.name }} pending/constraints
-
+
@@ -401,12 +411,12 @@
@if (isMapFullscreen) {
-
-
+
-
+
+ [severity]="tripMapAntLayerDayID == -1 ? 'help' : 'secondary'" />
}
\ No newline at end of file
diff --git a/src/src/app/modals/trip-place-select-modal/trip-place-select-modal.component.html b/src/src/app/modals/trip-place-select-modal/trip-place-select-modal.component.html
index dcf4273..c2edb7e 100644
--- a/src/src/app/modals/trip-place-select-modal/trip-place-select-modal.component.html
+++ b/src/src/app/modals/trip-place-select-modal/trip-place-select-modal.component.html
@@ -11,7 +11,8 @@
Selected
- {{ selectedPlaces.length }}
+ {{
+ selectedPlaces.length }}
Here are your selected place{{ selectedPlaces.length > 1 ? 's' : ''
}}
@@ -22,31 +23,32 @@
@if (showSelectedPlaces) {
@for (p of selectedPlaces; track p.id) {
-
- {{ p.name }}
+ {{ p.name }}
{{ p.place }}
@if (p.allowdog) {
- 🐶
+ 🐶
} @else {
- 🐶
+ 🐶
}
@if (p.visited) {
-
} @else {
-
}
{{ p.category.name }}
@@ -60,29 +62,30 @@
@defer {
@for (p of displayedPlaces; track p.id) {
-
- {{ p.name }}
+ {{ p.name }}
{{ p.place }}
@if (p.allowdog) {
- 🐶
+ 🐶
} @else {
- 🐶
+ 🐶
}
@if (p.visited) {
-
} @else {
-
}
{{ p.category.name }}
@@ -93,8 +96,8 @@
}
-
-
+
} @placeholder (minimum 0.4s) {
diff --git a/src/src/app/services/utils.service.ts b/src/src/app/services/utils.service.ts
index 3ed443d..a428766 100644
--- a/src/src/app/services/utils.service.ts
+++ b/src/src/app/services/utils.service.ts
@@ -5,6 +5,7 @@ import { ApiService } from "./api.service";
import { map } from "rxjs";
const DISABLE_LOWNET = "TRIP_DISABLE_LOWNET";
+const DARK = "DARKMODE";
@Injectable({
providedIn: "root",
@@ -13,9 +14,12 @@ export class UtilsService {
private apiService = inject(ApiService);
currency$ = this.apiService.settings$.pipe(map((s) => s?.currency ?? "€"));
public isLowNet: boolean = true;
+ public isDarkMode: boolean = false;
constructor(private ngMessageService: MessageService) {
this.isLowNet = !localStorage.getItem(DISABLE_LOWNET);
+ this.isDarkMode = !!localStorage.getItem(DARK);
+ if (this.isDarkMode) this.renderDarkMode();
}
toGithubTRIP() {
@@ -31,6 +35,22 @@ export class UtilsService {
this.isLowNet = !this.isLowNet;
}
+ renderDarkMode() {
+ const element = document.querySelector("html");
+ element?.classList.toggle("dark");
+ }
+
+ toggleDarkMode() {
+ if (this.isDarkMode) {
+ localStorage.removeItem(DARK);
+ this.isDarkMode = false;
+ } else {
+ localStorage.setItem(DARK, "1");
+ this.isDarkMode = true;
+ }
+ this.renderDarkMode();
+ }
+
get statuses(): TripStatus[] {
return [
{ label: "pending", color: "#3258A8" },
diff --git a/src/tailwind.config.js b/src/tailwind.config.js
index ce1d474..a01a190 100644
--- a/src/tailwind.config.js
+++ b/src/tailwind.config.js
@@ -1,10 +1,9 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
- content: [
- "./src/**/*.{html,ts}",
- ],
+ darkMode: "selector",
+ content: ["./src/**/*.{html,ts}"],
theme: {
extend: {},
},
- plugins: [require('tailwindcss-primeui')]
-}
\ No newline at end of file
+ plugins: [require("tailwindcss-primeui")],
+};
|