From db5814c0472d2b9e8f0ca6bdd1175ff1cd99ed7c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 14 Apr 2021 10:38:09 +0200 Subject: Move player style in watch component --- .../app/+videos/+video-watch/player-styles.component.scss | 4 ++++ .../app/+videos/+video-watch/player-styles.component.ts | 14 ++++++++++++++ .../app/+videos/+video-watch/video-watch.component.html | 2 ++ client/src/app/+videos/+video-watch/video-watch.module.ts | 4 +++- client/src/app/app.component.scss | 6 ++---- 5 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 client/src/app/+videos/+video-watch/player-styles.component.scss create mode 100644 client/src/app/+videos/+video-watch/player-styles.component.ts (limited to 'client/src/app') diff --git a/client/src/app/+videos/+video-watch/player-styles.component.scss b/client/src/app/+videos/+video-watch/player-styles.component.scss new file mode 100644 index 000000000..7f1442a59 --- /dev/null +++ b/client/src/app/+videos/+video-watch/player-styles.component.scss @@ -0,0 +1,4 @@ +@import 'node_modules/video.js/dist/video-js'; + +$assets-path: '../../assets/'; +@import '../../../sass/player/index'; diff --git a/client/src/app/+videos/+video-watch/player-styles.component.ts b/client/src/app/+videos/+video-watch/player-styles.component.ts new file mode 100644 index 000000000..c02630979 --- /dev/null +++ b/client/src/app/+videos/+video-watch/player-styles.component.ts @@ -0,0 +1,14 @@ +import { Component, ViewEncapsulation } from '@angular/core' + +/* +* Allows to lazy load global player styles in the watch component +*/ + +@Component({ + selector: 'my-player-styles', + template: '', + styleUrls: [ './player-styles.component.scss' ], + encapsulation: ViewEncapsulation.None +}) +export class PlayerStylesComponent { +} diff --git a/client/src/app/+videos/+video-watch/video-watch.component.html b/client/src/app/+videos/+video-watch/video-watch.component.html index 6ede109fd..eadb2148a 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.html +++ b/client/src/app/+videos/+video-watch/video-watch.component.html @@ -319,3 +319,5 @@ + + diff --git a/client/src/app/+videos/+video-watch/video-watch.module.ts b/client/src/app/+videos/+video-watch/video-watch.module.ts index 3e9f3822e..29ad92f00 100644 --- a/client/src/app/+videos/+video-watch/video-watch.module.ts +++ b/client/src/app/+videos/+video-watch/video-watch.module.ts @@ -14,6 +14,7 @@ import { VideoCommentService } from '../../shared/shared-video-comment/video-com import { VideoCommentAddComponent } from './comment/video-comment-add.component' import { VideoCommentComponent } from './comment/video-comment.component' import { VideoCommentsComponent } from './comment/video-comments.component' +import { PlayerStylesComponent } from './player-styles.component' import { RecommendationsModule } from './recommendations/recommendations.module' import { TimestampRouteTransformerDirective } from './timestamp-route-transformer.directive' import { VideoAvatarChannelComponent } from './video-avatar-channel.component' @@ -50,7 +51,8 @@ import { VideoWatchComponent } from './video-watch.component' VideoAvatarChannelComponent, TimestampRouteTransformerDirective, - TimestampRouteTransformerDirective + + PlayerStylesComponent ], exports: [ diff --git a/client/src/app/app.component.scss b/client/src/app/app.component.scss index 42293e412..7e9e4a216 100644 --- a/client/src/app/app.component.scss +++ b/client/src/app/app.component.scss @@ -3,8 +3,6 @@ @import '~bootstrap/scss/functions'; @import '~bootstrap/scss/variables'; -$assets-path: '../assets'; - .peertube-container { padding-bottom: 20px; } @@ -41,9 +39,9 @@ $assets-path: '../assets'; &.icon-menu { background-color: pvar(--mainForegroundColor); - mask-image: url('#{$assets-path}/images/misc/menu.svg'); + mask-image: url('../assets/images/misc/menu.svg'); margin: 0 18px 0 20px; - + @media screen and (max-width: $mobile-view) { margin: 0 10px; } -- cgit v1.2.3