import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { AssetPreloaderService } from '../../assetPreloaderService';

@Component({
	selector: 'app-splash',
	templateUrl: './splash.component.html',
	styleUrls: ['./splash.component.css'],
})
export class SplashComponent {
	show: boolean = true;
    assetPreloader: AssetPreloaderService = new AssetPreloaderService();
    progress: number = 0;

	constructor(private router: Router) {
        this.assetPreloader.progress$.subscribe(p => this.progress = p);
        this.assetPreloader.preload().then(() => this.router.navigate(['/menu']));
	}
}
