]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/sass/include/_miniature.scss
Redesign register steps
[github/Chocobozzz/PeerTube.git] / client / src / sass / include / _miniature.scss
index 13af0b936a84ce0d4f8f8bffd827192da523f07b..a1b963400796b85b8275491753939cafc6b73d31 100644 (file)
@@ -1,39 +1,39 @@
-@import '_variables';
-@import '_mixins';
+@use '_variables' as *;
+@use '_mixins' as *;
 
 @mixin miniature-name {
   @include ellipsis-multiline(1.1em, 2);
+  @include peertube-word-wrap(false);
 
   transition: color 0.2s;
   font-weight: $font-semibold;
-  color: var(--mainForegroundColor);
-  margin-top: 10px;
-  margin-bottom: 5px;
+  color: pvar(--mainForegroundColor);
 
   &:hover {
     text-decoration: none;
   }
 
   &.blur-filter {
+    @include padding-left(4px);
+
     filter: blur(3px);
-    padding-left: 4px;
   }
 }
 
-$play-overlay-transition: 0.2s ease;
-$play-overlay-height: 26px;
-$play-overlay-width: 18px;
-
 @mixin miniature-thumbnail {
+  $play-overlay-transition: 0.2s ease;
+  $play-overlay-height: 26px;
+  $play-overlay-width: 18px;
+
   @include disable-outline;
 
   display: flex;
   flex-direction: column;
   position: relative;
   border-radius: 3px;
+  width: 100%;
+  height: 100%;
   overflow: hidden;
-  width: $video-thumbnail-width;
-  height: $video-thumbnail-height;
   background-color: #ececec;
   transition: filter $play-overlay-transition;
 
@@ -45,25 +45,15 @@ $play-overlay-width: 18px;
     width: inherit;
     height: inherit;
     opacity: 0;
-    background-color: rgba(0, 0, 0, 0.7);
+    background-color: rgba(0, 0, 0, 0.3);
 
-    &, .icon {
+    &,
+    .icon {
       transition: all $play-overlay-transition;
     }
 
     .icon {
-      width: 0;
-      height: 0;
-
-      position: absolute;
-      left: 50%;
-      top: 50%;
-      transform: translate(-50%, -50%) scale(0.5);
-
-      border-top: ($play-overlay-height / 2) solid transparent;
-      border-bottom: ($play-overlay-height / 2) solid transparent;
-
-      border-left: $play-overlay-width solid rgba(255, 255, 255, 0.95);
+      @include play-icon($play-overlay-width, $play-overlay-height);
     }
   }
 
@@ -80,7 +70,8 @@ $play-overlay-width: 18px;
   }
 
   &.focus-visible {
-    box-shadow: 0 0 0 2px var(--mainColor);
+    box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
+    outline: none;
   }
 
   img {
@@ -88,14 +79,14 @@ $play-overlay-width: 18px;
     height: inherit;
 
     &.blur-filter {
-      filter: blur(5px);
-      transform : scale(1.03);
+      filter: blur(20px);
+      transform: scale(1.03);
     }
   }
 }
 
 @mixin thumbnail-size-component ($width, $height) {
-  /deep/ .video-thumbnail {
+  ::ng-deep .video-thumbnail {
     width: $width;
     height: $height;
   }
@@ -107,33 +98,64 @@ $play-overlay-width: 18px;
   color: #fff;
 }
 
-@mixin video-miniature-small-screen {
-  text-align: center;
+// Use margin by default, or padding if $margin is false
+@mixin grid-videos-miniature-margins ($margin: true, $min-margin: 0) {
+  --gridVideosMiniatureMargins: #{pvar(--videosHorizontalMarginContent)};
 
-  /deep/ .video-miniature {
-    padding-right: 0;
-    height: auto;
-    width: 100%;
-    margin-bottom: 20px;
+  @if $margin {
+    @include margin-left(var(--gridVideosMiniatureMargins) !important);
+    @include margin-right(var(--gridVideosMiniatureMargins) !important);
+  } @else {
+    @include padding-left(var(--gridVideosMiniatureMargins) !important);
+    @include padding-right(var(--gridVideosMiniatureMargins) !important);
+  }
 
-    .video-miniature-information {
-      width: 100% !important;
-      text-align: left;
+  @media screen and (max-width: $mobile-view) {
+    --gridVideosMiniatureMargins: #{$min-margin};
 
-      span {
+    width: auto;
+  }
+}
+
+@mixin grid-videos-miniature-layout {
+  @media screen and (min-width: $mobile-view) {
+    .videos,
+    .playlists {
+      --miniatureMinWidth: #{$video-thumbnail-width - 25px};
+      --miniatureMaxWidth: #{$video-thumbnail-width};
+
+      display: grid;
+      column-gap: 30px;
+      grid-template-columns: repeat(
+        auto-fill,
+        minmax(var(--miniatureMinWidth), 1fr)
+      );
+
+      .video-wrapper,
+      .playlist-wrapper {
+        margin: 0 auto;
         width: 100%;
+
+        my-video-miniature,
+        my-video-playlist-miniature {
+          display: block;
+          min-width: var(--miniatureMinWidth);
+          max-width: var(--miniatureMaxWidth);
+        }
       }
-    }
 
-    .video-thumbnail {
-      margin: 0 -15px 10px -15px;
-      width: 100vw;
-      height: calc(100vw / #{$video-thumbnail-ratio});
+      @media screen and (min-width: #{breakpoint(xm)}) {
+        column-gap: 15px;
+      }
 
-      img {
-        width: 100%;
-        height: 100%;
+      @media screen and (min-width: #{breakpoint(fhd)}) {
+        column-gap: 2%;
       }
     }
   }
 }
+
+@mixin grid-videos-miniature-layout-with-margins {
+  @include grid-videos-miniature-margins;
+  @include grid-videos-miniature-layout;
+}