]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/video/video-thumbnail.component.scss
`fitWidth` for `video-miniature`, fluid grid (#2830)
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video / video-thumbnail.component.scss
index e57baba5cb0aa706a2a52d7b94551a059d76ffdf..feff78a87899b71b966bd48e2f8144e5714df482 100644 (file)
@@ -1,90 +1,74 @@
 @import '_variables';
 @import '_mixins';
-
-$play-overlay-transition: 0.2s ease;
-$play-overlay-height: 26px;
-$play-overlay-width: 18px;
+@import '_miniature';
 
 .video-thumbnail {
-  @include disable-outline;
-
-  display: inline-block;
-  position: relative;
-  border-radius: 3px;
-  overflow: hidden;
-  width: $video-thumbnail-width;
-  height: $video-thumbnail-height;
-  background-color: #ececec;
-  transition: filter $play-overlay-transition;
-
-  &:hover {
-    text-decoration: none !important;
+  @include miniature-thumbnail;
 
-    filter: brightness(85%);
-
-    .play-overlay {
-      opacity: 1;
+  .progress-bar {
+    height: 3px;
+    width: 100%;
+    position: absolute;
+    bottom: 0;
+    background-color: rgba(0, 0, 0, 0.20);
 
-      transform: translate(-50%, -50%) scale(1);
+    div {
+      height: 100%;
+      background-color: pvar(--mainColor);
     }
   }
 
-  &.focus-visible {
-    box-shadow: 0 0 0 2px var(--mainColor);
+  .video-thumbnail-watch-later-overlay,
+  .video-thumbnail-label-overlay,
+  .video-thumbnail-duration-overlay {
+    @include static-thumbnail-overlay;
+
+    border-radius: 3px;
+    font-size: 12px;
+    font-weight: $font-semibold;
+    line-height: 1.2;
+    z-index: z(miniature);
   }
 
-  img {
-    width: $video-thumbnail-width;
-    height: $video-thumbnail-height;
+  .video-thumbnail-label-overlay {
+    position: absolute;
+    padding: 0 5px;
+    left: 5px;
+    top: 5px;
+    font-weight: $font-bold;
 
-    &.blur-filter {
-      filter: blur(5px);
-      transform : scale(1.03);
-    }
+    &.warning { background-color: orange; }
+    &.danger { background-color: red; }
   }
 
-  .play-overlay {
-    width: 0;
-    height: 0;
-
+  .video-thumbnail-duration-overlay {
     position: absolute;
-    left: 50%;
-    top: 50%;
-    transform: translate(-50%, -50%) scale(0.5);
-
-    transition: all $play-overlay-transition;
+    padding: 0 3px;
+    right: 5px;
+    bottom: 5px;
+  }
 
-    border-top: calc(#{$play-overlay-height} / 2) solid transparent;
-    border-bottom: calc(#{$play-overlay-height} / 2) solid transparent;
+  .video-thumbnail-actions-overlay {
+    position: absolute;
+    display: flex;
+    flex-direction: column;
+    right: 5px;
+    top: 5px;
+    opacity: 0;
 
-    border-left: $play-overlay-width solid rgba(255, 255, 255, 0.95);
+    div:not(:first-child) {
+      margin-top: 2px;
+    }
 
-    opacity: 0;
-  }
+    .video-thumbnail-watch-later-overlay {
+      padding: 3px;
 
-  .progress-bar {
-    height: 3px;
-    width: 100%;
-    position: relative;
-    top: -3px;
-    background-color: rgba(0, 0, 0, 0.20);
+      my-global-icon {
+        width: 22px;
+        height: 22px;
 
-    div {
-      height: 100%;
-      background-color: var(--mainColor);
+        @include apply-svg-color(#fff);
+      }
     }
   }
-
-  .video-thumbnail-overlay {
-    position: absolute;
-    right: 5px;
-    bottom: 5px;
-    display: inline-block;
-    background-color: rgba(0, 0, 0, 0.7);
-    color: #fff;
-    font-size: 12px;
-    font-weight: $font-bold;
-    border-radius: 3px;
-    padding: 0 5px;
-  }
 }