Skip to content

Commit 613ced2

Browse files
committed
Update style for mobile devices and add bullets
1 parent 3af0817 commit 613ced2

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

_includes/grid-gallery.html

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,36 @@
11
<div class="glide">
2+
{% assign images = site.static_files | where_exp: "file", "file.path contains '/images/main-carousel/'" %}
23
<div class="glide__track" data-glide-el="track">
34
<ul class="glide__slides">
4-
{% assign images = site.static_files | where_exp: "file", "file.path contains '/images/main-carousel/'" %}
55
{% for image in images %}
66
<li class="glide__slide">
77
<img src="{{ image.path }}" alt="Gallery Image">
88
</li>
99
{% endfor %}
1010
</ul>
1111
</div>
12+
<div class="glide__bullets" data-glide-el="controls[nav]">
13+
{% for image in images %}
14+
<button class="glide__bullet" data-glide-dir="={{forloop.index0}}"></button>
15+
{% endfor %}
16+
</div>
1217
</div>
1318

1419
<script>
15-
new Glide('.glide', {
20+
var glide = new Glide('.glide', {
1621
type: 'carousel',
1722
perView: 2,
1823
autoplay: 5000,
19-
gap: 10
20-
}).mount();
24+
gap: 10,
25+
focusAt : 'center',
26+
breakpoints: {
27+
800: {
28+
perView: 1
29+
}
30+
}
31+
})
32+
33+
glide.mount();
2134
</script>
2235

2336
<style>
@@ -31,4 +44,9 @@
3144
width: 100%;
3245
height: auto;
3346
}
47+
48+
.glide__bullet--active {
49+
background-color: #0000003f;
50+
border: 2px solid #ffffffbe;
51+
}
3452
</style>

0 commit comments

Comments
 (0)