From 0f7407d926cf7774f8f730dba08327569c11680c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 1 Apr 2021 11:10:27 +0200 Subject: Refactor video miniature Less dirty code, better responsive Prepare for some regressions Increase default miniature size --- .../recommended-videos.component.html | 4 +- .../recommended-videos.component.scss | 33 +++++++++ .../recommended-videos.component.ts | 2 + .../+video-watch/video-watch.component.html | 1 + .../+video-watch/video-watch.component.scss | 51 +++----------- .../+videos/+video-watch/video-watch.component.ts | 5 ++ .../overview/video-overview.component.html | 6 +- .../overview/video-overview.component.scss | 79 +++++++++++++++++++++- 8 files changed, 132 insertions(+), 49 deletions(-) (limited to 'client/src/app/+videos') diff --git a/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.html b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.html index 3c7c679b8..e0e9f92e7 100644 --- a/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.html +++ b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.html @@ -1,4 +1,4 @@ -
+

@@ -14,7 +14,7 @@ diff --git a/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.scss b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.scss index b278c9654..c9fae6f27 100644 --- a/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.scss +++ b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.scss @@ -1,3 +1,6 @@ +@import '_variables'; +@import '_mixins'; + .title-page-container { display: flex; justify-content: space-between; @@ -11,6 +14,10 @@ } } +.title-page { + margin-top: 0; +} + .title-page-autoplay { display: flex; width: max-content; @@ -29,3 +36,29 @@ hr { margin-top: 0; } + +my-video-miniature { + display: block; +} + +.other-videos:not(.display-as-row) my-video-miniature { + min-width: $video-thumbnail-medium-width; + max-width: $video-thumbnail-medium-width; +} + +.display-as-row { + my-video-miniature { + margin-bottom: 20px; + } + + hr { + display: none; + } + + @media screen and (max-width: $mobile-view) { + my-video-miniature { + margin-bottom: 10px; + } + } +} + diff --git a/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.ts b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.ts index a1c8e0661..89b9c01b6 100644 --- a/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.ts +++ b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.ts @@ -16,6 +16,8 @@ import { RecommendedVideosStore } from './recommended-videos.store' export class RecommendedVideosComponent implements OnInit, OnChanges { @Input() inputRecommendation: RecommendationInfo @Input() playlist: VideoPlaylist + @Input() displayAsRow: boolean + @Output() gotRecommendations = new EventEmitter() autoPlayNextVideo: boolean 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 07f7ab7e3..5d417609a 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.html +++ b/client/src/app/+videos/+video-watch/video-watch.component.html @@ -289,6 +289,7 @@

- +
@@ -25,7 +25,7 @@
- +
@@ -40,7 +40,7 @@
- +
diff --git a/client/src/app/+videos/video-list/overview/video-overview.component.scss b/client/src/app/+videos/video-list/overview/video-overview.component.scss index c1d10188a..ec73c628c 100644 --- a/client/src/app/+videos/video-list/overview/video-overview.component.scss +++ b/client/src/app/+videos/video-list/overview/video-overview.component.scss @@ -8,9 +8,84 @@ } .margin-content { - @include fluid-videos-miniature-layout; + @include grid-videos-miniature-layout; } .section { - @include miniature-rows; + &:first-child { + padding-top: 30px; + + .section-title { + border-top: none !important; + } + } + + .section-title { + font-size: 24px; + font-weight: $font-semibold; + padding-top: 15px; + margin-bottom: 15px; + display: flex; + justify-content: space-between; + + &:not(h2) { + border-top: 1px solid $separator-border-color; + } + + a { + &:hover, &:focus:not(.focus-visible), &:active { + text-decoration: none; + outline: none; + } + + color: pvar(--mainForegroundColor); + } + } + + &.channel { + .section-title { + a { + display: flex; + width: fit-content; + align-items: center; + + img { + @include channel-avatar(28px); + + margin-right: 8px; + } + } + + .followers { + color: pvar(--greyForegroundColor); + font-weight: normal; + font-size: 14px; + margin-left: 10px; + position: relative; + top: 2px; + } + } + } + + .show-more { + position: relative; + top: -5px; + display: inline-block; + font-size: 16px; + text-transform: uppercase; + color: pvar(--greyForegroundColor); + margin-bottom: 10px; + font-weight: $font-semibold; + text-decoration: none; + } + + @media screen and (max-width: $mobile-view) { + max-height: initial; + overflow: initial; + + .section-title { + font-size: 17px; + margin-left: 10px; + } + } } -- cgit v1.2.3