-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ejs
More file actions
97 lines (91 loc) · 3.41 KB
/
Copy pathindex.ejs
File metadata and controls
97 lines (91 loc) · 3.41 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
<!doctype html>
<html>
<head>
<%= require('html-loader!./partials/head.html') %>
<style>
[data-its-slider-slides-container] {
display: flex;
overflow-x: scroll;
scrollbar-width: none;
-ms-overflow-style: none;
}
[data-its-slider-slides-container]::-webkit-scrollbar {
display: none;
}
@media (hover: none) and (pointer: coarse) {
[data-its-slider-slides-container] {
-webkit-overflow-scrolling: touch;
}
}
</style>
<style>
img {
display: block;
object-fit: cover
}
figure {
position: relative;
margin: 0;
padding: 0;
}
figcaption {
position: absolute;
width: 100%;
left: 0rem;
bottom: 0rem;
padding: 1rem;
color: white;
text-decoration: none;
text-shadow: 0px 1px 1px rgba(32, 32, 32, 0.4);
background: rgba(32, 32, 32, 0.2);
}
</style>
</head>
<body>
<%= require('html-loader!./partials/header.html') %>
<div class="container">
<h2>Basic example</h2>
<p>Just a very basic example.</p>
</div>
<div data-its-slider>
<div data-its-slider-slides-container>
<% const photos = [] %>
<% photos.push([640, '1.1.jpg','Photo by bruce mars from Pexels', '935743']) %>
<% photos.push([480, '2.1.jpg','Photo by Helena Lopes from Pexels', '1015568']) %>
<% photos.push([640, '3.1.jpg','Photo by bruce mars from Pexels', '927022']) %>
<% photos.push([480, '4.1.jpg','Photo by Snapwire from Pexels', '618613']) %>
<% photos.push([640, '5.1.jpg','Photo by bruce mars from Pexels','935756']) %>
<% photos.push([480, '6.1.jpg','Photo by Yury Kim from Pexels','585419']) %>
<% photos.forEach(([width,src,caption,id]) => { %>
<a href="https://www.pexels.com/photo/<%= id %>/"
target="_blank"
data-its-slider-slide>
<figure>
<picture>
<img src="photos/<%= src %>"
width="<%= width %>"
height="480">
</picture>
<figcaption>
<p><%= caption %></p>
</figcaption>
</figure>
</a>
<% }) %>
</div>
<button data-its-slider-button
data-its-slider-button-prev
data-its-slider-button-disabled
disabled>prev</button>
<button data-its-slider-button
data-its-slider-button-next
data-its-slider-button-disabled
disabled>next</button>
</div>
<script src="slider.js"></script>
<script>
const sliders = slider.Slider.init();
</script>
<script src="https://unpkg.com/smoothscroll-polyfill@0.4.4/dist/smoothscroll.js"></script>
</body>
</html>