This repository was archived by the owner on Apr 28, 2024. It is now read-only.
forked from ibillingsley/userstyles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyoutube-full-theater.user.css
executable file
·371 lines (337 loc) · 11.4 KB
/
youtube-full-theater.user.css
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
/* ==UserStyle==
@name YouTube Full Theater
@namespace github.com/ibillingsley
@version 1.1.0
@description Full screen theatre mode for YouTube
@author Isaiah Billingsley
@homepageURL https://github.com/ibillingsley/userstyles
@license 0BSD
==/UserStyle== */
@-moz-document url-prefix("https://www.youtube.com/watch") {
html, [light] {
/* Add transparency to top bar, sidebar (#contentContainer.tp-yt-app-drawer) background */
--yt-spec-base-background: #fffc;
/* Add transparency to menu background */
--yt-spec-menu-background: var(--yt-spec-base-background);
/* Add transparency to search results background */
--yt-spec-raised-background: var(--yt-spec-base-background);
--ytd-searchbox-background: hsl( 0 0 100% / 50% );
}
html[dark], [dark] {
/* Add transparency to top bar, sidebar (#contentContainer.tp-yt-app-drawer) background */
--yt-spec-base-background: #0f0f0fcc;
/* Add transparency to menu background */
--yt-spec-menu-background: #282828cc;
--yt-spec-menu-background: var(--yt-spec-base-background);
/* Add transparency to search results background */
--yt-spec-raised-background: #212121cc;
--yt-spec-raised-background: var(--yt-spec-base-background);
--ytd-searchbox-background: hsl( 0 0 7% / 50% );
}
#guide-content.ytd-app,
ytd-simple-menu-header-renderer {
background: unset;
}
/* Overlay when sidebar is open */
#scrim.tp-yt-app-drawer {
/* Fade video less */
--app-drawer-scrim-background: rgb(0 0 0 / 20%);
}
/* Player occupies full screen height */
#player.skeleton.theater,
.ytd-page-manager[theater]:not([fullscreen]) #player-wide-container,
.ytd-page-manager[theater]:not([fullscreen]) #player-theater-container,
.ytd-page-manager[theater]:not([fullscreen]) #full-bleed-container {
max-height: 100vh;
min-height: 100vh;
}
/* Top bar hiding with fade-out and visibility */
#masthead[fullscreen],
#masthead[theater] {
--fadeout-duration: 700ms;
--fadeout-delay: 500ms;
/* Fade in-out and enable/disable visibility (clickable). */
transition:
opacity var(--fadeout-duration) ease-out,
visibility var(--fadeout-duration);
transition-delay:
var(--fadeout-delay),
var(--fadeout-delay);
}
/* Theater mode top bar is hidden by default */
#masthead[theater]:not([fullscreen]) {
opacity: 0;
}
/* Show top bar when dropdown is open */
ytd-app:has( ytd-popup-container tp-yt-iron-dropdown:not([style~="display:"]) ),
/* Show top bar when title is hovered or focused */
#content:has( .ytp-chrome-top:is(:hover, :focus-within) ),
/* Show top bar when hovered or focused */
#masthead-container:is(:hover, :focus-within) {
/* #masthead[theater]:not([fullscreen]):is(:focus-within, :hover) { */
#masthead[theater]:not([fullscreen]) {
opacity: 1;
/* Fade in faster */
transition-duration: 100ms, 100ms;
transition-delay: 0s, 0s;
}
}
/* Fullscreen top bar is hidden when scrolled to top and not focused */
ytd-app[masthead-hidden] #masthead[fullscreen]:not(:focus-within) {
/* Fade out */
opacity: 0;
/* Make top bar unclickable. Delayed until after fade out is finished. */
visibility: hidden;
}
/* Fullscreen top bar fades out instead of sliding off-screen */
ytd-app[masthead-hidden] #masthead-container.ytd-app {
/* Disable sliding off-screen */
transform: unset;
opacity: unset;
transition: unset;
}
/* Top bar background */
#masthead #background {
/* Smooth out weird transparency jump when scrolled to top */
transition: opacity 700ms ease-out;
/* Blur the top bar's bottom edge */
box-shadow: 0px -6px 8px 8px var(--yt-spec-base-background);
}
/* Add transparency to the searchbox when not focused */
#container.ytd-searchbox:not(:focus-within) {
opacity: 80%;
}
/* Hide empty iframe showing a scrollbar when search is focused */
body:has( #container.ytd-searchbox:focus-within ) iframe.sbdd_c {
display: none;
}
/** Top bar responsive CSS **/
/* Header */
#masthead #background {
height: 100%;
}
/* Logo */
ytd-logo.ytd-topbar-logo-renderer {
display: block;
}
yt-icon.ytd-logo {
padding-block: 0;
height: 100%;
}
#country-code.ytd-topbar-logo-renderer {
margin-top: -6px;
}
#skip-navigation.ytd-masthead:focus-within {
top: calc( 50% - 18px );
}
/* Search */
#center.ytd-masthead {
/* height: 40px; */
height: var(--height--search);
}
ytd-searchbox.ytd-masthead,
#search-form.ytd-searchbox,
#voice-search-button {
height: 100%;
}
/* Magnifying glass icon */
#search-icon-legacy.ytd-searchbox {
height: 100%;
width: unset;
aspect-ratio: 64 / 40;
}
/* Mic button */
ytd-button-renderer.ytd-masthead,
ytd-button-renderer.ytd-masthead > yt-button-shape {
height: 100%;
}
.yt-spec-button-shape-next--overlay.yt-spec-button-shape-next--text {
height: 100%;
width: unset;
aspect-ratio: 1;
}
/* Top bar is thinner */
#container.ytd-masthead {
height: 44px;
/* --height--search: calc( 100% - 2 * 8px ); */
--height--search: 34px;
}
/* Top bar is thicker in basic mode */
#masthead:not( [theater], [fullscreen] ) {
/* Header */
#container.ytd-masthead {
}
}
/* Search suggestions popup was off-screen */
.gstl_50.sbdd_a {
/* Fix miscalculated position when scrolled down */
top: 52px !important;
/* Theater mode has thinner searchbox */
body:has( #masthead:is( [theater], [fullscreen] ) ) & {
top: 40px !important;
}
}
/* Replace player top margin with #masthead-container */
#masthead-container.ytd-app {
/* Occupy the necessary space for #masthead in default mode */
position: sticky;
}
/* Collapse #masthead-container in fullscreen and theater mode: there's no space above player */
#masthead[fullscreen],
#masthead[theater] {
position: fixed;
}
/* Remove top margin */
#page-manager.ytd-app {
margin-top: 0;
}
/* Move buttons in top-right corner below the top bar in theater mode */
.ytd-page-manager[theater]:not([fullscreen]) .ytp-overflow-panel-close,
.ytd-page-manager[theater]:not([fullscreen]) .ytp-chrome-top {
padding-top: 50px; /* masthead is 56px, buttons have 6px padding */
height: unset;
}
/* Move endscreen video grid below the title */
.ytd-page-manager[theater]:not([fullscreen]) .ytp-endscreen-content {
top: calc(50% + 50px);
}
/** Show video title and buttons in theater mode, hide when playing video - also in fullscreen **/
/* Video title gradient shadow is only as high as the title instead of darkening the top 1/3 of the video */
.ytp-chrome-top {
/* background-image: linear-gradient(to top, rgb(0 0 0 / 0%), rgb(0 0 0 / 40%) 40px, rgb(0 0 0 / 70%) 100%); */
/* background-image: linear-gradient(to top, rgb(0 0 0 / 0%), rgb(0 0 0 / 25%) 40px, rgb(0 0 0 / 50%) 100%); */
padding-bottom: 30px;
left: 0 !important;
width: 100% !important;
}
.ytp-chrome-top > * {
margin-inline: 12px;
}
.ytp-gradient-top {
display: none;
}
/* Vertically align title and buttons */
.ytp-chrome-top {
align-items: center;
}
/* Vertically align title and buttons */
.ytp-chrome-top > * {
/* Substitute for button padding-top: 6px + button height was: 36px, changed to: 24px, (36-24px)/2 = 6px */
margin-top: 12px;
}
.ytp-big-mode .ytp-chrome-top > * {
/* Substitute for .ytp-big-mode .ytp-title-text padding-top: 18px */
margin-top: 18px;
}
/* Remove empty space above-below icons, height similar to .ytp-title-text */
.ytp-chrome-top-buttons {
height: 24px;
display: flex;
align-items: center;
}
.ytp-chrome-top .ytp-button {
padding-top: unset;
}
/* Video title text shadow for legibility on light background */
.ytp-title,
.ytp-title-text {
overflow: visible;
}
.ytp-title-text.ytp-title-text {
/* Override .ytp-big-mode .ytp-title-text with precendence */
color: white;
text-shadow: 2px 2px 4px black;
padding: 0px 10px;
display: inline-block;
}
.ytp-title-link {
display: inline;
}
/* Buttons also have shadow */
.ytp-chrome-top-buttons .ytp-button {
filter: drop-shadow(1px 1px 2px #000a);
}
/* Video title and buttons highlighted with background and shadow */
/* .ytp-chrome-top-buttons, */
.ytp-title-text {
--bgcolor: rgb(0 0 0 / 20%);
--size--blur: 15px;
box-shadow: 0 0 var(--size--blur) var(--size--blur) var(--bgcolor);
background-color: var(--bgcolor);
border-radius: var(--size--blur);
}
/* Watch later button's positioning was inconsistent with other buttons */
.html5-video-player:not(.ytp-big-mode) .ytp-chrome-top .ytp-watch-later-button {
min-width: unset;
}
/* Video title and buttons fade in-out */
.ytp-chrome-top {
/* transition: opacity 100ms; */
/* transition: opacity 100ms cubic-bezier(.4,0,1,1); */ /* original */
/* transition-timing-function: ease; */
/* transition-timing-function: ease-in-out; */
}
/* Delay fade-in for a few seconds after paused, so a short pause won't create distraction. No delay when hovered. */
.paused-mode .ytp-chrome-top:not(:hover) {
transition-delay: 1s;
transition-duration: 500ms;
}
/* Short transition when hovered */
#movie_player.ytp-chrome-top:hover {
transition-delay: 0s;
/* transition-duration: 100ms; */
}
/* Hide video title and buttons when playing and not hovered or focused */
/* [full-bleed-player] === :is([theater], [fullscreen]) */
.ytd-page-manager[full-bleed-player] .playing-mode:not(.unstarted-mode) .ytp-chrome-top:not(:hover):not(:focus-within) {
opacity: 0;
/* No fade-out delay when hiding */
transition-delay: 0s;
}
/* Show video title and buttons when search is focused */
#masthead-container:is(:hover, :focus-within) ~ #page-manager .ytp-chrome-top {
opacity: 1;
}
/* Disable hiding of player top buttons and disable fade-out on inactivity */
/* .ytp-autohide: playing and mouse didn't move for 3 seconds) */
#movie_player {
.ytp-title-channel,
.ytp-title,
.ytp-chrome-top .ytp-button {
opacity: unset;
-webkit-transition: unset;
transition: unset;
}
}
/* Show title in theater mode: disable .ytp-hide-info-bar (active when not fullscreen) */
/* and .ytp-autohide (active when paused or for 3 seconds after mouse activity). */
/* Note: .ytp-autohide-active is added (increases precedence) for < 1s while fading out. */
.ytp-cards-button,
.ytp-playlist-menu-button,
.ytp-back-button,
/* .ytp-title-channel, */
.ytp-title {
/* #movie_player for precedence */
.ytd-page-manager[full-bleed-player] #movie_player & {
display: unset;
}
}
/* Buttons will be visible in default and theater modes too */
.ytp-watch-later-button,
/* .ytp-cards-button:not([title=null]), */
.ytp-copylink-button-visible,
.ytp-overflow-button-visible {
/* Hidden with style attribute at the end of the video, therefore the !important */
display: unset !important;
}
/* Hide share and search button (visible on fullscreen). Search button seems to be unused. */
.ytp-search-button,
.ytp-share-button-visible {
display: none !important;
}
/* Disable hiding of video title and buttons in default and theater mode */
.ytp-hide-info-bar .ytp-chrome-top {
/* Disable .ytp-hide-info-bar (active when not fullscreen) */
height: unset;
}
}