Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
389 lines (322 loc) · 10.6 KB
/
Copy pathindex.html
File metadata and controls
389 lines (322 loc) · 10.6 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
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
<!DOCTYPE html>
<!-- Test this out with Start-PodeStaticServer -Port 8085 -->
<!-- XNConvert manages the images-->
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/x-icon" href="/images/jpg.ico" />
<script src="https://cdn.jsdelivr.net/npm/hammerjs@2.0.8/hammer.min.js"></script>
<title>SV Aion – Live Voyage Map</title>
<meta name="description" content="Track the voyages of SV Aion, a modern sailing vessel exploring the oceans. View live GPS routes, travel logs, and photos." />
<!-- Social Previews -->
<meta property="og:type" content="website" />
<meta property="og:title" content="SV Aion – Live Voyage Map" />
<meta property="og:description" content="Follow SV Aion's real-time sailing routes across the globe." />
<meta property="og:image" content="https://jpg.industries/images/preview.jpg" />
<meta property="og:url" content="https://jpg.industries/" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="SV Aion – Live Voyage Map" />
<meta name="twitter:description" content="Explore the live GPS voyage map of SV Aion." />
<meta name="twitter:image" content="https://jpg.industries/images/preview.jpg" />
<!-- Fonts & Styling -->
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;500;700&display=swap" rel="stylesheet" />
<style>
:root {
--accent: #0077aa;
--bg: #d0dde7;
--text: #333;
--heading: #002b36;
--shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: 'Roboto', sans-serif;
background-color: var(--bg);
color: var(--text);
opacity: 0;
animation: fadeIn 1s ease forwards;
}
@keyframes fadeIn {
to {
opacity: 1;
}
}
header {
background: linear-gradient(to right, #004466, #0077aa);
color: white;
text-align: center;
padding: 3rem 1rem 2rem;
}
header h1 {
font-size: 2.5rem;
margin-bottom: 0.5rem;
}
header p {
font-size: 1.2rem;
opacity: 0.9;
}
main {
max-width: 960px;
margin: 0 auto;
padding: 2rem 1rem;
}
section {
margin-bottom: 3rem;
}
h2 {
font-size: 1.8rem;
color: var(--heading);
margin-bottom: 1rem;
}
p {
font-size: 1.05rem;
line-height: 1.6;
}
img,
iframe {
max-width: 100%;
border-radius: 12px;
margin: 1.5rem 0;
box-shadow: var(--shadow);
transition: transform 0.3s ease;
}
iframe {
min-height: 450px;
height: 70vh;
width: 100%;
border: none;
}
img:hover {
transform: scale(1.01);
}
footer {
text-align: center;
font-size: 0.9rem;
color: #666;
padding: 2rem 1rem;
}
@media (max-width: 768px) {
header h1 {
font-size: 2rem;
}
iframe {
min-height: 300px;
height: 60vh;
}
}
/* Gallery Styles */
.image-gallery {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
gap: 16px;
margin-top: 1rem;
}
.image-gallery img {
width: 100%;
height: 120px;
object-fit: cover;
border-radius: 12px;
box-shadow: var(--shadow);
transition: transform 0.3s ease, box-shadow 0.3s ease;
cursor: pointer;
}
.image-gallery img:hover {
transform: scale(1.05);
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
#lightbox {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.85);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
padding: 1rem;
cursor: zoom-out;
touch-action: pan-y; /* Allow horizontal swipe gestures */
}
#lightbox img {
max-width: 90%;
max-height: 90%;
border-radius: 8px;
box-shadow: var(--shadow);
}
.lightbox-close {
position: absolute;
top: 1.2rem;
right: 1.5rem;
color: white;
font-size: 2rem;
font-weight: bold;
cursor: pointer;
z-index: 1001;
}
</style>
</head>
<body>
<header>
<h1>SV Aion</h1>
<p>Exploring the oceans — live from our deck to your screen</p>
</header>
<main>
<section>
<h2>Welcome Aboard</h2>
<p>
SV Aion is a modern sailing vessel on a journey across the seas. This page shares our story
through real-time GPS tracks, stunning photography, and detailed sailing logs.
</p>
<p>
Whether you're a fellow sailor, a curious traveler, or a friend back home —
we invite you to follow along and explore our voyage.
</p>
<img src="images/aion_at_anchor.jpg" alt="SV Aion sailing under clear skies" />
</section>
<section>
<h2>Live Voyage Map</h2>
<p>Below is an interactive map showing our latest sailing routes and anchorages.</p>
<iframe src="/maps?tracks=latest" title="SV Aion Live Map" loading="lazy" allowfullscreen></iframe>
</section>
<section>
<h2>Meet the Crew</h2>
<p>
We're a small crew passionate about adventure, sustainability, and life at sea.
Our mission is to discover new places, connect with people, and share the magic of sailing.
</p>
</section>
<section>
<h2>Photo Gallery</h2>
<p>Explore highlights from our voyages through this dynamic gallery.</p>
<div id="gallery" class="image-gallery">Loading…</div>
</section>
<div id="lightbox" style="display:none; position:fixed; top:0; left:0; width:100vw; height:100vh; background:rgba(0,0,0,0.8); justify-content:center; align-items:center; z-index:1000; cursor:pointer; flex-direction:column;">
<img id="lightbox-img" style="max-width:90vw; max-height:80vh; border-radius:12px; box-shadow:0 8px 24px rgba(0,0,0,0.7);" />
<div style="color: white; margin-top: 1rem; font-size: 0.9rem; opacity: 0.8;">← swipe or use arrow keys →</div>
<span class="lightbox-close" style="position:absolute; top:20px; right:30px; font-size:2rem; color:white;">×</span>
</div>
</main>
<footer>
© 2025 SV Aion. All rights reserved.
</footer>
<script type="module">
const GITHUB_USER = 'graffjosh';
const GITHUB_REPO = 'aionWebpage';
const GITHUB_BRANCH = 'main';
const PREVIEW_FOLDER = 'images/gallery/previews';
const FULLRES_FOLDER = 'images/gallery/fullres';
const IMAGE_EXTS = /\.(jpe?g|png|gif|webp|avif)$/i;
let previewPaths = [];
let fullImagePaths = [];
let currentIndex = 0;
async function fetchRepoTree() {
const url = `https://api.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/git/trees/${GITHUB_BRANCH}?recursive=1`;
const res = await fetch(url);
if (!res.ok) throw new Error(`GitHub API error: ${res.status}`);
const json = await res.json();
return json.tree || [];
}
async function loadGallery() {
const gallery = document.getElementById('gallery');
try {
const tree = await fetchRepoTree();
const previews = tree.filter(
item => item.path.startsWith(PREVIEW_FOLDER + '/') && IMAGE_EXTS.test(item.path)
);
if (!previews.length) {
gallery.textContent = 'No images found.';
return;
}
previews.sort((a, b) => a.path.localeCompare(b.path));
gallery.innerHTML = '';
previewPaths = previews.map(p => `https://raw.githubusercontent.com/${GITHUB_USER}/${GITHUB_REPO}/${GITHUB_BRANCH}/${p.path}`);
fullImagePaths = previews.map(p => {
const filename = p.path.split('/').pop();
return `https://raw.githubusercontent.com/${GITHUB_USER}/${GITHUB_REPO}/${GITHUB_BRANCH}/${FULLRES_FOLDER}/${filename}`;
});
previewPaths.forEach((previewSrc, index) => {
const img = document.createElement('img');
img.src = previewSrc;
img.alt = previewSrc.split('/').pop().replace(/[-_]/g, ' ').replace(/\.[^/.]+$/, '');
img.loading = 'lazy';
img.addEventListener('click', () => openLightbox(index));
gallery.appendChild(img);
});
enableLightbox();
} catch (err) {
console.error(err);
gallery.textContent = 'Failed to load gallery.';
}
}
function openLightbox(index) {
currentIndex = index;
const lightbox = document.getElementById('lightbox');
const lightboxImg = document.getElementById('lightbox-img');
lightboxImg.style.opacity = 0;
lightboxImg.onload = () => {
lightboxImg.style.opacity = 1;
};
lightboxImg.src = fullImagePaths[index];
lightbox.style.display = 'flex';
}
function closeLightbox() {
const lightbox = document.getElementById('lightbox');
const lightboxImg = document.getElementById('lightbox-img');
lightbox.style.display = 'none';
lightboxImg.src = '';
}
function showNextImage() {
currentIndex = (currentIndex + 1) % fullImagePaths.length;
openLightbox(currentIndex);
}
function showPrevImage() {
currentIndex = (currentIndex - 1 + fullImagePaths.length) % fullImagePaths.length;
openLightbox(currentIndex);
}
function enableLightbox() {
const lightbox = document.getElementById('lightbox');
const lightboxImg = document.getElementById('lightbox-img');
const closeBtn = document.querySelector('.lightbox-close');
// Close on background click
lightbox.addEventListener('click', e => {
if (e.target === lightbox) closeLightbox();
});
closeBtn.addEventListener('click', closeLightbox);
// Prevent closing when clicking image
lightboxImg.addEventListener('click', e => e.stopPropagation());
// Enable keyboard navigation
document.addEventListener('keydown', e => {
if (lightbox.style.display !== 'flex') return;
if (e.key === 'ArrowRight') showNextImage();
else if (e.key === 'ArrowLeft') showPrevImage();
else if (e.key === 'Escape') closeLightbox();
});
// ✅ SWIPE SETUP: Hammer on #lightbox
if (window.Hammer) {
const hammer = new Hammer(lightbox);
hammer.get('swipe').set({ direction: Hammer.DIRECTION_HORIZONTAL });
hammer.on('swipeleft', () => {
showNextImage();
});
hammer.on('swiperight', () => {
showPrevImage();
});
console.log('Hammer.js swipe initialized on #lightbox');
} else {
console.warn('Hammer.js not loaded or unavailable');
}
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', loadGallery);
} else {
loadGallery();
}
</script>
</body>
</html>