]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/sass/include/_miniature.scss
Fix actor overflows
[github/Chocobozzz/PeerTube.git] / client / src / sass / include / _miniature.scss
index 1e9e8d7499595fb88b166db75d1d426ec361d957..3b86f29b4fcc59657624e2e77e4f20c7eac5be94 100644 (file)
@@ -2,14 +2,13 @@
 @import '_mixins';
 
 @mixin miniature-name {
-  @include ellipsis-multiline(16px, 2);
+  @include ellipsis-multiline(1.1em, 2);
 
+  word-break: break-all;
+  word-wrap: break-word;
   transition: color 0.2s;
-  font-size: 16px;
   font-weight: $font-semibold;
-  color: var(--mainForegroundColor);
-  margin-top: 5px;
-  margin-bottom: 5px;
+  color: pvar(--mainForegroundColor);
 
   &:hover {
     text-decoration: none;
   }
 }
 
-$play-overlay-transition: 0.2s ease;
-$play-overlay-height: 26px;
-$play-overlay-width: 18px;
-
 @mixin miniature-thumbnail {
   @include disable-outline;
 
-  display: inline-block;
+  $play-overlay-transition: 0.2s ease;
+  $play-overlay-height: 26px;
+  $play-overlay-width: 18px;
+
+  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,14 @@ $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 {
       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 +69,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 +78,14 @@ $play-overlay-width: 18px;
     height: inherit;
 
     &.blur-filter {
-      filter: blur(5px);
+      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,32 +97,63 @@ $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)};
+
+  @if $margin {
+    margin-left: var(--gridVideosMiniatureMargins) !important;
+    margin-right: var(--gridVideosMiniatureMargins) !important;
+  } @else {
+    padding-left: var(--gridVideosMiniatureMargins) !important;
+    padding-right: var(--gridVideosMiniatureMargins) !important;
+  }
 
-  /deep/ .video-miniature {
-    padding-right: 0;
-    height: auto;
-    width: 100%;
-    margin-bottom: 20px;
+  @media screen and (max-width: $mobile-view) {
+    --gridVideosMiniatureMargins: #{$min-margin};
 
-    .video-miniature-information {
-      width: 100% !important;
-      text-align: left;
+    width: auto;
+  }
+}
 
-      span {
+@mixin grid-videos-miniature-layout {
+  @include grid-videos-miniature-margins;
+
+  @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 {
-      width: calc(100% + 30px);
-      height: auto;
-      margin: 0 -15px;
+      @media screen and (min-width: #{breakpoint(xm)}) {
+        column-gap: 15px;
+      }
 
-      img {
-        width: 100%;
-        height: auto;
+      @media screen and (min-width: #{breakpoint(fhd)}) {
+        column-gap: 2%;
       }
     }
   }