Add hover effect on video miniature
authorChocobozzz <me@florianbigard.com>
Wed, 20 Feb 2019 13:56:18 +0000 (14:56 +0100)
committerChocobozzz <me@florianbigard.com>
Wed, 20 Feb 2019 13:56:18 +0000 (14:56 +0100)
client/src/app/shared/video/video-thumbnail.component.html
client/src/app/shared/video/video-thumbnail.component.scss
client/src/app/videos/video-list/video-trending.component.ts

index d256669165b09778baf7a96196ba7c047f627c0a..a15df725ef7970f79a01c029b0a62c75a963ac76 100644 (file)
@@ -6,6 +6,8 @@
 
   <div class="video-thumbnail-overlay">{{ video.durationLabel }}</div>
 
+  <div class="play-overlay"></div>
+
   <div class="progress-bar" *ngIf="video.userHistory?.currentTime">
     <div [ngStyle]="{ 'width.%': getProgressPercent() }"></div>
   </div>
index 97a0e72ed7a1d926f2d75575ba0a8860bd228eda..e57baba5cb0aa706a2a52d7b94551a059d76ffdf 100644 (file)
@@ -1,7 +1,13 @@
 @import '_variables';
 @import '_mixins';
 
+$play-overlay-transition: 0.2s ease;
+$play-overlay-height: 26px;
+$play-overlay-width: 18px;
+
 .video-thumbnail {
+  @include disable-outline;
+
   display: inline-block;
   position: relative;
   border-radius: 3px;
   width: $video-thumbnail-width;
   height: $video-thumbnail-height;
   background-color: #ececec;
+  transition: filter $play-overlay-transition;
 
   &:hover {
     text-decoration: none !important;
+
+    filter: brightness(85%);
+
+    .play-overlay {
+      opacity: 1;
+
+      transform: translate(-50%, -50%) scale(1);
+    }
   }
 
-  @include disable-outline;
   &.focus-visible {
     box-shadow: 0 0 0 2px var(--mainColor);
   }
     }
   }
 
+  .play-overlay {
+    width: 0;
+    height: 0;
+
+    position: absolute;
+    left: 50%;
+    top: 50%;
+    transform: translate(-50%, -50%) scale(0.5);
+
+    transition: all $play-overlay-transition;
+
+    border-top: calc(#{$play-overlay-height} / 2) solid transparent;
+    border-bottom: calc(#{$play-overlay-height} / 2) solid transparent;
+
+    border-left: $play-overlay-width solid rgba(255, 255, 255, 0.95);
+
+    opacity: 0;
+  }
+
   .progress-bar {
     height: 3px;
     width: 100%;
index 6fd74e67a8e35f0e0bd930a6174429e68bf39553..a66a0f97c28d6b98d8f364f87b8fdcbb0300b4a4 100644 (file)
@@ -45,11 +45,11 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit,
 
         if (trendingDays === 1) {
           this.titlePage = this.i18n('Trending for the last 24 hours')
-          this.titleTooltip = this.i18n('Trending videos are those totalizing the greatest number of views during the last 24 hours.')
+          this.titleTooltip = this.i18n('Trending videos are those totalizing the greatest number of views during the last 24 hours')
         } else {
           this.titlePage = this.i18n('Trending for the last {{days}} days', { days: trendingDays })
           this.titleTooltip = this.i18n(
-            'Trending videos are those totalizing the greatest number of views during the last {{days}} days.',
+            'Trending videos are those totalizing the greatest number of views during the last {{days}} days',
             { days: trendingDays }
           )
         }