-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphotos.html
193 lines (173 loc) · 4.35 KB
/
photos.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
182
183
184
185
186
187
188
189
190
191
192
193
---
layout: page
title: Photos
permalink: /photos/
tags: gallery, photos
---
<style>
* {box-sizing: border-box}
.mySlides {display: none}
img {vertical-align: middle}
.mySlides img {height: 600px}
/* Slideshow container */
.slideshow-container {
max-width: 1000px;
position: relative;
margin: auto;
}
/* Next & previous buttons */
.prev, .next {
cursor: pointer;
position: absolute;
top: 50%;
width: auto;
padding: 16px;
margin-top: -22px;
color: white;
font-weight: bold;
font-size: 18px;
transition: 0.6s ease;
border-radius: 0 3px 3px 0;
}
/* Position the "next button" to the right */
.next {
right: 0;
border-radius: 3px 0 0 3px;
}
/* On hover, add a black background color with a little bit see-through */
.prev:hover, .next:hover {
background-image: none;
background-color: rgba(0,0,0,0.8);
}
/* Caption text */
.text {
color: #0d0d0d;
background-color: #f2f2f2;
opacity: .7;
font-size: 15px;
padding: 8px 12px;
position: absolute;
bottom: 8px;
width: 100%;
text-align: center;
}
/* Number text (1/3 etc) */
.numbertext {
color: #0d0d0d;
background-color: #f2f2f2;
opacity: .7;
font-size: 12px;
padding: 8px 12px;
position: absolute;
top: 0;
}
/* The dots/bullets/indicators */
.dot {
cursor: pointer;
height: 60px;
max-width: 80px;
object-fit: cover;
margin: 1px 1px;
background-color: #fff;
opacity: 0.6;
display: inline-block;
transition: background-color 0.6s ease;
}
.active, .dot:hover {
border: 3px solid #717171;
}
/* Fading animation */
.fade {
-webkit-animation-name: fade;
-webkit-animation-duration: 1.5s;
animation-name: fade;
animation-duration: 1.5s;
}
@-webkit-keyframes fade {
from {opacity: .4}
to {opacity: 1}
}
@keyframes fade {
from {opacity: .4}
to {opacity: 1}
}
/* On smaller screens, decrease text size */
@media only screen and (max-width: 450px) {
.prev, .next,.text {font-size: 11px}
.mySlides img {height: 300px}
.dot {height: 30px; max-width: 40px;}
}
</style>
<div class="home">
<div class="slideshow-container">
{% for image in site.data.gallery_images %}
<div class="mySlides fade">
<img src="{{ site.baseurl }}/images/gallery/{{ image.filename }}" style="width:100%; object-fit: cover;">
{% if image.caption %}
<div class="text">{{ image.caption }}</div>
{% endif %}
</div>
{% endfor %}
<a class="prev" onclick="plusSlides(-1)">❮</a>
<a class="next" onclick="plusSlides(1)">❯</a>
</div>
<div style="text-align:center">
{% assign counter = 1 %}
{% for image in site.data.gallery_images %}
<span class="dot" onclick="currentSlide({{ counter }})"><img src="{{ site.baseurl }}/images/gallery/{{ image.filename }}"></span>
{% assign counter = counter | plus: 1 %}
{% endfor %}
</div>
<!-- Table version is below. You need to edit the css above such that mySlides display is "block", and you also remove the script at the bottom -->
<!--<table>
{% assign counter = 1 %}
{% for image in site.data.gallery_images %}
{% if counter == 1 %}
<tr>
{% endif %}
<td align="center">
<div class="slideshow-container">
<div class="mySlides">
<img src="{{ site.baseurl }}/images/gallery/{{ image.filename }}" style="width:100%; height:300px; object-fit: cover;" />
<div class="text">{{ image.caption }}</div>
</div>
</div>
</td>
{% if counter >= site.gallery_columns %}
{% assign counter = 0 %}
</tr>
{% endif %}
{% assign counter = counter | plus: 1 %}
{% endfor %}
{% if counter != 0 %}
{% for counter in (counter..site.gallery_columns-1) %}}
<td></td>
{% endfor %}
{% endif %}
</table>-->
</div>
<script>
var slideIndex = 1;
showSlides(slideIndex);
function plusSlides(n) {
showSlides(slideIndex += n);
}
function currentSlide(n) {
showSlides(slideIndex = n);
}
function showSlides(n) {
var i;
var slides = document.getElementsByClassName("mySlides");
var dots = document.getElementsByClassName("dot");
if (n > slides.length) {slideIndex = 1}
if (n < 1) {slideIndex = slides.length}
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" active", "");
}
slides[slideIndex-1].style.display = "block";
dots[slideIndex-1].className += " active";
}
</script>