update responsive design

This commit is contained in:
Chneemann 2024-08-22 23:57:52 +02:00
parent 442be2d692
commit 3475c61bf3
4 changed files with 25 additions and 4 deletions

View file

@ -1,13 +1,17 @@
<section> <section>
@if (currentMovie[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 [browse]="true"></app-header>
@if (this.checkScreenWidth()) {
<app-hero-banner <app-hero-banner
[currentMovie]="currentMovie" [currentMovie]="currentMovie"
(playMovie)="playVideo($event)" (playMovie)="playVideo($event)"
(movieIsUploadedChange)="onMovieIsUploadedChange($event)" (movieIsUploadedChange)="onMovieIsUploadedChange($event)"
></app-hero-banner> ></app-hero-banner>
} @else {
<div class="spacer"></div>
}
<app-categories <app-categories
[movies]="movies" [movies]="movies"
[currentMovie]="currentMovie[0]?.id" [currentMovie]="currentMovie[0]?.id"

View file

@ -45,6 +45,10 @@ section {
transition: opacity 300ms ease-in-out; transition: opacity 300ms ease-in-out;
} }
.spacer {
margin-top: 120px;
}
.add-button { .add-button {
position: absolute; position: absolute;
bottom: 24px; bottom: 24px;
@ -134,6 +138,8 @@ section {
transform: scale(1); transform: scale(1);
} }
/*------------- RESPONSIVE -------------*/
@media screen and (max-width: 550px) { @media screen and (max-width: 550px) {
form { form {
flex-direction: column; flex-direction: column;
@ -151,8 +157,6 @@ section {
} }
} }
/*------------- RESPONSIVE -------------*/
@media screen and (max-width: 500px) { @media screen and (max-width: 500px) {
.resolution-btn { .resolution-btn {
border-radius: 2px; border-radius: 2px;

View file

@ -37,6 +37,7 @@ export class BrowseComponent implements OnInit {
movies: any[] = []; movies: any[] = [];
currentMovie: any[] = []; currentMovie: any[] = [];
playMovie: string = ''; playMovie: string = '';
isWideScreen: boolean = false;
uploadMovieOverview: boolean = false; uploadMovieOverview: boolean = false;
currentResolution: '480p' | '720p' | '1080p' = '720p'; currentResolution: '480p' | '720p' | '1080p' = '720p';
movieIsUploaded: { [resolution: string]: boolean } = { movieIsUploaded: { [resolution: string]: boolean } = {
@ -52,7 +53,13 @@ export class BrowseComponent implements OnInit {
async ngOnInit() { async ngOnInit() {
await this.loadAllMovies(); await this.loadAllMovies();
this.currentMovie.length === 0 ? this.loadRandomMovie() : null; if (this.checkScreenWidth()) {
this.currentMovie.length === 0 ? this.loadRandomMovie() : null;
}
}
checkScreenWidth() {
return (this.isWideScreen = window.innerWidth > 600);
} }
onMovieIsUploadedChange(newStatus: { [resolution: string]: boolean }) { onMovieIsUploadedChange(newStatus: { [resolution: string]: boolean }) {

View file

@ -112,6 +112,12 @@ section {
/*------------- RESPONSIVE -------------*/ /*------------- RESPONSIVE -------------*/
@media screen and (max-width: 600px) {
.hide-scrollbar {
height: calc(100% - 120px);
}
}
@media screen and (max-width: 400px) { @media screen and (max-width: 400px) {
.category { .category {
p { p {