Refactored the weather-forecast web component and cleaned up main project.
This commit is contained in:
@@ -20,7 +20,7 @@ import { ResourceService } from '../../../../src/app/services/resource.service
|
||||
import { CityForecastService } from '../../../../src/app/services/city-forecast.service';
|
||||
import { DefaultService } from '../../../../src/api/api/default.service';
|
||||
import { Configuration } from '../../../../src/api/configuration';
|
||||
import { LocalDatePipe, LocalTimePipe } from '../../../../src/app/pipes/location.pipes';
|
||||
import { LocalDatePipe, LocalTimePipe, LocalNamePipe } from '../../../../src/app/pipes/location.pipes';
|
||||
import {
|
||||
CloudPipe,
|
||||
DirectionIconPipe,
|
||||
@@ -63,6 +63,7 @@ const apidomain = (): { http: string, ws: string } => {
|
||||
ConditionsDialogComponent,
|
||||
LocalDatePipe,
|
||||
LocalTimePipe,
|
||||
LocalNamePipe,
|
||||
CloudPipe,
|
||||
DirectionIconPipe,
|
||||
DirectionPipe,
|
||||
@@ -90,11 +91,10 @@ const apidomain = (): { http: string, ws: string } => {
|
||||
// injection token for http client
|
||||
{ provide: Configuration, useValue: new Configuration({ basePath: apidomain().http }) },
|
||||
{ provide: 'wsdomain', useValue: apidomain().ws },
|
||||
ResourceService,
|
||||
CityForecastService,
|
||||
DefaultService,
|
||||
LocalDatePipe,
|
||||
LocalTimePipe,
|
||||
LocalNamePipe,
|
||||
CloudPipe,
|
||||
DirectionIconPipe,
|
||||
DirectionPipe,
|
||||
|
||||
+56
-41
@@ -1,49 +1,64 @@
|
||||
<!-- TODO: Kacheln nebeneinander darstellen. -->
|
||||
<div [ngClass]="!dayTime ? 'mws-inline' : ''">
|
||||
<div #outerContainer class="mws-outer-container">
|
||||
<ng-template #errMsg>
|
||||
<h3 class="mws-error">{{ errorMsg }}</h3>
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<mat-card-title>{{ res.strings('web_comp_err_title') }}</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<p>{{ errorMsg }}</p>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</ng-template>
|
||||
<div #innerContainer *ngIf="!errorMsg; else errMsg"
|
||||
class="mws-inner-container clickable"
|
||||
[ngClass]="noBorder ? '' : 'mws-inner-container-border'"
|
||||
(click)="goToMowestaHandler()">
|
||||
<div *ngIf="city" class="mws-header" [matTooltip]="cityTooltip">
|
||||
<mat-icon class="mws-header-icon">place</mat-icon>
|
||||
<div #headerText class="mws-header-text">
|
||||
<h1 class="ellipsis">{{ city }}</h1>
|
||||
<p *ngIf="country" class="ellipsis">{{ country }}</p>
|
||||
<div #innerContainer
|
||||
*ngIf="!errorMsg; else errMsg"
|
||||
class="mws-inner-container">
|
||||
<div class="mws-inner-container clickable"
|
||||
(click)="goToMowestaHandler()">
|
||||
<div *ngIf="city" class="mws-header" [matTooltip]="cityTooltip">
|
||||
<mat-icon class="mws-header-icon">place</mat-icon>
|
||||
<div #headerText class="mws-header-text">
|
||||
<h1 class="ellipsis">{{ city }}</h1>
|
||||
<p *ngIf="country" class="ellipsis">{{ country }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<ng-template #progressBar>
|
||||
<mat-spinner></mat-spinner>
|
||||
</ng-template>
|
||||
<div *ngIf="forecast$ | async as f; else progressBar"
|
||||
class="mws-flexbox">
|
||||
<div class="mws-flexbox">
|
||||
<ng-container *ngFor="let t of f; let i = index">
|
||||
<app-weather-summary *ngIf="i < 2"
|
||||
[noMargin]="!dayTime"
|
||||
[ngClass]="dayTime ? 'mws-side-padding' : ''"
|
||||
[title]="t.title"
|
||||
[subtitle]="t.subtitle"
|
||||
[conditions]="t.conditions"
|
||||
[clickHandler]="goToMowestaHandler">
|
||||
</app-weather-summary>
|
||||
</ng-container>
|
||||
</div>
|
||||
<div class="mws-flexbox">
|
||||
<ng-container *ngFor="let t of f; let i = index">
|
||||
<app-weather-summary *ngIf="i >= 2"
|
||||
[noMargin]="!dayTime"
|
||||
[ngClass]="dayTime ? 'mws-side-padding' : ''"
|
||||
[title]="t.title"
|
||||
[subtitle]="t.subtitle"
|
||||
[conditions]="t.conditions"
|
||||
[clickHandler]="goToMowestaHandler">
|
||||
</app-weather-summary>
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ng-template #progressBar>
|
||||
<mat-spinner></mat-spinner>
|
||||
</ng-template>
|
||||
<div *ngIf="forecast$ | async as f; else progressBar"
|
||||
class="mws-flexbox"
|
||||
[ngClass]="noBackground ? '' : 'mws-content'">
|
||||
<div class="mws-flexbox">
|
||||
<ng-container *ngFor="let t of f; let i = index">
|
||||
<app-weather-summary *ngIf="i < 2"
|
||||
class="mws-summary-box"
|
||||
[title]="t.title"
|
||||
[subtitle]="t.subtitle"
|
||||
[conditions]="t.conditions"
|
||||
[clickHandler]="goToMowestaHandler">
|
||||
</app-weather-summary>
|
||||
</ng-container>
|
||||
</div>
|
||||
<div class="mws-flexbox">
|
||||
<ng-container *ngFor="let t of f; let i = index">
|
||||
<app-weather-summary *ngIf="i >= 2"
|
||||
class="mws-summary-box"
|
||||
[title]="t.title"
|
||||
[subtitle]="t.subtitle"
|
||||
[conditions]="t.conditions"
|
||||
[clickHandler]="goToMowestaHandler">
|
||||
</app-weather-summary>
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="!noFooter" class="mws-footer clickable" (click)="goToMowestaHandler()">
|
||||
<h4>Powered by mowesta.com</h4>
|
||||
<div *ngIf="!noFooter" class="mws-footer">
|
||||
<h4>{{ res.strings('web_comp_footer_computed') }}<a href="https://www.dwd.de" target="_blank" class="mws-footer-link">DWD</a>
|
||||
{{ res.strings('web_comp_footer_provided') }}<a href="https://www.mowesta.com" target="_blank" class="mws-footer-link">MoWeSta</a>.
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+11
-5
@@ -1,7 +1,7 @@
|
||||
@import "styles.scss";
|
||||
|
||||
div { padding: 0; }
|
||||
.mws-error { color: tomato; }
|
||||
.mws-inline { display: inline-block; }
|
||||
.mws-outer-container {
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
@@ -9,7 +9,7 @@ div { padding: 0; }
|
||||
align-items: center;
|
||||
}
|
||||
.mws-inner-container {
|
||||
display: inline-flex;
|
||||
display: flex;
|
||||
flex-flow: column nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
@@ -28,8 +28,8 @@ div { padding: 0; }
|
||||
}
|
||||
}
|
||||
}
|
||||
.mws-content { background: #00695c; }
|
||||
.mws-summary-box { padding-right: .3rem; padding-left: .3rem; }
|
||||
//.mws-content { background: #00695c; }
|
||||
.mws-side-padding { padding-right: .3rem; padding-left: .3rem; }
|
||||
.mws-flexbox {
|
||||
display: inline-flex;
|
||||
flex-flow: row wrap;
|
||||
@@ -37,6 +37,12 @@ div { padding: 0; }
|
||||
}
|
||||
.mws-footer {
|
||||
width: 100%;
|
||||
background-color: #f9a825;
|
||||
text-align: center;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.mws-footer-link {
|
||||
color: #003b7a;
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
+31
-39
@@ -17,6 +17,7 @@ import {
|
||||
WeatherConditionSummary
|
||||
} from '../../../../../src/app/services/city-forecast.service';
|
||||
import {City, DefaultService} from '../../../../../src/app/api';
|
||||
import {LocalNamePipe} from "../../../../../src/app/pipes";
|
||||
|
||||
/**
|
||||
* Shows the current day forecast for a particular city. The main use is
|
||||
@@ -37,8 +38,8 @@ export class WeatherForecastTodayComponent implements OnInit, AfterViewChecked,
|
||||
@Input() dayTime?: boolean;
|
||||
@Input() noHeader?: boolean;
|
||||
@Input() noFooter?: boolean;
|
||||
@Input() noBorder?: boolean;
|
||||
@Input() noBackground?: boolean;
|
||||
// TODO: Filterung von den Kacheldaten implementieren.
|
||||
@Input() verbose?: boolean;
|
||||
|
||||
@ViewChild('outerContainer') outer: ElementRef;
|
||||
@ViewChild('innerContainer') inner: ElementRef;
|
||||
@@ -54,19 +55,20 @@ export class WeatherForecastTodayComponent implements OnInit, AfterViewChecked,
|
||||
private cityReqSubscr: Subscription;
|
||||
private forecastReqErrorSubscr: Subscription;
|
||||
// Fixed values for component width.
|
||||
private readonly outerBrkPt1 = 1257;
|
||||
private readonly outerBrkPt2 = 639;
|
||||
private readonly outerBrkPt1 = 1245;
|
||||
private readonly outerBrkPt2 = 625;
|
||||
private readonly innerDefault = '1241px';
|
||||
private readonly innerHeadDef = '';
|
||||
private readonly innerMedium = '622px';
|
||||
private readonly innerHeadMd = '450px';
|
||||
private readonly innerSmall = '311px';
|
||||
private readonly innerSmall = '300px';
|
||||
private readonly innerHeadSm = '250px';
|
||||
|
||||
constructor(
|
||||
public readonly res: ResourceService,
|
||||
private readonly apiClientService: DefaultService,
|
||||
private readonly cityForecastService: CityForecastService
|
||||
private readonly cityForecastService: CityForecastService,
|
||||
private readonly localNamePipe: LocalNamePipe
|
||||
) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -75,21 +77,21 @@ export class WeatherForecastTodayComponent implements OnInit, AfterViewChecked,
|
||||
this.res.setLanguage(this.langCode);
|
||||
this.goToMowestaHandler = () => window
|
||||
.open(`https://www.mowesta.com/app/${this.res.getLanguage()}/weather/cities/${this.cityId}`, '_blank');
|
||||
this.cityReqSubscr = this.apiClientService.getCity(this.cityId).subscribe(
|
||||
(city: City) => {
|
||||
this.cityReqSubscr = this.apiClientService.getCity(this.cityId).subscribe({
|
||||
next: (city: City) => {
|
||||
if (!this.noHeader) { this.setHeaderInfos(city); }
|
||||
const date = new Date();
|
||||
const period = this.tomorrow ? ForecastPeriod.TOMORROW : ForecastPeriod.TODAY;
|
||||
const { dayForecasts, daytimeForecasts, error } = this.cityForecastService.fetchForecasts(city, date, period);
|
||||
this.forecast$ = this.dayTime ? daytimeForecasts : dayForecasts;
|
||||
this.forecastReqErrorSubscr = error.subscribe(
|
||||
(forecastErr: any) => this.handleErrorMsg(forecastErr, 'An Error occured while fetching forecast information.')
|
||||
(forecastErr: any) => this.handleErrorMsg(forecastErr, this.res.strings('web_comp_err_fetch_forecast'))
|
||||
);
|
||||
},
|
||||
(cityErr: any) => this.handleErrorMsg(cityErr, 'An Error occured while fetching city information.')
|
||||
);
|
||||
error: (cityErr: any) => this.handleErrorMsg(cityErr, this.res.strings('web_comp_err_fetch_city'))
|
||||
});
|
||||
} else {
|
||||
this.errorMsg = 'You have to specify a city id!';
|
||||
this.errorMsg = this.res.strings('web_comp_err_no_city_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,14 +115,13 @@ export class WeatherForecastTodayComponent implements OnInit, AfterViewChecked,
|
||||
this.dayTime = this.dayTime !== undefined;
|
||||
this.noHeader = this.noHeader !== undefined;
|
||||
this.noFooter = this.noFooter !== undefined;
|
||||
this.noBorder = this.noBorder !== undefined;
|
||||
this.noBackground = this.noBackground !== undefined;
|
||||
this.verbose = this.verbose !== undefined;
|
||||
}
|
||||
|
||||
private setHeaderInfos(city: City): void {
|
||||
this.city = this.getLocationName(city.names);
|
||||
const stateName = this.getLocationName(city.state?.names);
|
||||
const countryName = this.getLocationName(city.country?.names);
|
||||
this.city = this.localNamePipe.transform(city.names);
|
||||
const stateName = this.localNamePipe.transform(city.state?.names, true);
|
||||
const countryName = this.localNamePipe.transform(city.country?.names, true);
|
||||
if (stateName && countryName) {
|
||||
this.country = `${stateName}, ${countryName}`;
|
||||
} else if (stateName || countryName) {
|
||||
@@ -130,12 +131,6 @@ export class WeatherForecastTodayComponent implements OnInit, AfterViewChecked,
|
||||
: `${this.city}, ${this.country}`;
|
||||
}
|
||||
|
||||
private getLocationName(locationNames?: any): string {
|
||||
let name = locationNames[this.langCode] as string;
|
||||
if (!name) { name = locationNames.local as string; }
|
||||
return name;
|
||||
}
|
||||
|
||||
private handleErrorMsg(error: any, errorMsg: string): void {
|
||||
if (error) { this.errorMsg = errorMsg; }
|
||||
}
|
||||
@@ -144,32 +139,29 @@ export class WeatherForecastTodayComponent implements OnInit, AfterViewChecked,
|
||||
const outerDiv: HTMLDivElement = this.outer?.nativeElement;
|
||||
const innerDiv: HTMLDivElement = this.inner?.nativeElement;
|
||||
if (!outerDiv || !innerDiv) { return; }
|
||||
let headerTextSize: string;
|
||||
let innerDivMaxWidth: string;
|
||||
|
||||
if (this.dayTime) {
|
||||
// Needs to check container size due to multiple tiles.
|
||||
if (this.outerBrkPt2 < outerDiv.clientWidth && outerDiv.clientWidth <= this.outerBrkPt1) {
|
||||
this.setHeaderTextSize(this.innerHeadMd);
|
||||
if (innerDiv.style.maxWidth !== this.innerMedium) {
|
||||
innerDiv.style.maxWidth = this.innerMedium;
|
||||
}
|
||||
headerTextSize = this.innerHeadMd;
|
||||
innerDivMaxWidth = this.innerMedium;
|
||||
} else if (outerDiv.clientWidth <= this.outerBrkPt2) {
|
||||
this.setHeaderTextSize(this.innerHeadSm);
|
||||
if (innerDiv.style.maxWidth !== this.innerSmall) {
|
||||
innerDiv.style.maxWidth = this.innerSmall;
|
||||
}
|
||||
headerTextSize = this.innerHeadSm;
|
||||
innerDivMaxWidth = this.innerSmall;
|
||||
} else {
|
||||
this.setHeaderTextSize(this.innerHeadDef);
|
||||
if (innerDiv.style.maxWidth !== this.innerDefault) {
|
||||
innerDiv.style.maxWidth = this.innerDefault;
|
||||
}
|
||||
headerTextSize = this.innerHeadDef;
|
||||
innerDivMaxWidth = this.innerDefault;
|
||||
}
|
||||
} else {
|
||||
// Container size always set to small because there is only one tile.
|
||||
this.setHeaderTextSize(this.innerHeadSm);
|
||||
if (innerDiv.style.maxWidth !== this.innerSmall) {
|
||||
innerDiv.style.maxWidth = this.innerSmall;
|
||||
}
|
||||
headerTextSize = this.innerHeadSm;
|
||||
innerDivMaxWidth = this.innerSmall;
|
||||
}
|
||||
|
||||
this.setHeaderTextSize(headerTextSize);
|
||||
if (innerDiv.style.maxWidth !== innerDivMaxWidth) { innerDiv.style.maxWidth = innerDivMaxWidth; }
|
||||
}
|
||||
|
||||
private setHeaderTextSize(newSize: string): void {
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
<body>
|
||||
<weather-forecast-today city-id="20549" day-time tomorrow></weather-forecast-today>
|
||||
<weather-forecast-today city-id="20549" ></weather-forecast-today>
|
||||
<weather-forecast-today city-id="47620" tomorrow></weather-forecast-today>
|
||||
<weather-forecast-today city-id="47620" day-time tomorrow></weather-forecast-today>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -46,7 +46,7 @@ import { ToolbarButtonComponent, DecisionPanelComponent, EmailFieldComponent, La
|
||||
import { CitiesListComponent, WeatherConditionComponent, WeatherVideoComponent,
|
||||
WeatherVideoBarComponent, WeatherVideoListComponent, WeatherStationsListComponent, WeatherReportsListComponent,
|
||||
WeatherReportComponent, WeatherSummaryComponent, WeatherDiagramComponent } from './widgets-weather';
|
||||
import { LoginComponent, ActivateComponent, ChangeComponent, RegisterComponent, ResetComponent,
|
||||
import { LoginComponent, ActivateComponent, ChangeComponent, RegisterComponent, ResetComponent,
|
||||
LoadingComponent } from './views-common';
|
||||
import { CitiesComponent, CityComponent, CountryComponent, StateComponent, VideosComponent,
|
||||
StationsComponent, StationComponent } from './views-weather';
|
||||
@@ -71,9 +71,6 @@ import { HumidityPipe, CloudPipe, PressurePipe, TemperaturePipe, SpeedPipe, Snow
|
||||
GoogleMapsPipe, WikipediaPipe, CityTypePipe, VideoSourcePipe, VideoTypePipe, LocationIconPipe, WeatherIconPipe,
|
||||
DirectionIconPipe, MeasurementTypePipe, MeasurementTypeIconPipe, OsIconPipe } from './pipes';
|
||||
|
||||
// TODO: Remove
|
||||
import { TestSiteComponent } from './test-site/test-site.component';
|
||||
|
||||
|
||||
/**
|
||||
* Computes the api domain from the browser location.
|
||||
@@ -120,8 +117,6 @@ registerLocaleData(LocaleDE);
|
||||
UseParentFormDirective,
|
||||
ClickButtonComponent,
|
||||
CodeDialogComponent,
|
||||
// TODO: Remove
|
||||
TestSiteComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule, BrowserAnimationsModule,
|
||||
|
||||
@@ -8,16 +8,12 @@ import { CityComponent, StateComponent, CountryComponent, CitiesComponent, Video
|
||||
StationsComponent, StationComponent } from './views-weather';
|
||||
import { UserDevicesComponent, UserAccountComponent, UserFavoritesComponent, UserDeviceComponent } from './views-user';
|
||||
import { ManageLogComponent, ManageSystemComponent, ManageUsersComponent } from './views-manage';
|
||||
import { CityResolver, StateResolver, CountryResolver, UserResolver, StationResolver, LanguageResolver,
|
||||
import { CityResolver, StateResolver, CountryResolver, UserResolver, StationResolver, LanguageResolver,
|
||||
BootstrapResolver,
|
||||
DeviceResolver} from './resolvers';
|
||||
|
||||
// TODO: Remove
|
||||
import { TestSiteComponent } from './test-site/test-site.component';
|
||||
|
||||
export const routes: Routes = [
|
||||
// TODO: Remove
|
||||
{ path: 'web-test', component: TestSiteComponent },
|
||||
// backwards compatibility
|
||||
{ path: 'activate/:token', resolve: { bs: BootstrapResolver}, component: LoadingComponent },
|
||||
{ path: 'reset/:token', resolve: { bs: BootstrapResolver}, component: LoadingComponent },
|
||||
|
||||
@@ -117,6 +117,7 @@ export class ResourceService {
|
||||
'label_yesterday' : 'Gestern',
|
||||
'label_today' : 'Heute',
|
||||
'label_tomorrow' : 'Morgen',
|
||||
|
||||
'city_code_dialog_title': 'Wettervorhersagen einbetten',
|
||||
'city_code_dialog_stylesheet': 'Das Stylesheet verlinken.',
|
||||
'city_code_dialog_scripts': 'Die Skripte einbetten.',
|
||||
@@ -125,6 +126,13 @@ export class ResourceService {
|
||||
'city_code_dialog_example': 'Beispiel',
|
||||
'city_code_dialog_default_lang': 'Standard: lang-code="de"',
|
||||
|
||||
'web_comp_err_title': 'Fehler',
|
||||
'web_comp_err_no_city_id': 'Das Attribut "city-id" darf nicht leer sein!',
|
||||
'web_comp_err_fetch_city': 'Dienst momentan nicht erreichbar! Stadt kann nicht abgerufen werden.',
|
||||
'web_comp_err_fetch_forecast': 'Dienst momentan nicht erreichbar! Wettervorhersage kann nicht abgerufen werden.',
|
||||
'web_comp_footer_computed': 'Vorhersage berechnet vom ',
|
||||
'web_comp_footer_provided': ' und bereitgestellt von ',
|
||||
|
||||
'station_title': 'Station',
|
||||
'station_latest_report' : 'Letzte Messung',
|
||||
|
||||
@@ -545,6 +553,7 @@ export class ResourceService {
|
||||
'label_yesterday' : 'Yesterday',
|
||||
'label_today' : 'Today',
|
||||
'label_tomorrow' : 'Tomorrow',
|
||||
|
||||
'city_code_dialog_title': 'Embed Weather Forecasts',
|
||||
'city_code_dialog_stylesheet': 'Link the stylesheet.',
|
||||
'city_code_dialog_scripts': 'Embed the scripts.',
|
||||
@@ -553,6 +562,13 @@ export class ResourceService {
|
||||
'city_code_dialog_example': 'Example',
|
||||
'city_code_dialog_default_lang': 'Default: lang-code="de"',
|
||||
|
||||
'web_comp_err_title': 'Error',
|
||||
'web_comp_err_no_city_id': 'The Attribute "city-id" must not be empty!',
|
||||
'web_comp_err_fetch_city': 'Service currently not available! Cannot fetch city data.',
|
||||
'web_comp_err_fetch_forecast': 'Service currently not available! Cannot fetch any forecast data.',
|
||||
'web_comp_footer_computed': 'Forecast computed by ',
|
||||
'web_comp_footer_provided': ' and provided by ',
|
||||
|
||||
'station_title': 'Station',
|
||||
'station_latest_report' : 'Latest Measurement',
|
||||
|
||||
|
||||
@@ -1,48 +1,49 @@
|
||||
<mat-card style="width: 300px;" *ngIf="hasCondition()" (click)="onClick()" class="clickable hov-accent mt-sm mb-sm">
|
||||
<mat-card style="width: 300px;" *ngIf="hasCondition()" (click)="onClick()" class="clickable hov-accent"
|
||||
[ngClass]="noMargin ? '' : 'mt-sm mb-sm'">
|
||||
<div class="fx-column">
|
||||
<div class="fx-row">
|
||||
<div class="fg-gray" style="font-size: 42px; width: 60px; height: 50px;" [matTooltip]="min.type | weather"><i [class]="min.type | weatherIcon"></i></div>
|
||||
<div class="ta-c" style="margin-right: 5px; font-size: 42px; width: 65px; height: 50px;" [matTooltip]="max.type | weather"><i [class]="max.type | weatherIcon"></i></div>
|
||||
<div class="fx-column fx-stretch" style="margin-top: 5px; margin-left: 5px;">
|
||||
<div>{{ displayTitle }}</div>
|
||||
<div>{{ displayTitle }}</div>
|
||||
<div>{{ displaySubtitle }} </div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fx-fill mb-sm fw-b ta-c" style="margin-top: 5px;">{{ max.type | weather }}</div>
|
||||
<div class="fx-row fx-fill">
|
||||
<div class="mr-sm" style="width: 40px; text-align: center;" [matTooltip]="res.strings('label_temperature')" matTooltipPosition="right"><i class="wi wi-thermometer"></i></div>
|
||||
<div class="fs-sm fx-fill ta-r fw-b">{{ min.temperature | temperature }}</div>
|
||||
<div class="fs-sm fx-fill ta-r fw-b">{{ max.temperature | temperature }}</div>
|
||||
<div class="fs-sm fx-fill ta-r fw-b">{{ min.temperature | temperature }}</div>
|
||||
<div class="fs-sm fx-fill ta-r fw-b">{{ max.temperature | temperature }}</div>
|
||||
</div>
|
||||
<div class="fx-row fx-fill">
|
||||
<div class="mr-sm" style="width: 40px; text-align: center;" [matTooltip]="res.strings('label_precipitation')" matTooltipPosition="right"><i class="wi wi-raindrops"></i></div>
|
||||
<div class="fs-sm fx-fill ta-r">{{ min.precipitation | precipitation }}</div>
|
||||
<div class="fs-sm fx-fill ta-r">{{ max.precipitation | precipitation }}</div>
|
||||
<div class="fs-sm fx-fill ta-r">{{ min.precipitation | precipitation }}</div>
|
||||
<div class="fs-sm fx-fill ta-r">{{ max.precipitation | precipitation }}</div>
|
||||
</div>
|
||||
<div class="fx-row fx-fill">
|
||||
<div class="mr-sm" style="width: 40px; text-align: center;" [matTooltip]="min.windDirection | direction" matTooltipPosition="right"><i [class]="max.windDirection | directionIcon"></i></div>
|
||||
<div class="fs-sm fx-fill ta-r" [matTooltip]="res.strings('label_wind_speed')" matTooltipPosition="right">{{ min.windSpeed | speed }}</div>
|
||||
<div class="fs-sm fx-fill ta-r" [matTooltip]="res.strings('label_wind_speed')" matTooltipPosition="right">{{ max.windSpeed | speed }}</div>
|
||||
<div class="fs-sm fx-fill ta-r" [matTooltip]="res.strings('label_wind_speed')" matTooltipPosition="right">{{ min.windSpeed | speed }}</div>
|
||||
<div class="fs-sm fx-fill ta-r" [matTooltip]="res.strings('label_wind_speed')" matTooltipPosition="right">{{ max.windSpeed | speed }}</div>
|
||||
</div>
|
||||
<div class="fx-row fx-fill">
|
||||
<div class="mr-sm" style="width: 40px; text-align: center;" [matTooltip]="res.strings('label_cloud_coverage')" matTooltipPosition="right"><i class="wi wi-cloud"></i></div>
|
||||
<div class="fs-sm fx-fill ta-r" >{{ min.cloudCoverage | cloud }}</div>
|
||||
<div class="fs-sm fx-fill ta-r" >{{ max.cloudCoverage | cloud }}</div>
|
||||
<div class="fs-sm fx-fill ta-r" >{{ min.cloudCoverage | cloud }}</div>
|
||||
<div class="fs-sm fx-fill ta-r" >{{ max.cloudCoverage | cloud }}</div>
|
||||
</div>
|
||||
<div class="fx-row fx-fill">
|
||||
<div class="mr-sm" style="width: 40px; text-align: center;" [matTooltip]="res.strings('label_humidity')" matTooltipPosition="right"><i class="wi wi-humidity"></i></div>
|
||||
<div class="fs-sm fx-fill ta-r" >{{ min.humidity | humidity }}</div>
|
||||
<div class="fs-sm fx-fill ta-r" >{{ max.humidity | humidity }}</div>
|
||||
<div class="fs-sm fx-fill ta-r" >{{ min.humidity | humidity }}</div>
|
||||
<div class="fs-sm fx-fill ta-r" >{{ max.humidity | humidity }}</div>
|
||||
</div>
|
||||
<div class="fx-row fx-fill">
|
||||
<div class="mr-sm" style="width: 40px; text-align: center;" [matTooltip]="res.strings('label_snow_depth')" matTooltipPosition="right"><i class="wi wi-snowflake-cold"></i></div>
|
||||
<div class="fs-sm fx-fill ta-r">{{ min.snowDepth | snow }}</div>
|
||||
<div class="fs-sm fx-fill ta-r">{{ max.snowDepth | snow }}</div>
|
||||
<div class="fs-sm fx-fill ta-r">{{ min.snowDepth | snow }}</div>
|
||||
<div class="fs-sm fx-fill ta-r">{{ max.snowDepth | snow }}</div>
|
||||
</div>
|
||||
<div class="fx-row fx-fill ">
|
||||
<div class="mr-sm" style="width: 40px; text-align: center;" [matTooltip]="res.strings('label_pressure')" matTooltipPosition="right"><i class="wi wi-barometer"></i></div>
|
||||
<div class="fs-sm fx-fill ta-r">{{ min.pressure | pressure }}</div>
|
||||
<div class="fs-sm fx-fill ta-r">{{ max.pressure | pressure }}</div>
|
||||
<div class="fs-sm fx-fill ta-r">{{ min.pressure | pressure }}</div>
|
||||
<div class="fs-sm fx-fill ta-r">{{ max.pressure | pressure }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card>
|
||||
|
||||
@@ -20,6 +20,7 @@ export class WeatherSummaryComponent implements OnInit, OnChanges {
|
||||
@Input() title: string;
|
||||
@Input() subtitle: string;
|
||||
@Input() clickHandler: () => void;
|
||||
@Input() noMargin: boolean;
|
||||
|
||||
min: WeatherCondition = null;
|
||||
max: WeatherCondition = null;
|
||||
|
||||
Reference in New Issue
Block a user