]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+videos/+video-watch/video-watch.component.scss
Relax watch CSS
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-watch / video-watch.component.scss
1 @use 'sass:math';
2 @use '_variables' as *;
3 @use '_mixins' as *;
4 @use '_bootstrap-variables';
5 @use '_miniature' as *;
6
7 $video-height: 66vh;
8
9 @function getPlayerHeight ($width) {
10 @return calc(#{$width} / #{$video-watch-player-factor});
11 }
12
13 @function getPlayerWidth ($height) {
14 @return calc(#{$height} * #{$video-watch-player-factor});
15 }
16
17 @mixin playlist-below-player {
18 width: 100% !important;
19 height: auto !important;
20 max-height: 300px !important;
21 max-width: initial;
22 border-bottom: 1px solid $separator-border-color !important;
23 }
24
25 .blocked-label {
26 font-weight: $font-semibold;
27 }
28
29 .placeholder-image {
30 height: 100%;
31 }
32
33 .alert {
34 text-align: center;
35 border-radius: 0;
36 }
37
38 .flex-direction-column {
39 flex-direction: column;
40 }
41
42 .root {
43 &.theater-enabled #video-wrapper {
44 $height: calc(100vh - #{$header-height} - #{$theater-bottom-space});
45
46 flex-direction: column;
47 justify-content: center;
48
49 #videojs-wrapper {
50 width: 100%;
51 height: $height;
52 }
53
54 ::ng-deep .video-js {
55 height: $height;
56 width: 100%;
57 max-width: initial;
58 }
59
60 my-video-watch-playlist ::ng-deep .playlist {
61 @include playlist-below-player;
62 }
63 }
64 }
65
66 #video-wrapper {
67 background-color: #000;
68 display: flex;
69 justify-content: center;
70
71 ::ng-deep .video-js {
72 width: 100%;
73 max-width: getPlayerWidth($video-height);
74 height: $video-height;
75
76 // VideoJS create an inner video player
77 video {
78 outline: 0;
79 position: relative !important;
80 }
81 }
82 }
83
84 #videojs-wrapper {
85 display: flex;
86 justify-content: center;
87 flex-grow: 1;
88 height: $video-height;
89 }
90
91 .remote-server-down {
92 color: #fff;
93 display: flex;
94 flex-direction: column;
95 align-items: center;
96 text-align: center;
97 justify-content: center;
98 background-color: #141313;
99 width: 100%;
100 font-size: 24px;
101 height: 500px;
102
103 @media screen and (max-width: 1000px) {
104 font-size: 20px;
105 }
106
107 @media screen and (max-width: 600px) {
108 font-size: 16px;
109 }
110 }
111
112 #video-not-found {
113 height: 300px;
114 line-height: 300px;
115 margin-top: 50px;
116 text-align: center;
117 font-weight: $font-semibold;
118 font-size: 15px;
119 }
120
121 .video-bottom {
122 display: flex;
123 margin-top: 1.5rem;
124 }
125
126 .video-info {
127 flex-grow: 1;
128 // Set min width for flex item
129 min-width: 1px;
130 max-width: 100%;
131 }
132
133 .video-info-first-row {
134 display: flex;
135
136 > div:first-child {
137 flex-grow: 1;
138 }
139 }
140
141 .video-info-name {
142 @include peertube-word-wrap;
143
144 @include margin-right(30px);
145
146 min-height: 40px; // Align with the action buttons
147 font-size: 27px;
148 font-weight: $font-semibold;
149 flex-grow: 1;
150 }
151
152 .video-info-first-row-bottom {
153 display: flex;
154 flex-wrap: wrap;
155 align-items: center;
156 width: 100%;
157 }
158
159 .video-info-date-views {
160 @include margin-right(10px);
161
162 margin-bottom: 10px;
163 align-self: start;
164 font-size: 1em;
165 }
166
167 .video-info-channel {
168 font-weight: $font-semibold;
169 font-size: 15px;
170
171 a {
172 @include disable-default-a-behaviour;
173 @include peertube-word-wrap;
174
175 color: pvar(--mainForegroundColor);
176
177 &:hover {
178 opacity: 0.8;
179 }
180 }
181 }
182
183 .video-info-channel-left {
184 flex-grow: 1;
185
186 .video-info-channel-left-links {
187 display: flex;
188 flex-direction: column;
189 position: relative;
190 line-height: 1.37;
191
192 a:nth-of-type(2) {
193 font-weight: $font-regular;
194 font-size: 90%;
195 }
196
197 a.single-link {
198 margin-top: 7px;
199 }
200 }
201 }
202
203 my-subscribe-button {
204 @include margin-left(5px);
205 }
206
207 .video-attributes {
208 @include margin-left($video-watch-info-margin-left);
209
210 .video-attribute {
211 font-size: 13px;
212 display: block;
213 margin-bottom: 12px;
214 }
215 }
216
217 .video-attribute-label {
218 @include padding-right(5px);
219
220 min-width: 142px;
221 display: inline-block;
222 color: pvar(--greyForegroundColor);
223 font-weight: $font-bold;
224 }
225
226 a.video-attribute-value {
227 @include disable-default-a-behaviour;
228 color: pvar(--mainForegroundColor);
229
230 &:hover {
231 opacity: 0.9;
232 }
233 }
234
235 .video-attribute-tags {
236 .video-attribute-value:not(:nth-child(2)) {
237 &::before {
238 content: ', ';
239 }
240 }
241 }
242
243 my-action-buttons {
244 @include margin-left(auto);
245 @include margin-right(0);
246
247 display: block;
248 margin-top: 0;
249 margin-bottom: 10px;
250
251 align-items: start;
252 width: max-content;
253 }
254
255 my-recommended-videos {
256 @include padding-left(15px);
257
258 display: block;
259 min-width: 250px;
260 }
261
262 my-video-comments {
263 display: inline-block;
264 width: 100%;
265 margin-bottom: 20px;
266 }
267
268 @media screen and (max-width: 1600px) {
269 .video-attributes .video-attribute {
270 margin-bottom: 5px;
271 }
272 }
273
274 // Use the same breakpoint than in the typescript component to display the other video miniatures as row
275 @media screen and (max-width: 1100px) {
276 #video-wrapper {
277 flex-direction: column;
278 justify-content: center;
279
280 my-video-watch-playlist ::ng-deep .playlist {
281 @include playlist-below-player;
282 }
283 }
284
285 .video-bottom {
286 flex-direction: column;
287 }
288
289 my-recommended-videos {
290 @include padding-left(0);
291 }
292 }
293
294 @media screen and (max-width: 600px) {
295 #videojs-wrapper {
296 height: getPlayerHeight(100vw) !important;
297
298 .remote-server-down,
299 ::ng-deep .video-js {
300 width: 100vw;
301 height: getPlayerHeight(100vw) !important;
302 }
303 }
304
305 .video-bottom {
306 margin-top: 20px !important;
307 padding-bottom: 20px !important;
308 }
309
310 .video-info {
311 padding: 0;
312 }
313
314 .video-info-name {
315 font-size: 20px;
316 height: auto;
317 }
318 }
319
320 @media screen and (max-width: 450px) {
321 .video-info-name {
322 font-size: 18px;
323 }
324
325 .video-info-date-views {
326 font-size: 14px;
327 }
328
329 my-action-buttons {
330 margin-top: 10px;
331 }
332 }
333
334 // Special case for iOS, that takes into account the width for fullscreens
335 #video-wrapper ::ng-deep .video-js.vjs-fullscreen {
336 max-width: unset;
337 }