-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgallery.html
54 lines (49 loc) · 1.56 KB
/
gallery.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="author" href="//github.com/gadelkareem/video-gallery-generator">
<meta name="description" content="Video Gallery generator">
<title>Video Gallery</title>
<script src="//cdn.jsdelivr.net/npm/[email protected]/dist/jquery.js"></script>
<script src="vars.js"></script>
<style>
body {
margin: 0;
background: #333;
}
header {
padding: 0;
font-size: 0;
display: grid;
grid-template-columns: repeat(4, 200px);
grid-gap: .5vw
}
header div img {
max-width: 200px;
height: auto;
max-height: 130px;
}
header div {
margin: 0;
}
</style>
</head>
<body>
<header style="text-align: center" id="gallery">
</header>
<script>
files.forEach(function (p) {
p = encodeURIComponent(p.replace(/%2F/g, '%2_F')).replace(/%2F/g, "/").replace(/%2_F/g, '%2F')
const filename = p.split('/').pop()
const video = $('<div><a href="' + p + '" target="_blank"><img alt="' + filename + '" src="thumbs/' + filename + '.png" /></a></div>')
$('#gallery').append(video)
});
$("img").on("error", function () {
$(this).attr("src", "https://cdn.jsdelivr.net/npm/@internetarchive/[email protected]/video.svg");
});
</script>
</body>
</html>