Repository navigation
Expand file tree
/
Copy pathphotos.html
More file actions
127 lines (115 loc) · 5.17 KB
/
Copy pathphotos.html
File metadata and controls
127 lines (115 loc) · 5.17 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
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
---
title: RubyConf Austria 2026 | Photos
permalink: /photos/
layout: default
---
<main class="content">
<header class="header header-speakers">
<div class="header__content">
<h1 class="header__title">
Photos
</h1>
</div>
</header>
<section class="section section--basic" id="photos" aria-label="Conference photos">
<div class="section__content">
{% assign photo_files = site.static_files | where_exp: "f", "f.path contains '/assets/photos/'" | sort: "path" %}
{% assign image_exts = ".jpg .jpeg .png .webp .gif .avif" %}
{% capture gallery_html %}
{% for photo in photo_files %}
{% assign ext = photo.extname | downcase %}
{% if ext != "" and image_exts contains ext %}
<button type="button" class="photo-gallery__item" aria-label="View photo in full size">
<img src="{{ photo.path | replace: '/assets/photos/', '/assets/photo_thumbs/' }}" data-full="{{ photo.path }}" alt="RubyConf Austria 2026 — {{ photo.basename }}" loading="lazy" />
</button>
{% endif %}
{% endfor %}
{% endcapture %}
{% if gallery_html contains "photo-gallery__item" %}
<div class="photo-gallery" id="photo-gallery">
{{ gallery_html }}
</div>
{% else %}
<article class="section__article mb--8">
<div class="col--100">
<h3 class="section__article__title">Nothing to see here yet!</h3>
<p>Photos from RubyConf Austria 2026 are on their way — check back soon.</p>
</div>
</article>
{% endif %}
</div>
</section>
</main>
<div class="lightbox" id="lightbox" role="dialog" aria-modal="true" aria-label="Photo viewer" hidden>
<button type="button" class="lightbox__close" id="lightbox_close" aria-label="Close photo viewer">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 6L6 18M6 6L18 18" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
</svg>
</button>
<button type="button" class="lightbox__arrow lightbox__arrow--prev" id="lightbox_prev" aria-label="Previous photo">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15 18L9 12L15 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
<img class="lightbox__image" id="lightbox_image" src="" alt="" />
<button type="button" class="lightbox__arrow lightbox__arrow--next" id="lightbox_next" aria-label="Next photo">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9 18L15 12L9 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
<div class="lightbox__counter" id="lightbox_counter" aria-live="polite"></div>
</div>
<script type="text/javascript">
(function () {
var items = Array.prototype.slice.call(document.querySelectorAll('.photo-gallery__item'));
if (items.length === 0) return;
var lightbox = document.getElementById('lightbox');
var image = document.getElementById('lightbox_image');
var counter = document.getElementById('lightbox_counter');
var currentIndex = 0;
var touchStartX = null;
function show(index) {
currentIndex = (index + items.length) % items.length;
var thumb = items[currentIndex].querySelector('img');
image.src = thumb.getAttribute('data-full') || thumb.src;
image.alt = thumb.alt;
counter.textContent = (currentIndex + 1) + ' / ' + items.length;
}
function open(index) {
show(index);
lightbox.hidden = false;
document.body.classList.add('lightbox-open');
document.getElementById('lightbox_close').focus();
}
function close() {
lightbox.hidden = true;
document.body.classList.remove('lightbox-open');
items[currentIndex].focus();
}
items.forEach(function (item, index) {
item.addEventListener('click', function () { open(index); });
});
document.getElementById('lightbox_close').addEventListener('click', close);
document.getElementById('lightbox_prev').addEventListener('click', function () { show(currentIndex - 1); });
document.getElementById('lightbox_next').addEventListener('click', function () { show(currentIndex + 1); });
lightbox.addEventListener('click', function (event) {
if (event.target === lightbox) close();
});
document.addEventListener('keydown', function (event) {
if (lightbox.hidden) return;
if (event.key === 'Escape') close();
if (event.key === 'ArrowLeft') show(currentIndex - 1);
if (event.key === 'ArrowRight') show(currentIndex + 1);
});
lightbox.addEventListener('touchstart', function (event) {
touchStartX = event.changedTouches[0].clientX;
}, { passive: true });
lightbox.addEventListener('touchend', function (event) {
if (touchStartX === null) return;
var deltaX = event.changedTouches[0].clientX - touchStartX;
touchStartX = null;
if (Math.abs(deltaX) < 50) return;
show(deltaX > 0 ? currentIndex - 1 : currentIndex + 1);
}, { passive: true });
})();
</script>