]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/sass/include/_miniature.scss
Resume videos for non-logged in users (#3885)
[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);
0c9945d9 6
830b4faf 7 transition: color 0.2s;
830b4faf 8 font-weight: $font-semibold;
e66883b3 9 color: pvar(--mainForegroundColor);
8fc02e47 10 margin-top: 10px;
830b4faf
C
11 margin-bottom: 5px;
12
13 &:hover {
14 text-decoration: none;
15 }
16
17 &.blur-filter {
18 filter: blur(3px);
19 padding-left: 4px;
20 }
21}
22
23$play-overlay-transition: 0.2s ease;
24$play-overlay-height: 26px;
25$play-overlay-width: 18px;
26
e2f01c47 27@mixin miniature-thumbnail {
830b4faf
C
28 @include disable-outline;
29
8fc02e47
C
30 display: flex;
31 flex-direction: column;
830b4faf
C
32 position: relative;
33 border-radius: 3px;
34 overflow: hidden;
e2f01c47
C
35 width: $video-thumbnail-width;
36 height: $video-thumbnail-height;
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
C
49
50 &, .icon {
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);
830b4faf
C
82 transform : scale(1.03);
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
c8487f3f 100@mixin miniature-rows {
c8487f3f
C
101 &:first-child {
102 padding-top: 30px;
dc890263
C
103
104 .section-title {
105 border-top: none !important;
106 }
c8487f3f
C
107 }
108
c8487f3f
C
109 .section-title {
110 font-size: 24px;
111 font-weight: $font-semibold;
dc890263
C
112 padding-top: 15px;
113 margin-bottom: 15px;
bc01017b
C
114 display: flex;
115 justify-content: space-between;
c9e3565d
CC
116
117 &:not(h2) {
118 border-top: 1px solid $separator-border-color;
119 }
c8487f3f
C
120
121 a {
122 &:hover, &:focus:not(.focus-visible), &:active {
123 text-decoration: none;
124 outline: none;
125 }
126
e66883b3 127 color: pvar(--mainForegroundColor);
c8487f3f
C
128 }
129 }
130
131 &.channel {
132 .section-title {
133 a {
134 display: flex;
135 width: fit-content;
136 align-items: center;
137
138 img {
deb8b9cd 139 @include channel-avatar(28px);
c8487f3f
C
140
141 margin-right: 8px;
142 }
143 }
144
145 .followers {
e66883b3 146 color: pvar(--greyForegroundColor);
c8487f3f
C
147 font-weight: normal;
148 font-size: 14px;
149 margin-left: 10px;
150 position: relative;
151 top: 2px;
152 }
153 }
154 }
155
dc890263
C
156 .show-more {
157 position: relative;
158 top: -5px;
159 display: inline-block;
160 font-size: 16px;
161 text-transform: uppercase;
e66883b3 162 color: pvar(--greyForegroundColor);
dc890263
C
163 margin-bottom: 10px;
164 font-weight: $font-semibold;
25266908 165 text-decoration: none;
dc890263
C
166 }
167
c8487f3f
C
168 @media screen and (max-width: $mobile-view) {
169 max-height: initial;
170 overflow: initial;
171
c8487f3f
C
172 .section-title {
173 font-size: 17px;
cf78883c 174 margin-left: 10px;
c8487f3f
C
175 }
176 }
177}
178
900f7820
C
179// Use margin by default, or padding if $margin is false
180@mixin fluid-videos-miniature-margins ($margin: true, $min-margin: 0) {
d7941370
C
181 --fluidVideosMiniatureMargins: #{pvar(--horizontalMarginContent)};
182
900f7820 183 @if $margin {
d7941370
C
184 margin-left: var(--fluidVideosMiniatureMargins) !important;
185 margin-right: var(--fluidVideosMiniatureMargins) !important;
900f7820 186 } @else {
d7941370
C
187 padding-left: var(--fluidVideosMiniatureMargins) !important;
188 padding-right: var(--fluidVideosMiniatureMargins) !important;
900f7820 189 }
c8487f3f 190
cf78883c 191 @media screen and (max-width: $mobile-view) {
d7941370 192 --fluidVideosMiniatureMargins: $min-margin;
c8487f3f 193
d7941370 194 width: auto;
900f7820
C
195 }
196}
197
198@mixin fluid-videos-miniature-layout {
199 @include fluid-videos-miniature-margins;
200
201 @media screen and (max-width: $mobile-view) {
cf78883c
C
202 .videos {
203 text-align: center;
c8487f3f 204
cf78883c
C
205 ::ng-deep .video-miniature {
206 padding-right: 0;
207 height: auto;
208 width: 100%;
209 margin-bottom: 25px;
c8487f3f 210
cf78883c
C
211 .video-miniature-information {
212 width: 100% !important;
213 text-align: left;
214
215 span {
216 width: 100%;
217 }
218 }
219
220 .video-thumbnail {
221 border-radius: 0;
222 }
223 }
e66883b3 224 }
cf78883c
C
225 }
226
cf78883c 227 @media screen and (min-width: $mobile-view) {
cf78883c
C
228 .videos {
229 --miniature-min-width: #{$video-thumbnail-width - 15px};
230 --miniature-max-width: #{$video-thumbnail-width};
231
232 display: grid;
233 column-gap: 5px;
234 grid-template-columns: repeat(
235 auto-fill,
236 minmax(
237 var(--miniature-min-width),
238 1fr
239 )
240 );
241
242 @media screen and (min-width: #{breakpoint(fhd)}) {
243 column-gap: 1%;
244 --miniature-min-width: #{$video-thumbnail-width};
245 }
246
247 .video-wrapper {
248 margin: 0 auto;
249 width: 100%;
c8487f3f 250
cf78883c
C
251 my-video-miniature {
252 display: block;
253 min-width: var(--miniature-min-width);
254 max-width: var(--miniature-max-width);
255 }
e66883b3 256 }
c8487f3f
C
257 }
258 }
259}