diff --git a/src/app/home/home.component.css b/src/app/home/home.component.css
index 618f23e..ecdbbe3 100644
--- a/src/app/home/home.component.css
+++ b/src/app/home/home.component.css
@@ -28,6 +28,14 @@ input {
}
+.inputElements{
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ align-content: center;
+ gap: 20px;
+}
+
.bg-image {
background-image: url('src/assets/img/mountains.png');
background-size: cover;
diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html
index 05f3d1d..ad6a405 100644
--- a/src/app/home/home.component.html
+++ b/src/app/home/home.component.html
@@ -1,13 +1,35 @@
-
-
+
+
+
+
+
-
+
0" class="menu bg-base-200 !w-fit p-2 rounded-box" id="list">
@@ -15,7 +37,7 @@
Places
- -
+
-
{{luogo.location}}
diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts
index b1ab091..c8d3e5a 100644
--- a/src/app/home/home.component.ts
+++ b/src/app/home/home.component.ts
@@ -3,6 +3,7 @@ import {distinctUntilChanged, fromEvent, Observable, Subject, Subscription} from
import {ReadjsonService} from "../service/readjson.service";
import {Locations} from "../interface/data";
import * as QRCode from 'qrcode';
+import {Router} from "@angular/router";
interface Luogo {
location: string;
@@ -21,13 +22,11 @@ export class HomeComponent implements OnInit, AfterViewInit, OnDestroy {
public locationsPopup: Subject = new Subject()
- subs: Subscription[] = []
-
-
+ subs: Subscription[] = [];
backgroundColor: string | undefined;
qrCodeImage: string | undefined;
locations: Locations[] = [];
-
+ allert: boolean = false;
locationsFiltrati: Locations[] = [];
luogoSelezionato: string = '';
suggerimentoAttivo: boolean = false;
@@ -40,7 +39,7 @@ export class HomeComponent implements OnInit, AfterViewInit, OnDestroy {
img: any;
- constructor(private readjsonService: ReadjsonService) {
+ constructor(private readjsonService: ReadjsonService, private router: Router) {
}
ngOnInit(): void {
@@ -50,8 +49,7 @@ export class HomeComponent implements OnInit, AfterViewInit, OnDestroy {
console.log(data[i])
}
});
-
-
+ this.allert = false;
console.log("home init");
this.subs.push(this.readjsonService.getLocation("Lugano").subscribe(val => console.log(val)))
const text = 'https://aramisgrata.ch'; // sostituisci con la tua stringa
@@ -172,9 +170,24 @@ export class HomeComponent implements OnInit, AfterViewInit, OnDestroy {
return null;
}
+ onSearch(): void {
+ if (this.luogoSelezionato === '') {
+ this.allert=true;
+ setTimeout(() => {
+ this.allert=false;
+ }, 8000);
+ return;
+ }else{
+ const nomeLocation = encodeURIComponent(this.luogoSelezionato);
+ this.router.navigate(['/location', nomeLocation]);
+ }
+ }
+
protected readonly Event = Event;
}
+
+
function stringDifference(str1: string, str2: string): string {
let diff = '';
for (let i = 0; i < str2.length; i++) {
diff --git a/src/app/list/list.component.html b/src/app/list/list.component.html
index 084bacd..c2dfc07 100644
--- a/src/app/list/list.component.html
+++ b/src/app/list/list.component.html
@@ -10,8 +10,7 @@
{{waypoinst.name}}
-
-
+ Distance: }