customized functions for the back button
This commit is contained in:
parent
349b578a3d
commit
5e39c3d035
7 changed files with 31 additions and 11 deletions
|
|
@ -2,7 +2,10 @@
|
||||||
@if (movies.length > 0) {
|
@if (movies.length > 0) {
|
||||||
<!-- If at least one film has been uploaded -->
|
<!-- If at least one film has been uploaded -->
|
||||||
@if (playMovie === "") {
|
@if (playMovie === "") {
|
||||||
<app-header [browse]="true"></app-header>
|
<app-header
|
||||||
|
(moviesChange)="onMoviesChange($event)"
|
||||||
|
[browse]="true"
|
||||||
|
></app-header>
|
||||||
<!-- Hero Banner -->
|
<!-- Hero Banner -->
|
||||||
<app-hero-banner
|
<app-hero-banner
|
||||||
*ngIf="
|
*ngIf="
|
||||||
|
|
@ -13,6 +16,7 @@
|
||||||
[currentMovie]="currentMovie"
|
[currentMovie]="currentMovie"
|
||||||
(playMovie)="playVideo($event)"
|
(playMovie)="playVideo($event)"
|
||||||
(movieIsUploadedChange)="onMovieIsUploadedChange($event)"
|
(movieIsUploadedChange)="onMovieIsUploadedChange($event)"
|
||||||
|
(moviesChange)="onMoviesChange($event)"
|
||||||
></app-hero-banner>
|
></app-hero-banner>
|
||||||
<!-- Spacer -->
|
<!-- Spacer -->
|
||||||
<div *ngIf="!this.checkScreenWidth()" class="spacer"></div>
|
<div *ngIf="!this.checkScreenWidth()" class="spacer"></div>
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ section {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 24px 48px;
|
padding: 24px 48px;
|
||||||
background: rgba(0, 0, 0, 0.5);
|
background: rgba($black, 0.5);
|
||||||
z-index: 1001;
|
z-index: 1001;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: opacity 300ms ease-in-out;
|
transition: opacity 300ms ease-in-out;
|
||||||
|
|
@ -140,6 +140,12 @@ section {
|
||||||
|
|
||||||
/*------------- RESPONSIVE -------------*/
|
/*------------- RESPONSIVE -------------*/
|
||||||
|
|
||||||
|
@media screen and (max-width: 600px) {
|
||||||
|
.video-header {
|
||||||
|
padding: 12px 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 550px) {
|
@media screen and (max-width: 550px) {
|
||||||
form {
|
form {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,14 @@ export class BrowseComponent implements OnInit {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMoviesChange(updatedMovies: any[]) {
|
||||||
|
if (this.checkScreenWidth()) {
|
||||||
|
this.loadRandomMovie();
|
||||||
|
} else {
|
||||||
|
this.currentMovie = updatedMovies;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
checkScreenWidth() {
|
checkScreenWidth() {
|
||||||
return (this.isWideScreen = window.innerWidth > 600);
|
return (this.isWideScreen = window.innerWidth > 600);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
*ngIf="!screenWidth"
|
*ngIf="!screenWidth"
|
||||||
[imgPath]="'back'"
|
[imgPath]="'back'"
|
||||||
[imgRadius]="'24px'"
|
[imgRadius]="'24px'"
|
||||||
(click)="backToCategory()"
|
(click)="backToCategory([])"
|
||||||
></app-btn-small>
|
></app-btn-small>
|
||||||
<app-btn-large
|
<app-btn-large
|
||||||
[value]="'Play'"
|
[value]="'Play'"
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ export class HeroBannerComponent {
|
||||||
@Output() movieIsUploadedChange = new EventEmitter<{
|
@Output() movieIsUploadedChange = new EventEmitter<{
|
||||||
[resolution: string]: boolean;
|
[resolution: string]: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
@Output() moviesChange = new EventEmitter<any[]>();
|
||||||
|
|
||||||
environmentBaseUrl: string = environment.baseUrl;
|
environmentBaseUrl: string = environment.baseUrl;
|
||||||
movieIsUploaded: { [resolution: string]: boolean } = {
|
movieIsUploaded: { [resolution: string]: boolean } = {
|
||||||
|
|
@ -57,11 +58,11 @@ export class HeroBannerComponent {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
backToCategory(newMovies: any[]) {
|
||||||
|
this.moviesChange.emit(newMovies);
|
||||||
|
}
|
||||||
|
|
||||||
playMovieId(videoPath: string) {
|
playMovieId(videoPath: string) {
|
||||||
this.playMovie.emit(videoPath);
|
this.playMovie.emit(videoPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
backToCategory() {
|
|
||||||
window.location.href = '/browse/';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<header>
|
<header>
|
||||||
@if (browse) {
|
@if (browse) {
|
||||||
<div class="logo" (click)="reloadPage()">
|
<div class="logo" (click)="backToOverview([])">
|
||||||
<img src="./../../../../assets/img/logo_ci.svg" alt="" />
|
<img src="./../../../../assets/img/logo_ci.svg" alt="" />
|
||||||
</div>
|
</div>
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||||
import { BtnLargeComponent } from '../buttons/btn-large/btn-large.component';
|
import { BtnLargeComponent } from '../buttons/btn-large/btn-large.component';
|
||||||
import { Router, RouterLink } from '@angular/router';
|
import { Router, RouterLink } from '@angular/router';
|
||||||
|
|
||||||
|
|
@ -11,11 +11,12 @@ import { Router, RouterLink } from '@angular/router';
|
||||||
})
|
})
|
||||||
export class HeaderComponent {
|
export class HeaderComponent {
|
||||||
@Input() browse: boolean = false;
|
@Input() browse: boolean = false;
|
||||||
|
@Output() moviesChange = new EventEmitter<any[]>();
|
||||||
|
|
||||||
constructor(private router: Router) {}
|
constructor(private router: Router) {}
|
||||||
|
|
||||||
reloadPage() {
|
backToOverview(newMovies: any[]) {
|
||||||
window.location.href = '/browse/';
|
this.moviesChange.emit(newMovies);
|
||||||
}
|
}
|
||||||
|
|
||||||
logout() {
|
logout() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue