-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
316 lines (286 loc) · 8.74 KB
/
index.html
File metadata and controls
316 lines (286 loc) · 8.74 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/240/apple/225/high-voltage-sign_26a1.png">
<!-- Primary Meta Tags -->
<title>Lightspeed Media</title>
<meta name="title" content="Lightspeed Media">
<meta name="description" content="A bookmarket to speed up any video or audio on the web with a single click.">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://lightspeed-media.glitch.me/">
<meta property="og:title" content="Lightspeed Media">
<meta property="og:description" content="A bookmarket to speed up any video or audio on the web with a single click.">
<meta property="og:image" content="light-speed.png">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://lightspeed-media.glitch.me/">
<meta property="twitter:title" content="Lightspeed Media">
<meta property="twitter:description" content="A bookmarket to speed up any video or audio on the web with a single click.">
<meta property="twitter:image" content="light-speed.png">
<style>
@import url('https://fonts.googleapis.com/css?family=Orbitron:500,700|Source+Sans+Pro&display=swap');
html,
body {
height: 100%;
width: 100%;
}
body {
background: #010b13;
color: white;
text-align: center;
font-family: "Source Sans Pro";
}
@media only screen and (min-width: 700px) {
body {
font-size: 2vw;
}
}
@media only screen and (min-width: 1000px) {
body {
font-size: 1.5rem;
}
}
main {
position: relative;
top: 50%;
margin: -50px auto 0;
transform: translateY(-50%);
max-width: 50rem;
width: 80%;
}
h1 {
font-family: "Orbitron", sans-serif;
letter-spacing: 4px;
font-weight: bold;
text-shadow: 0 0 1px #aaa, 0 0 30px #0ff, 0 0 40px orange,
0 0 50px orange, 0 0 60px orange;
line-height: 1.25em;
}
p {
line-height: 2rem;
}
a {
color: white;
}
#button {
font-family: "Orbitron", sans-serif;
letter-spacing: 2px;
background: #A63ADF;
padding: 0.5rem 1.25rem 0.9rem;
border-bottom: 1;
position: relative;
text-decoration: none;
font-weight: 500;
margin-top: 1rem;
display: inline-block;
cursor: move;
}
#button:after {
background: inherit;
bottom: 0;
content: "";
display: block;
height: 50%;
left: 0;
position: absolute;
right: 0;
transform: skewY(-1.5deg);
transform-origin: 100%;
z-index: -1;
}
#button:before {
background: inherit;
top: 0;
content: "";
display: block;
height: 50%;
left: 0;
position: absolute;
right: 0;
transform: skewY(-1.5deg);
transform-origin: -100%;
z-index: -1;
width: 100.25%;
}
button#viewCode {
text-decoration: underline;
font: inherit;
font-size: 1.25rem;
color: #ddd;
background: transparent;
border: 0;
margin-top: 1rem;
cursor: pointer;
}
aside {
position: absolute;
height: 100%;
width: 100%;
background: transparent;
top: 0;
left: 0;
z-index: -1;
transition: 0.5s;
}
aside.isOpen {
z-index: 1;
background: rgba(0, 0, 0, 0.8);
}
aside section {
z-index: -1;
opacity: 0;
top: 0%;
transform: translate(0%, -50%);
max-width: 80%;
width: 40rem;
position: absolute;
right: 0;
background: white;
transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
left: 0;
margin: auto;
}
aside.isOpen section {
transform: translate(0%, -50%);
top: 50%;
opacity: 1;
z-index: 1;
box-shadow: 0 0 10px #fff, 0 10px 20px #fff, 0 -10px 20px #fff,
10px 0px 20px #fff, -10px 0px 20px #fff, 0 20px 30px #fff,
0 -20px 30px #fff, 20px 0px 30px #fff, -20px 0px 30px #fff,
0 0 30px #A63ADF, 0 0 40px #A63ADF, 0 0 50px #A63ADF, 0 0 60px #A63ADF,
0 0 70px #A63ADF;
}
pre {
box-sizing: border-box;
width: 100%;
padding: 0 1rem;
color: #333;
text-align: left;
overflow: scroll;
}
button#close {
position: absolute;
right: 0.5rem;
top: 0.5rem;
font: inherit;
background: transparent;
padding: 0;
border: 0;
line-height: 1em;
/* font-family: "Orbitron", sans-serif; */
font-size: 1.75rem;
color: rgba(65, 22, 88, 0.5);
}
.glitchButton {
text-align: left;
}
.glitchButton a {
color: black;
}
#me {
display: block;
font-size: 1rem;
color: #ddd;
position: absolute;
right: 1rem;
bottom: 1rem;
}
</style>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-31917559-14"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-31917559-14');
</script>
</head>
<body>
<main>
<h1>Lightspeed Media</h1>
<p>
Hey there 👋 Here's a handy little
<a href="https://en.wikipedia.org/wiki/Bookmarklet">bookmarklet</a> for you.
It'll speed up any video or audio on the web with a single click.
</p>
<p>
Drag this button to your bookmark bar, and you're off 🚀
</p>
<a
id="button"
href="javascript:(() => {var d=document;[...d.querySelectorAll('.speed-up')].map((v) => v.remove());var v=document.querySelector('video,audio');var p=Math.max(1, v.playbackRate%2+.25);v.playbackRate=p;var s=d.createElement('div');s.className='speed-up';s.style='position:absolute;top:1rem;left:1rem;background:rgba(0,0,0,.8);z-index:9999;color:#fff;font:18px Arial;padding:.5rem 1.5rem;border-radius:3px;';s.innerHTML=p;d.querySelector('body').prepend(s);setTimeout(()=>s.remove(),1500);})()"
>⚡ Lightspeed</a
>
<br />
<button id="viewCode">
View the code
</button>
</main>
<aside>
<section>
<button id="close">
×
</button>
<pre>
javascript: (() => {
var d = document;
[...d.querySelectorAll('.speed-up')].map(
(v) => v.remove()
);
var v = document.querySelector('video,audio');
var p = Math.max(1, v.playbackRate % 2 + .25);
v.playbackRate = p;
var s = d.createElement('div');
s.className = 'speed-up';
s.style = `
position:absolute;
top:1rem;
left:1rem;
background:rgba(0,0,0,.8);
z-index:9999;
color:#fff;
font:18px Arial;
padding:.5rem 1.5rem;
border-radius:3px;
`;
s.innerHTML = p;
d.querySelector('body').prepend(s);
setTimeout(() => s.remove(), 1500);
})()</pre
>
</section>
<!-- include the Glitch button to show what the webpage is about and
to make it easier for folks to view source and remix -->
<div
class="glitchButton"
style="position:fixed;top:20px;right:20px;"
></div>
<script src="https://button.glitch.me/button.js"></script>
</aside>
<a id="me" href="https://twitter.com/theavigoldman" target="_blank">Made by @theavigoldman</a>
<div
class="glitchButton"
style="position:fixed;top:20px;right:20px;color:black;"
></div>
<script>
const bookmarkButton = document.querySelector('#button');
const viewCode = document.querySelector("#viewCode");
const close = document.querySelector("#close");
const aside = document.querySelector("aside");
bookmarkButton.addEventListener("click", function() {
alert('To install Lightspeed media ⚡️, drag and drop the purple button into your bookmark bar. ')
})
viewCode.addEventListener("click", function() {
aside.classList.toggle("isOpen");
});
close.addEventListener("click", function() {
aside.classList.toggle("isOpen");
});
</script>
</body>
</html>