From cf78883c70dca99fc519374d55620d9403d482be Mon Sep 17 00:00:00 2001
From: Chocobozzz <me@florianbigard.com>
Date: Thu, 11 Jun 2020 14:33:33 +0200
Subject: Limit thumbnail sizes

---
 client/src/sass/include/_bootstrap-variables.scss |   2 +-
 client/src/sass/include/_miniature.scss           | 123 +++++++++++-----------
 client/src/sass/include/_variables.scss           |   1 -
 3 files changed, 63 insertions(+), 63 deletions(-)

(limited to 'client/src/sass')

diff --git a/client/src/sass/include/_bootstrap-variables.scss b/client/src/sass/include/_bootstrap-variables.scss
index 09c58a697..41a1448c4 100644
--- a/client/src/sass/include/_bootstrap-variables.scss
+++ b/client/src/sass/include/_bootstrap-variables.scss
@@ -18,7 +18,7 @@ $grid-breakpoints: (
   xxl: 1600px,
 
   // SCREEN GROUP
-  fhd: 1920px,
+  fhd: 1800px,
   qhd: 2560px,
   uhd: 3840px
 );
diff --git a/client/src/sass/include/_miniature.scss b/client/src/sass/include/_miniature.scss
index d89d6f9ff..d79086723 100644
--- a/client/src/sass/include/_miniature.scss
+++ b/client/src/sass/include/_miniature.scss
@@ -108,38 +108,6 @@ $play-overlay-width: 18px;
   color: #fff;
 }
 
-@mixin video-miniature-small-screen {
-  text-align: center;
-
-  ::ng-deep .video-miniature {
-    padding-right: 0;
-    height: auto;
-    width: 100%;
-    margin-bottom: 20px;
-
-    .video-miniature-information {
-      width: 100% !important;
-      text-align: left;
-
-      span {
-        width: 100%;
-      }
-    }
-
-    .video-thumbnail {
-      margin-bottom: 10px;
-      width: 100%;
-      height: calc(100% / #{$video-thumbnail-ratio});
-      border-radius: 0;
-
-      img {
-        width: 100%;
-        height: 100%;
-      }
-    }
-  }
-}
-
 @mixin miniature-rows {
   &:first-child {
     padding-top: 30px;
@@ -149,10 +117,6 @@ $play-overlay-width: 18px;
     }
   }
 
-  my-video-miniature {
-    text-align: left;
-  }
-
   .section-title {
     font-size: 24px;
     font-weight: $font-semibold;
@@ -213,44 +177,81 @@ $play-overlay-width: 18px;
     max-height: initial;
     overflow: initial;
 
-    @include video-miniature-small-screen;
-
     .section-title {
       font-size: 17px;
+      margin-left: 10px;
     }
   }
 }
 
-@mixin adapt-margin-content-width($fluid: false) {
-  @if $fluid {
-    margin-left: 3vw !important;
-    margin-right: 3vw !important;
-  } @else {
-    width: $video-miniature-width * 6;
-    margin: auto !important;
+@mixin fluid-videos-miniature-layout {
+  margin-left: 3vw !important;
+  margin-right: 3vw !important;
 
-    @media screen and (max-width: 1800px) {
-      width: $video-miniature-width * 5;
-    }
+  @media screen and (max-width: $mobile-view) {
+    width: auto;
+    margin: 0 !important;
 
-    @media screen and (max-width: 1800px - $video-miniature-width) {
-      width: $video-miniature-width * 4;
-    }
+    .videos {
+      text-align: center;
 
-    @media screen and (max-width: 1800px - (2* $video-miniature-width)) {
-      width: $video-miniature-width * 3;
-    }
+      ::ng-deep .video-miniature {
+        padding-right: 0;
+        height: auto;
+        width: 100%;
+        margin-bottom: 25px;
 
-    @media screen and (max-width: 1800px - (3* $video-miniature-width)) {
-      width: $video-miniature-width * 2;
+        .video-miniature-information {
+          width: 100% !important;
+          text-align: left;
+
+          span {
+            width: 100%;
+          }
+        }
+
+        .video-thumbnail {
+          border-radius: 0;
+        }
+      }
     }
+  }
+
+  @media screen and (min-width: #{breakpoint(fhd)}) {
+    margin-left: 6vw !important;
+    margin-right: 6vw !important;
+  }
 
-    @media screen and (max-width: $mobile-view) {
-      width: auto;
-      margin: 0 !important;
+  @media screen and (min-width: $mobile-view) {
+
+    .videos {
+      --miniature-min-width: #{$video-thumbnail-width - 15px};
+      --miniature-max-width: #{$video-thumbnail-width};
+
+      display: grid;
+      column-gap: 5px;
+      grid-template-columns: repeat(
+        auto-fill,
+        minmax(
+          var(--miniature-min-width),
+          1fr
+        )
+      );
+
+      @media screen and (min-width: #{breakpoint(fhd)}) {
+        column-gap: 1%;
+        --miniature-min-width: #{$video-thumbnail-width};
+      }
+
+      .video-wrapper {
+        margin: 0 auto;
+        width: 100%;
 
-      .videos {
-        @include video-miniature-small-screen;
+        my-video-miniature {
+          display: block;
+          min-width: var(--miniature-min-width);
+          max-width: var(--miniature-max-width);
+        }
       }
     }
   }
diff --git a/client/src/sass/include/_variables.scss b/client/src/sass/include/_variables.scss
index 14f1ae76c..56b1ff884 100644
--- a/client/src/sass/include/_variables.scss
+++ b/client/src/sass/include/_variables.scss
@@ -59,7 +59,6 @@ $video-miniature-width: 238px;
 $video-miniature-margin-bottom: 30px;
 $video-thumbnail-height: 122px;
 $video-thumbnail-width: 223px;
-$video-thumbnail-ratio: $video-thumbnail-width / $video-thumbnail-height;
 
 $theater-bottom-space: 115px;
 
-- 
cgit v1.2.3