add help texts

This commit is contained in:
DerTyp7
2023-09-26 16:34:46 +02:00
parent 92a54b2960
commit d282cebf90
3 changed files with 61 additions and 39 deletions

View File

@@ -36,7 +36,7 @@ export class AnalyzeComponent implements OnInit {
let minLat: number = parseFloat(this.lat!) - 0.13; let minLat: number = parseFloat(this.lat!) - 0.13;
let maxLat: number = parseFloat(this.lat!) + 0.13; let maxLat: number = parseFloat(this.lat!) + 0.13;
this.status = "Downloading OSM data..."; this.status = "Downloading OSM data... This might take a few minutes ";
this.overpassApiService.sendQueryRequest(`${minLon},${minLat},${maxLon},${maxLat}`) this.overpassApiService.sendQueryRequest(`${minLon},${minLat},${maxLon},${maxLat}`)
.pipe(catchError(err => { .pipe(catchError(err => {
@@ -46,7 +46,7 @@ export class AnalyzeComponent implements OnInit {
return of(""); return of("");
})) }))
.subscribe((data: string) => { .subscribe((data: string) => {
if(data != ""){ if (data != "") {
let osm: OSM = this.osmService.parseOsmContent(data); let osm: OSM = this.osmService.parseOsmContent(data);
// Analyze the OSM data // Analyze the OSM data
this.status = "Analyze OSM data..."; this.status = "Analyze OSM data...";

View File

@@ -1,18 +1,38 @@
<div class="search-bar center"> <div class="search-bar center">
<input class="center" type="text" name="searchValue" #searchInput (change)="inputChange(searchInput.value)" placeholder="Search your address" /> <input
class="center"
type="text"
name="searchValue"
#searchInput
(change)="inputChange(searchInput.value)"
placeholder="Search address (Enter to search)"
tabindex="1"
[ngClass]="{ active: searchInput.value }"
/>
<div
<div *ngIf="searchResults && searchResults.length > 0" class="search-results center"> *ngIf="searchResults && searchResults.length > 0"
<br> class="search-results center"
>
<br />
<div *ngFor="let result of searchResults"> <div *ngFor="let result of searchResults">
<div class="search-result" <div
(click)="analyze(result.geometry!.coordinates[0], result.geometry!.coordinates[1])" class="search-result"
*ngIf="result.geometry!.coordinates && result.geometry?.coordinates!.length >= 2"> (click)="
analyze(
<span > result.geometry!.coordinates[0],
<b>{{result.properties.name}}</b> {{result.properties.postcode}} {{result.properties.city}} {{result.properties.country}} result.geometry!.coordinates[1]
)
"
*ngIf="
result.geometry!.coordinates &&
(result.geometry?.coordinates)!.length >= 2
"
>
<span>
<b>{{ result.properties.name }}</b> {{ result.properties.postcode }}
{{ result.properties.city }} {{ result.properties.country }}
</span> </span>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -1,18 +1,19 @@
.search-bar{ .search-bar {
margin-top: 50px; margin-top: 50px;
width: 600px; width: 600px;
transition: 0.1s; transition: 0.1s;
transition-timing-function: linear; transition-timing-function: linear;
&:hover{ &:hover,
&:focus-within {
width: 700px; width: 700px;
} }
input{ input {
width: 100%; width: 100%;
border: 2px solid rgb(84, 206, 104); border: 2px solid rgb(84, 206, 104);
border-radius: 5px; border-radius: 5px;
background-color: rgba(0,0,0,0); background-color: rgba(0, 0, 0, 0);
color: #fff; color: #fff;
font-size: 1.5rem; font-size: 1.5rem;
padding: 10px; padding: 10px;
@@ -21,42 +22,43 @@
transition: 0.1s; transition: 0.1s;
transition-timing-function: linear; transition-timing-function: linear;
&:hover{ &:hover,
&:focus,
&.active {
border-color: rgb(128, 240, 147); border-color: rgb(128, 240, 147);
background-color: rgba(255,255,255,0.05); background-color: rgba(255, 255, 255, 0.05);
width: 100%; width: 100%;
} }
} }
} }
.search-results{ .search-results {
display: block; display: block;
width: 100%; width: 100%;
background-color: rgba(255,255,255,0.02); background-color: rgba(255, 255, 255, 0.02);
border-top: 0px !important; border-top: 0px !important;
border: 2px solid rgb(59, 59, 59); border: 2px solid rgb(59, 59, 59);
margin-top: -2px; margin-top: -2px;
transition: 0.1s; transition: 0.1s;
transition-timing-function: linear; transition-timing-function: linear;
&:hover{ &:hover {
border-color: rgb(85, 85, 85); border-color: rgb(85, 85, 85);
background-color: rgba(218, 216, 216, 0.03); background-color: rgba(218, 216, 216, 0.03);
} }
.search-result{ .search-result {
padding-top: 10px; padding-top: 10px;
padding-bottom: 10px; padding-bottom: 10px;
padding-left: 10px; padding-left: 10px;
border-bottom: 1px solid rgba(255, 255, 255, 0.062); border-bottom: 1px solid rgba(255, 255, 255, 0.062);
font-size: 12pt; font-size: 12pt;
cursor:pointer; cursor: pointer;
transition: 0.1s; transition: 0.1s;
transition-timing-function: linear; transition-timing-function: linear;
letter-spacing: 1.5px; letter-spacing: 1.5px;
&:hover{ &:hover {
border-left: 5px solid rgb(84, 206, 104); border-left: 5px solid rgb(84, 206, 104);
padding-left: 25px; padding-left: 25px;
background-color: rgba(218, 216, 216, 0.05); background-color: rgba(218, 216, 216, 0.05);