-
Notifications
You must be signed in to change notification settings - Fork 12
/
video.css
207 lines (206 loc) · 4.91 KB
/
video.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
/* Popup link */
.popup-link {
position: relative;
/* Create a cover placed on top of the svg */
/* This is to activate the popup link when it's being clicked */
}
.popup-link::after {
content: "";
display: block;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background: transparent;
}
/* Video */
.hero-video {
margin: 0;
}
.hero-video figcaption {
padding: 8px 15px 15px;
font-size: 18px;
font-weight: normal;
}
@media (max-width: 500px) {
.hero-video figcaption {
padding: 10px;
}
}
.hv-poster > img {
width: 100%;
}
.hv-poster {
position: relative;
}
.hv-play {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
}
@media (max-width: 500px) {
.hv-play {
transform: scale(0.8);
}
}
.hv-play > div {
background: rgba(255, 255, 255, 0.9);
padding: 5px 20px 5px 5px;
height: 40px;
line-height: 40px;
border-radius: 25px;
box-shadow: 0 0 15px rgba(51, 62, 72, 0.5);
font-weight: bold;
font-size: 20px;
}
.hv-play > div > svg {
margin-right: 10px;
vertical-align: top;
}
a:focus .hv-poster::before,
a:hover .hv-poster::before {
box-shadow: 0 0 30px #333e48;
background: color(#333e48 blend(#333e48 10%));
}
a:focus .hv-play > div,
a:hover .hv-play > div {
background: #fff;
box-shadow: 0 0 30px rgba(51, 62, 72, 0.75);
}
.hero-video > a {
position: relative;
display: block;
text-decoration: none;
font-weight: normal;
background: #f2f2f2;
box-shadow: 0 0 10px rgba(51, 62, 72, 0.3);
text-align: center;
color: #17242a;
}
.hero-video > a:focus,
.hero-video > a:hover {
box-shadow: 0 0 20px rgba(51, 62, 72, 0.5);
}
.lightbox {
position: fixed;
z-index: 2147483648; /* To sit above both Olark and the header */
top: 0;
left: 0;
width: 100%;
height: 100%;
padding: 10vh 10vw;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.6);
}
.lightbox > div {
position: relative;
flex: 1;
background: #000;
box-shadow: 0 0 1em #000 9;
}
.lightbox > .screen {
padding: 30px;
position: relative;
background: #fff;
box-shadow: 0 0 1em #000 9;
}
.lightbox > .screen:not(.active) {
display: none;
}
.aspect-16-9 {
position: relative;
/* The usual approach would be this:
*
* height: 0;
* padding-bottom: 56.25%;
*
* Because percentages are relative to the width of the element. But alas,
* the flex module spec allows (but does not require!) percentages to be
* relative to the appropriate axis of the flex container insetad, and Edge
* does that. So doing it that way is broken if you work with a *direct*
* child of the flex parent. (And changing the flex-direction in the parent
* only makes it worse, and I was too fed up with the issue to figure out
* why.) Fortunately, pseudoelements allow us to cheat on this, because
* they’re not flex children (well, unless the element is a flex parent, but
* it’s not). So we do things with a pseudoelement, because that makes so
* much sense, right? At least it works consistently cross-browser.
*
* Further reading: https://stackoverflow.com/q/23717953
*/
}
.aspect-16-9::after {
content: "";
display: block;
padding-bottom: 56.25%;
}
.lightbox-close {
cursor: pointer;
position: absolute;
width: 1em;
height: 1em;
line-height: 1;
text-align: center;
font-size: 1.5em;
cursor: pointer;
/* Increase the size of the target to aim for (especially for mobile) */
}
.lightbox-close::before {
content: "×";
}
@media (min-width: 360.25px) and (min-height: 200.25px) {
.lightbox-close {
top: -0.5em;
right: -0.5em;
background: #ccc;
box-shadow: 0 0 1em #000 9, 0 0 0.2em #000 9;
border-radius: 50%;
}
.lightbox-close:focus, .lightbox-close:hover {
background: #eee;
box-shadow: 0 0 1em #000, 0 0 0.2em #000;
}
}
.lightbox-close::after {
content: "";
position: absolute;
top: -50%;
left: -50%;
right: -50%;
bottom: -50%;
border-radius: 30%;
}
@media (max-width: 640px), (max-height: 360px) {
.lightbox {
padding: 25vh 5vw;
}
}
/* Using pure CSS for sizing aspect ratios makes it depend solely on width for
* size; and so when the aspect ratio becomes too extreme, it overflows
* vertically. Assuming 16:9 on the lightbox contents, we should cap the
* lightbox contents’ width at 100vh/9*16 (or if doing 5vh or 10vh vertical
* padding on the lightbox, replace 100vh with 90vh or 80vh), which means left
* and right padding of calc((100vw - (100vh / 9 * 16)) / 2). */
@media (min-aspect-ratio: 1.77778) {
.lightbox {
padding: 10vh calc((100vw - (80vh / 9 * 16)) / 2);
}
}
@media (min-aspect-ratio: 1.77778) and (max-height: 360px) {
.lightbox {
padding: 5vh calc((100vw - (90vh / 9 * 16)) / 2);
}
}
@media (min-aspect-ratio: 1.77778) and (max-height: 200px) {
.lightbox {
padding: 0 calc((100vw - (100vh / 9 * 16)) / 2);
}
}