-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
181 lines (150 loc) · 3.8 KB
/
index.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vanillabox VanillaJS lightbox</title>
<script>
document.documentElement.className = 'js';
window.addEventListener('error', function (e) {
document.documentElement.className = 'badjs'
});
</script>
<link rel="stylesheet" href="vanillabox/vanillabox.css">
<style>
body {
font: normal 1em/1.5 sans-serif;
padding: 1em;
margin: 0;
}
main a {
display: block;
margin: 1em;
}
ul {
list-style: none;
display: flex;
flex-wrap: wrap;
align-items: center;
padding: 0;
}
ul a:focus {
border: 2px dotted;
}
/* example style */
main {
transition: .1s .2s;
}
main[aria-hidden] {
transition-delay: 0;
filter: blur(2px) saturate(0);
transform: scale(0.95);
}
main img {
width: 30vw;
}
.scrollingcontent {
height: 150vh;
display: flex;
flex-direction: column;
justify-content: space-between;
}
</style>
</head>
<body>
<main>
<h1>vanillabox – VanillaJS image lightbox
<b>VERSION</b>
</h1>
<h2>Single item</h2>
<ul class="box">
<li>
<a href="image/0.jpg" title="title">
<figure>
<img src="image/0t.jpg" alt="1">
<figcaption>Description (info)</figcaption>
</figure>
</a>
</li>
</ul>
<h2>Content from #anchor</h2>
<div>
<a href="#anchor" title="anchorlink title" class="box">Lightbox with content</a>
</div>
<h2>Grouped (mixed) content</h2>
<ul class="box">
<li>
<a href="image/0.jpg" title="Slide 1">
<figure>
<img src="image/0t.jpg" alt="1">
<figcaption>Landscape large</figcaption>
</figure>
</a>
</li>
<li>
<a href="image/1.jpg" title="Slide 2">
<figure>
<img src="image/1t.jpg" alt="2">
<figcaption>Portrait large</figcaption>
</figure>
</a>
</li>
<li>
<a href="image/2.jpg" title="Slide 3 small image, no caption">
<figure>
<img src="image/2t.jpg" alt="3">
</figure>
</a>
</li>
<li>
<a href="image/1t.jpg" title="Slide 4">
<figure>
<img src="image/1t.jpg" alt="2">
<figcaption>Portrait small</figcaption>
</figure>
</a>
</li>
<li>
<a href="#anchor" title="anchorlink title">Content1</a>
</li>
<li>
<a href="#anchor2" title="anchorlink title">Content2</a>
</li>
</ul>
<h2>link with class .box directly</h2>
<div>
<a href="image/0.jpg" title="title" class="box">
<figure>
<img src="image/0t.jpg" alt="1">
<figcaption>Description (info)</figcaption>
</figure>
</a>
</div>
<div hidden id="anchor">
<div class="boxcontent">
<h3>Content of anchorlink</h3>
<p>Some content with
<a href="http://github.com">link</a> too</p>
</div>
</div>
<div hidden id="anchor2">
<div class="scrollingcontent">
<h3>Content2 of anchorlink</h3>
<p>Some other content</p>
<p>Some other content</p>
</div>
</div>
</main>
<script src="vanillabox/vanillabox.js"></script>
<script>
; (function () {
'use strict';
document.addEventListener("DOMContentLoaded", function () {
// var $extrabox = document.getElementById('extrabox')
window.boxes = vanillabox(document.querySelectorAll('.box'))
document.querySelector('h1 b').innerHTML = vanillabox.VERSION
})
}());
</script>
</body>
</html>