aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video/video-thumbnail.component.scss
blob: b9fd9182f08f256ec79bbe7c235798ccbd34938d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
@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;
  overflow: hidden;
  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);
    }
  }

  &.focus-visible {
    box-shadow: 0 0 0 2px var(--mainColor);
  }

  img {
    width: $video-thumbnail-width;
    height: $video-thumbnail-height;

    &.blur-filter {
      filter: blur(5px);
      transform : scale(1.03);
    }
  }

  .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: ($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);

    opacity: 0;
  }

  .progress-bar {
    height: 3px;
    width: 100%;
    position: relative;
    top: -3px;
    background-color: rgba(0, 0, 0, 0.20);

    div {
      height: 100%;
      background-color: var(--mainColor);
    }
  }

  .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;
  }
}