Skip to content

Commit 7493ab5

Browse files
committed
add image galleries with lightgallery
1 parent 30fb7c6 commit 7493ab5

30 files changed

Lines changed: 4247 additions & 2 deletions

site/2016/05/made-in-hacklab-sentient-forest.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ cable and 14 tubes of silicone sealant.
3030

3131
Here are some behind the scenes photos of it being built:
3232

33+
<gallery>
34+
3335
![](./images/2016-01-19-14.55.12-450x337.jpg)
3436
![](./images/2016-03-25-14.21.39-450x338.jpg)
3537
![](./images/2016-03-27-19.09.56-338x450.jpg)
@@ -44,6 +46,8 @@ Here are some behind the scenes photos of it being built:
4446
![](./images/IMG_1016-1-450x338.jpg)
4547
![](./images/2016-04-15-12.28.55-450x338.jpg)
4648

49+
</gallery>
50+
4751
And here's the final piece, doing it's thing:
4852

4953
![Sentient

site/css/gic.css

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,36 @@ img {
152152
max-width: 100%;
153153
}
154154

155+
/* Basic fallback styling for galleries, for when JS is disabled / not working */
156+
gallery:not(.active) > p {
157+
width: 100%;
158+
position: relative;
159+
160+
img {
161+
height: 10lh;
162+
display: inline-block;
163+
overflow: hidden;
164+
margin: 0;
165+
padding: 0;
166+
}
167+
168+
/* Avoid flashing all of the images before the JS loads, but still display it after a short time */
169+
animation: fadeInAfterTime 3s linear;
170+
171+
}
172+
@keyframes fadeInAfterTime {
173+
0% { opacity: 0; }
174+
99% { opacity: 0; }
175+
100% { opacity: 1; }
176+
}
177+
178+
gallery.active {
179+
display: block;
180+
width: 100%;
181+
height: 0;
182+
padding-bottom: 30lh;
183+
}
184+
155185
/* Selected parts from: */
156186
/* GIC.css Version 1.2.0
157187
* (c) Copyright Ariadne (me@aria.rip) 2026.
@@ -623,7 +653,7 @@ hr.visible { border-bottom: 1px solid var(--colour-border) }
623653
/* |___ | | |__/ |\/| [__ */
624654
/* | |__| | \ | | ___] */
625655
/* */
626-
button {
656+
button:not(.lg-icon) {
627657
--button-bg: var(--green-shade-25);
628658
--button-bg-darker: var(--green-shade-50);
629659
--text: var(--colour-button-text);

site/favicon.svg

Lines changed: 22 additions & 0 deletions
Loading

site/js/all.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,25 @@ function nextOpenNight() {
3636
var nextOpenNightElement = document.getElementById('next-open-night');
3737
if (nextOpenNightElement)
3838
nextOpenNightElement.innerText = `Our next open night is on the ${nextString}.`;
39-
})()
39+
})();
40+
41+
// Convert <gallery> tags into inline galleries
42+
(function() {
43+
for (var el of document.querySelectorAll('gallery')) {
44+
// Collect all the child image tags, then clear the element and make an
45+
// inline gallery.
46+
// This is needed because lightgallery will append to the end of the element by default.
47+
// It also deals with the fact that in markdown, there will usually be some extra <p> tags lying around
48+
let imgs = Array.from(el.querySelectorAll('img'));
49+
el.innerHTML = '';
50+
var gallery = lightGallery(el, {
51+
container: el,
52+
closable: false,
53+
showMaximizeIcon: true,
54+
dynamic: true,
55+
dynamicEl: imgs,
56+
})
57+
el.classList.add('active');
58+
gallery.openGallery();
59+
}
60+
})();

site/vendor/css/lg-autoplay.css

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/vendor/css/lg-comments.css

Lines changed: 119 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/vendor/css/lg-fullscreen.css

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/vendor/css/lg-medium-zoom.css

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/vendor/css/lg-pager.css

Lines changed: 82 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/vendor/css/lg-relative-caption.css

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)