new movie component added and integrated

This commit is contained in:
Chneemann 2024-08-14 09:45:16 +02:00
parent 3545c0e718
commit 38e5456bca
6 changed files with 93 additions and 2 deletions

View file

@ -32,6 +32,14 @@
</div>
}
<div class="add-button">
<app-btn-small [imgPath]="'add'" (click)="addNewMovie()"></app-btn-small>
<app-btn-small
[imgPath]="'add'"
(click)="toggleNewMovieOverview(true)"
></app-btn-small>
</div>
</section>
@if (newMovieOverview) {
<app-new-movie
(toggleNewMovieOverview)="toggleNewMovieOverview($event)"
></app-new-movie>
}

View file

@ -9,6 +9,7 @@ import { CommonModule } from '@angular/common';
import { VideoPlayerComponent } from './vjs-player/vjs-player.component';
import { BtnLargeComponent } from '../../../shared/components/buttons/btn-large/btn-large.component';
import { BtnSmallComponent } from '../../../shared/components/buttons/btn-small/btn-small.component';
import { NewMovieComponent } from './new-movie/new-movie.component';
@Component({
selector: 'app-browse',
@ -20,6 +21,7 @@ import { BtnSmallComponent } from '../../../shared/components/buttons/btn-small/
CategoriesComponent,
VideoPlayerComponent,
BtnSmallComponent,
NewMovieComponent,
],
templateUrl: './browse.component.html',
styleUrl: './browse.component.scss',
@ -34,6 +36,7 @@ export class BrowseComponent implements OnInit {
currentMovie: any[] = [];
playMovie: string = '';
newMovieOverview: boolean = false;
async ngOnInit() {
await this.loadAllMovies();
@ -65,5 +68,7 @@ export class BrowseComponent implements OnInit {
}
}
addNewMovie() {}
toggleNewMovieOverview(value: any) {
this.newMovieOverview = value;
}
}

View file

@ -0,0 +1,5 @@
<div class="overlay" (click)="newMovieOverview()">
<div class="overlay-content" (click)="stopPropagation($event)">
<p>new-movie works!</p>
</div>
</div>

View file

@ -0,0 +1,30 @@
@import "./../../../../../assets/style/colors.scss";
// Overlay
.overlay {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100vw;
height: 100vh;
backdrop-filter: blur(2px);
background-color: rgba($black, 0.3);
display: flex;
justify-content: center;
align-items: center;
z-index: 999;
}
.overlay-mobile {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100vw;
height: 100vh;
z-index: 999;
}

View file

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NewMovieComponent } from './new-movie.component';
describe('NewMovieComponent', () => {
let component: NewMovieComponent;
let fixture: ComponentFixture<NewMovieComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [NewMovieComponent]
})
.compileComponents();
fixture = TestBed.createComponent(NewMovieComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,20 @@
import { Component, EventEmitter, Output } from '@angular/core';
@Component({
selector: 'app-new-movie',
standalone: true,
imports: [],
templateUrl: './new-movie.component.html',
styleUrl: './new-movie.component.scss',
})
export class NewMovieComponent {
@Output() toggleNewMovieOverview = new EventEmitter<boolean>();
stopPropagation(event: MouseEvent) {
event.stopPropagation();
}
newMovieOverview() {
this.toggleNewMovieOverview.emit(false);
}
}