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