]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/sass/include/_miniature.scss
Merge branch 'release/3.4.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / sass / include / _miniature.scss
CommitLineData
8cbc40b2
C
1@use '_variables' as *;
2@use '_mixins' as *;
830b4faf
C
3
4@mixin miniature-name {
8fc02e47 5 @include ellipsis-multiline(1.1em, 2);
06ec4bdd 6 @include peertube-word-wrap(false);
0c9945d9 7
830b4faf 8 transition: color 0.2s;
830b4faf 9 font-weight: $font-semibold;
e66883b3 10 color: pvar(--mainForegroundColor);
830b4faf
C
11
12 &:hover {
13 text-decoration: none;
14 }
15
16 &.blur-filter {
27bc9586
C
17 @include padding-left(4px);
18
830b4faf 19 filter: blur(3px);
830b4faf
C
20 }
21}
22
e2f01c47 23@mixin miniature-thumbnail {
0f7407d9
C
24 $play-overlay-transition: 0.2s ease;
25 $play-overlay-height: 26px;
26 $play-overlay-width: 18px;
27
931d3430
C
28 @include disable-outline;
29
8fc02e47
C
30 display: flex;
31 flex-direction: column;
830b4faf
C
32 position: relative;
33 border-radius: 3px;
0f7407d9
C
34 width: 100%;
35 height: 100%;
830b4faf 36 overflow: hidden;
830b4faf
C
37 background-color: #ececec;
38 transition: filter $play-overlay-transition;
39
40 .play-overlay {
41 position: absolute;
42 right: 0;
43 bottom: 0;
44
c5a1ae50
C
45 width: inherit;
46 height: inherit;
830b4faf 47 opacity: 0;
41f8f620 48 background-color: rgba(0, 0, 0, 0.3);
830b4faf 49
931d3430
C
50 &,
51 .icon {
830b4faf
C
52 transition: all $play-overlay-transition;
53 }
54
55 .icon {
3efa3f4d 56 @include play-icon($play-overlay-width, $play-overlay-height);
830b4faf
C
57 }
58 }
59
60 &:hover {
61 text-decoration: none !important;
62
63 .play-overlay {
64 opacity: 1;
65
66 .icon {
67 transform: translate(-50%, -50%) scale(1);
68 }
69 }
70 }
71
72 &.focus-visible {
e66883b3 73 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
6a4c30de 74 outline: none;
830b4faf
C
75 }
76
77 img {
c5a1ae50
C
78 width: inherit;
79 height: inherit;
830b4faf
C
80
81 &.blur-filter {
1b8a8905 82 filter: blur(20px);
931d3430 83 transform: scale(1.03);
830b4faf
C
84 }
85 }
86}
87
e2f01c47 88@mixin thumbnail-size-component ($width, $height) {
03652b31 89 ::ng-deep .video-thumbnail {
e2f01c47
C
90 width: $width;
91 height: $height;
92 }
93}
94
830b4faf
C
95@mixin static-thumbnail-overlay {
96 display: inline-block;
97 background-color: rgba(0, 0, 0, 0.7);
98 color: #fff;
99}
100
900f7820 101// Use margin by default, or padding if $margin is false
0f7407d9
C
102@mixin grid-videos-miniature-margins ($margin: true, $min-margin: 0) {
103 --gridVideosMiniatureMargins: #{pvar(--videosHorizontalMarginContent)};
d7941370 104
900f7820 105 @if $margin {
27bc9586
C
106 @include margin-left(var(--gridVideosMiniatureMargins) !important);
107 @include margin-right(var(--gridVideosMiniatureMargins) !important);
900f7820 108 } @else {
27bc9586
C
109 @include padding-left(var(--gridVideosMiniatureMargins) !important);
110 @include padding-right(var(--gridVideosMiniatureMargins) !important);
900f7820 111 }
c8487f3f 112
cf78883c 113 @media screen and (max-width: $mobile-view) {
0f7407d9 114 --gridVideosMiniatureMargins: #{$min-margin};
c8487f3f 115
d7941370 116 width: auto;
900f7820
C
117 }
118}
119
0f7407d9 120@mixin grid-videos-miniature-layout {
cf78883c 121 @media screen and (min-width: $mobile-view) {
0f7407d9
C
122 .videos,
123 .playlists {
124 --miniatureMinWidth: #{$video-thumbnail-width - 25px};
33253c1a 125 --miniatureMaxWidth: #{$video-thumbnail-width};
cf78883c
C
126
127 display: grid;
0f7407d9 128 column-gap: 30px;
cf78883c
C
129 grid-template-columns: repeat(
130 auto-fill,
931d3430 131 minmax(var(--miniatureMinWidth), 1fr)
cf78883c
C
132 );
133
0f7407d9
C
134 .video-wrapper,
135 .playlist-wrapper {
cf78883c
C
136 margin: 0 auto;
137 width: 100%;
c8487f3f 138
0f7407d9
C
139 my-video-miniature,
140 my-video-playlist-miniature {
cf78883c 141 display: block;
33253c1a
C
142 min-width: var(--miniatureMinWidth);
143 max-width: var(--miniatureMaxWidth);
cf78883c 144 }
e66883b3 145 }
0f7407d9
C
146
147 @media screen and (min-width: #{breakpoint(xm)}) {
148 column-gap: 15px;
149 }
150
151 @media screen and (min-width: #{breakpoint(fhd)}) {
152 column-gap: 2%;
153 }
154 }
155 }
c8487f3f 156}
5d6395af
C
157
158@mixin grid-videos-miniature-layout-with-margins {
159 @include grid-videos-miniature-margins;
160 @include grid-videos-miniature-layout;
161}