|
|
@ -1,5 +1,5 @@
|
|
|
|
import { PlatformLocation } from "@angular/common";
|
|
|
|
import { PlatformLocation } from "@angular/common";
|
|
|
|
import { Component, OnInit } from "@angular/core";
|
|
|
|
import { Component, OnDestroy, OnInit } from "@angular/core";
|
|
|
|
|
|
|
|
|
|
|
|
import { IMediaServerStatus } from "../interfaces";
|
|
|
|
import { IMediaServerStatus } from "../interfaces";
|
|
|
|
import { ICustomizationSettings, ILandingPageSettings } from "../interfaces";
|
|
|
|
import { ICustomizationSettings, ILandingPageSettings } from "../interfaces";
|
|
|
@ -9,17 +9,21 @@ import { SettingsService } from "../services";
|
|
|
|
import { DomSanitizer } from "@angular/platform-browser";
|
|
|
|
import { DomSanitizer } from "@angular/platform-browser";
|
|
|
|
import { ImageService } from "../services";
|
|
|
|
import { ImageService } from "../services";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { fadeInOutAnimation } from "../animations/fadeinout";
|
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
@Component({
|
|
|
|
templateUrl: "./landingpage.component.html",
|
|
|
|
templateUrl: "./landingpage.component.html",
|
|
|
|
|
|
|
|
animations: [fadeInOutAnimation],
|
|
|
|
styleUrls: ["./landingpage.component.scss"],
|
|
|
|
styleUrls: ["./landingpage.component.scss"],
|
|
|
|
})
|
|
|
|
})
|
|
|
|
export class LandingPageComponent implements OnInit {
|
|
|
|
export class LandingPageComponent implements OnDestroy, OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
public customizationSettings: ICustomizationSettings;
|
|
|
|
public customizationSettings: ICustomizationSettings;
|
|
|
|
public landingPageSettings: ILandingPageSettings;
|
|
|
|
public landingPageSettings: ILandingPageSettings;
|
|
|
|
public background: any;
|
|
|
|
public background: any;
|
|
|
|
public mediaServerStatus: IMediaServerStatus;
|
|
|
|
public mediaServerStatus: IMediaServerStatus;
|
|
|
|
public baseUrl: string;
|
|
|
|
public baseUrl: string;
|
|
|
|
|
|
|
|
private timer: any;
|
|
|
|
|
|
|
|
|
|
|
|
constructor(private settingsService: SettingsService,
|
|
|
|
constructor(private settingsService: SettingsService,
|
|
|
|
private images: ImageService, private sanitizer: DomSanitizer, private landingPageService: LandingPageService,
|
|
|
|
private images: ImageService, private sanitizer: DomSanitizer, private landingPageService: LandingPageService,
|
|
|
@ -31,6 +35,9 @@ export class LandingPageComponent implements OnInit {
|
|
|
|
this.images.getRandomBackground().subscribe(x => {
|
|
|
|
this.images.getRandomBackground().subscribe(x => {
|
|
|
|
this.background = this.sanitizer.bypassSecurityTrustStyle("linear-gradient(-10deg, transparent 20%, rgba(0,0,0,0.7) 20.0%, rgba(0,0,0,0.7) 80.0%, transparent 80%), url(" + x.url + ")");
|
|
|
|
this.background = this.sanitizer.bypassSecurityTrustStyle("linear-gradient(-10deg, transparent 20%, rgba(0,0,0,0.7) 20.0%, rgba(0,0,0,0.7) 80.0%, transparent 80%), url(" + x.url + ")");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
this.timer = setInterval(() => {
|
|
|
|
|
|
|
|
this.cycleBackground();
|
|
|
|
|
|
|
|
}, 10000);
|
|
|
|
|
|
|
|
|
|
|
|
const base = this.location.getBaseHrefFromDOM();
|
|
|
|
const base = this.location.getBaseHrefFromDOM();
|
|
|
|
if (base.length > 1) {
|
|
|
|
if (base.length > 1) {
|
|
|
@ -41,4 +48,18 @@ export class LandingPageComponent implements OnInit {
|
|
|
|
this.mediaServerStatus = x;
|
|
|
|
this.mediaServerStatus = x;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ngOnDestroy() {
|
|
|
|
|
|
|
|
clearInterval(this.timer);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public cycleBackground() {
|
|
|
|
|
|
|
|
this.images.getRandomBackground().subscribe(x => {
|
|
|
|
|
|
|
|
this.background = "";
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.images.getRandomBackground().subscribe(x => {
|
|
|
|
|
|
|
|
this.background = this.sanitizer
|
|
|
|
|
|
|
|
.bypassSecurityTrustStyle("linear-gradient(-10deg, transparent 20%, rgba(0,0,0,0.7) 20.0%, rgba(0,0,0,0.7) 80.0%, transparent 80%), url(" + x.url + ")");
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|