-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
710 lines (665 loc) · 37.2 KB
/
index.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
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
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>A Guide to Cycling Through South Korea</title>
<link rel="preload" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap" as="style">
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<script src='https://api.mapbox.com/mapbox-gl-js/v3.7.0/mapbox-gl.js'></script>
<link href='https://api.mapbox.com/mapbox-gl-js/v3.7.0/mapbox-gl.css' rel='stylesheet' />
<script src='https://unpkg.com/@mapbox/[email protected]/togeojson.js'></script>
<style>
body {
margin: 0;
padding: 0;
font-family: 'Poppins';
background-color: #EFEEE6; /* Or any color you prefer for the background */
min-height: 100vh;
display: flex;
flex-direction: column;
}
.main-container {
flex-grow: 1;
display: flex;
flex-direction: column;
padding: 20px; /* Adjust as needed */
}
#header {
height: 26vh;
background-color: #EFEEE6;
color: black;
padding: 15px;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: space-between;
}
#title {
font-size: 25px;
font-weight: bold;
margin-bottom: 5px;
text-align: center;
}
#subtitle {
font-size: 16px;
font-weight: bold;
margin-bottom: 20px;
text-align: center;
}
#footer {
font-size: 12px;
text-align: right;
width: 97.5%;
}
a {
color: #177E24;
text-decoration: none;
transition: color 0.3s ease;
}
a:hover {
color: #FBD3D4;
text-decoration: underline;
}
.image-container {
display: flex;
justify-content: center;
align-items: center;
height: 50%; /* Adjust this if you want a specific height */
}
.image-container img {
max-width: 100%;
height: auto;
}
#nav {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 10px;
margin-bottom: 10px;
padding: 0 5%;
}
.nav-item {
background-color: #efd86d;
color: black;
border: none;
padding: 8px 16px;
cursor: pointer;
font-size: 14px;
border-radius: 5px;
font-family: 'Poppins', sans-serif;
flex: 1;
min-width: 80px;
}
.nav-item:hover {
background-color: #E8D721;
}
#map-container {
width: 95%; /* Adjust this percentage as needed */
height: 70vh; /* Adjust this value as needed */
margin: 0 auto; /* Centers the map horizontally */
border: 0.5px solid black;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
#map {
width: 100%;
height: 100%;
}
#map::after {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background:
url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo9/WUMZHlgr4Bg8Z4qQgQJlHI4A8SzFVrapvmTF9O7dmYRFZ60YiBhJRCgh1FYhiLAmdvX0CzTOpNE77ME0Zty/nWWzchDtiqrmQDeuv3powQ5ta2eN0FY0InkqDD73lT9c9lEzwUNqgFHs9VQce3TVClFCQrSTfOiYkVJQBmpbq2L6iZavPnAP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eqjK/piF5bklq77VSEaA+z8qmJTFzIWiitbnzR794USKBUaT0NTEsVjZqLaFVqJoPN9ODG70IPbfBHKK+/q/AWR0tJzYHRULOa4MP+W/HfGadZUbfw177G7j/OGbIs8TahLyynl4X4RinF793Oz+BU0saXtUHrVBFT/DnA3ctNPoGbs4hRIjTok8i+algT1lTHi4SxFvONKNrgQFAq2/gFnWMXgwffgYMJpiKYkmW3tTg3ZQ9Jq+f8XN+A5eeUKHWvJWJ2sgJ1Sop+wwhqFVijqWaJhwtD8MNlSBeWNNWTa5Z5kPZw5+LbVT99wqTdx29lMUH4OIG/D86ruKEauBjvH5xy6um/Sfj7ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhSnO3Wp/3fEV5a+4wz//6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg=='),
linear-gradient(rgba(255,255,240,0.3), rgba(255,255,240,0.3));
pointer-events: none;
}
.mapboxgl-popup {
max-width: 400px;
z-index: 2;
}
.mapboxgl-popup-content {
text-align: center;
font-family: 'Poppins', sans-serif;
background-color: #EFEEE6; /* Light parchment color */
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
.mapboxgl-popup-content::after {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background:
url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo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c0Ro2jJfxC50ApuxGob7lMsxfTbeUv07TyYxpeLucEH1gNd4IKH2LAg5TdVhlCafZvpskfncCfx8pOhJzd76bJWeYFnFciwcYfubRc12Ip/ppIhA1/mSZ/RxjFDrJC5xifFjJpY2Xl5zXdguFqYyTR1zSp1Y9p+tktDYYSNflcxI0iyO4TPBdlRcpeqjK/piF5bklq77VSEaA+z8qmJTFzIWiitbnzR794USKBUaT0NTEsVjZqLaFVqJoPN9ODG70IPbfBHKK+/q/AWR0tJzYHRULOa4MP+W/HfGadZUbfw177G7j/OGbIs8TahLyynl4X4RinF793Oz+BU0saXtUHrVBFT/DnA3ctNPoGbs4hRIjTok8i+algT1lTHi4SxFvONKNrgQFAq2/gFnWMXgwffgYMJpiKYkmW3tTg3ZQ9Jq+f8XN+A5eeUKHWvJWJ2sgJ1Sop+wwhqFVijqWaJhwtD8MNlSBeWNNWTa5Z5kPZw5+LbVT99wqTdx29lMUH4OIG/D86ruKEauBjvH5xy6um/Sfj7ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhSnO3Wp/3fEV5a+4wz//6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg=='),
linear-gradient(rgba(255,255,240,0.3), rgba(255,255,240,0.3));
pointer-events: none;
z-index: -1; /* Place the texture behind the content */
}
.bicycle-popup {
min-width: 300px;
max-width: 350px;
}
.photo-popup {
max-width: 350px;
}
.photo-popup.portrait {
max-width: 225px;
}
.photo-popup img {
width: 100%;
height: auto;
display: block;
}
.photo-popup p {
margin: 10px 0 0;
font-family: 'Poppins', sans-serif;
}
.marker {
background-image: url('https://placekitten.com/g/40/40');
background-size: cover;
width: 40px;
height: 40px;
border-radius: 50%;
cursor: pointer;
}
.bicycle-icon,
.photo-marker {
width: 40px;
height: 40px;
cursor: pointer;
/* color: #187e24; */
transition: color 0.3s ease;
}
.bicycle-icon:hover,
.photo-marker:hover {
color: #187e24;
}
@media (max-width: 768px) {
#title { font-size: 18px; }
#subtitle { font-size: 12px; }
.nav-item { font-size: 12px; padding: 6px 12px; }
#map-container { height: 50vh; }
#map-container { margin-top: 40px; /* Add space above map on medium screens */}
}
@media (max-width: 480px) {
#title { font-size: 16px; }
#subtitle { font-size: 10px; }
#nav {
margin-bottom: 20px; /* Increase space below buttons on small screens */
}
.nav-item {
font-size: 10px;
padding: 4px 8px;
flex: 0 1 calc(50% - 5px);
min-width: 40px;
}
#map-container {
height: 40vh;
margin-top: 20px; /* Add space above map on small screens */
}
#map-container {margin-top: 50px; /* Add more space above map on small screens */}
}
</style>
</head>
<body>
<div id="header">
<div>
<div class="image-container">
<img src="design/Artboard 1.png" alt="4 Rivers Trail Logo" style="max-width: 200px; width: 100%;">
</div>
<div id="title">4 Rivers Trail: A guide to cycling 650 km through South Korea</div>
<div id="subtitle">Click on each day for information about the route, distance, elevation, photos captured, and lessons learned along the trail</div>
</div>
<div id="nav">
<button class="nav-item" onclick="day1()">Day 1</button>
<button class="nav-item" onclick="day2()">Day 2</button>
<button class="nav-item" onclick="day3()">Day 3</button>
<button class="nav-item" onclick="day4()">Day 4</button>
<button class="nav-item" onclick="day5()">Day 5</button>
<button class="nav-item" onclick="day6()">Day 6</button>
<button class="nav-item" onclick="day7()">Day 7</button>
<button class="nav-item" onclick="day8()">Day 8</button>
<button class="nav-item" onclick="viewAll()">View All</button>
</div>
</div>
<div id="map-container">
<div id='map'></div>
</div>
<script>
mapboxgl.accessToken = 'pk.eyJ1IjoiY2hyaXN0aW5hbXlsaSIsImEiOiJjbHhlbGozODUwamVwMmpwb25lczYzejBkIn0.CrDVGZ9z2qtrtfgG6TBcYg';
var map = new mapboxgl.Map({
container: 'map',
// style: 'mapbox://styles/mapbox/light-v10',
style: 'mapbox://styles/christinamyli/cm211woz5004r01p39ih9cgzd',
center: [127.7669, 36.3],
zoom: 7,
minZoom: 7
});
var routeBounds = new mapboxgl.LngLatBounds();
var allRoutesLoaded = false;
function day1() { loadAndDisplayRoute(1); }
function day2() { loadAndDisplayRoute(2); }
function day3() { loadAndDisplayRoute(3); }
function day4() { loadAndDisplayRoute(4); }
function day5() { loadAndDisplayRoute(5); }
function day6() { loadAndDisplayRoute(6); }
function day7() { loadAndDisplayRoute(7); }
function day8() { loadAndDisplayRoute(8); }
map.on('load', function() {
map.addLayer({
'id': 'parchment-overlay',
'type': 'background',
'paint': {
'background-color': 'rgba(210, 180, 140, 0.1)'
}
});
loadAllRoutes();
});
function loadAllRoutes() {
for (let day = 1; day <= 8; day++) {
fetch(`data/gpx/day${day}.gpx`)
.then(response => response.text())
.then(gpxData => {
const gpxDoc = new DOMParser().parseFromString(gpxData, 'text/xml');
const geoJSON = toGeoJSON.gpx(gpxDoc);
map.addSource(`day${day}`, {
type: 'geojson',
data: geoJSON
});
map.addLayer({
id: `day${day}-line`,
type: 'line',
source: `day${day}`,
layout: {
'line-join': 'round',
'line-cap': 'round'
},
paint: {
'line-color': '#DDCA00',
'line-width': 5
}
});
geoJSON.features[0].geometry.coordinates.forEach(coord => {
routeBounds.extend(coord);
});
loadedRoutes++;
if (loadedRoutes === 8) {
allRoutesLoaded = true;
updateMapView();
}
})
.catch(error => console.error(`Error loading day ${day} route:`, error));
}
}
function loadAndDisplayRoute(day) {
for (let i = 1; i <= 8; i++) {
if (map.getLayer(`day${i}-line`)) {
map.setLayoutProperty(`day${i}-line`, 'visibility', i === day ? 'visible' : 'none');
}
}
if (map.getSource(`day${day}`)) {
const bounds = new mapboxgl.LngLatBounds();
map.getSource(`day${day}`)._data.features[0].geometry.coordinates.forEach(coord => {
bounds.extend(coord);
});
map.fitBounds(bounds, { padding: 50 });
}
map.setPaintProperty(`day${day}-line`, 'line-width', 8);
}
function fitMapToAllRoutes() {
const bounds = new mapboxgl.LngLatBounds();
for (let day = 1; day <= 8; day++) {
if (map.getSource(`day${day}`)) {
map.getSource(`day${day}`)._data.features[0].geometry.coordinates.forEach(coord => {
bounds.extend(coord);
});
}
}
map.fitBounds(bounds, { padding: 50 });
}
function viewAll() {
for (let i = 1; i <= 8; i++) {
if (map.getLayer(`day${i}-line`)) {
map.setLayoutProperty(`day${i}-line`, 'visibility', 'visible');
// Reset line width to original value
map.setPaintProperty(`day${i}-line`, 'line-width', 5);
}
}
fitMapToAllRoutes();
}
const dayData = [
{
day: 1,
bicycles: [
{ coordinates: [126.60395, 37.55691], popupContent: '<h3>Day 1 Starting Point: Incheon</h3><p>Ara West Sea Lock in Cheongna International City, Incheon is the start of the 4 Rivers Trail. <br><br> A big tip here is to take a jumbo taxi with your bicycle from Incheon Airport. It is a hassle otherwise to get out of the island where the airport is, such as by ferry or subway. (Learned the hard way!)<br><br>Visit Ara Tower to pick up a Bicycle Passport where you can get stamps along the trail.</p>' },
{ coordinates: [127.10176, 37.52360], popupContent: '<p>We crossed Jamsil Bridge to the other side of the river to stay at a hotel in Guri. The other option would have been to stay on the trail and sleep overnight in Hanam. Both Guri and Hanam are around the same distance from Incheon and are comparably small and quiet towns.<br><br> According to Wikipedia, Guri has a population of 192,000 and Hanam has a population of 279,000.</p>' },
{ coordinates: [127.1371380, 37.5983450], popupContent: '<h3>Day 1 Ending Point: Guri</h3>' },
// Add more bicycle markers for day 1 as needed
],
photos: [
{ coordinates: [126.63724, 37.56938], imageUrl: 'photos/day1/photo1.jpg', caption: 'Most of the route early on takes you through parks like this.' },
{ coordinates: [126.70359, 37.57140], imageUrl: 'photos/day1/photo2.jpg', caption: 'Aramaru Rest Area & waterfall' },
{ coordinates: [126.73873, 37.57285], imageUrl: 'photos/day1/photo3.jpg', caption: 'There is a man along the trail who regularly repairs bikes for free. (Even if you offer him money for his services, he will not accept it.)'},
{ coordinates: [126.80031, 37.59877], imageUrl: 'photos/day1/photo4.jpg', caption: 'Keep on eye out for red phone booths along the bike trail where you can collect stamps for your Bicycle Passport.' },
{ coordinates: [126.84076, 37.57647], imageUrl: 'photos/day1/photo5.jpg' },
{ coordinates: [126.92885, 37.53057], imageUrl: 'photos/day1/photo6.jpg', caption: 'Mulbit Square in Yeouido Hangang Park' },
{ coordinates: [126.99576, 37.51077], imageUrl: 'photos/day1/photo7.jpg', caption: 'Banpo Hangang Park - while we were there, they set up a Starbucks Frappucino Fun Island which was...interesting, but otherwise it is a nice place to sit along the Han River and rest.' },
{ coordinates: [127.14059, 37.60400], imageUrl: 'photos/day1/photo8.jpg', caption: 'Fun fact: Guri is the site of the first Tous Les Jours bakery every opened!' },
// Add more photo markers for day 1 as needed
]
},
{
day: 2,
bicycles: [
{ coordinates: [127.1372720, 37.5982080], popupContent: '<h3>Day 2 Starting Point: Guri</h3>' },
{ coordinates: [127.23450, 37.54348], popupContent: 'This is where Paldang Bridge is, a good place for cyclists to rest with cafes and restaurants in this area.' },
{ coordinates: [127.6553290, 37.2996340], popupContent: '<h3>Day 2 Ending Point: Yeoju</h3>' }
],
photos: [
{ coordinates: [127.15324, 37.59692], imageUrl: 'photos/day2/photo1.jpg' },
{ coordinates: [127.17443, 37.58609], imageUrl: 'photos/day2/photo2.jpg', caption: 'Climb 1 of 2 of the day. The good news is at the top of the hill there is a cafe called 632 Dessert Cafe where you can rest and grab a treat!<br><br>Elevation: 206 ft | 62 m<br>Distance: 0.9 mi | 1.4 km' },
// { coordinates: [127.17538, 37.58656], imageUrl: '/photos/day2/photo3.jpg' },
{ coordinates: [127.23503, 37.55829], imageUrl: 'photos/day2/photo4.jpg', caption: 'A gorgeous flower field - there are also some restaurants overlooking the field if you want to rest here.' },
{ coordinates: [127.28741, 37.52508], imageUrl: 'photos/day2/photo5.jpg', caption: 'Or bike a little bit more and you will find another rest stop for cyclists with a few cafes around.' },
{ coordinates: [127.31302, 37.55235], imageUrl: 'photos/day2/photo6.jpg', caption: 'Crossing Yangpyeong Bridge.' },
{ coordinates: [127.32862, 37.54570], imageUrl: 'photos/day2/photo7.jpg', caption: 'Velo Lounge, another rest stop designed for cyclists. This is where the rest stops come to an end for the most part, as we saw fewer cyclists the further away from Seoul we biked.' },
{ coordinates: [127.39015, 37.51113], imageUrl: 'photos/day2/photo8.jpg' },
{ coordinates: [127.49384, 37.48497], imageUrl: 'photos/day2/photo9.jpg' },
{ coordinates: [127.51473, 37.44280], imageUrl: 'photos/day2/photo10.jpg', caption: 'Climb 2 of 2.<br><br>Elevation: 328 ft | 100 m<br>Distance: 0.5 mi | 0.8 m'},
// { coordinates: [127.53283, 37.43388], imageUrl: '/photos/day2/photo11.jpg'},
{ coordinates: [127.52919, 37.43454], imageUrl: 'photos/day2/photo12.jpg', caption: 'Not pictured here but there is a soccer field along the trail. Imagine playing soccer next to the river during sunset - a dream!'},
{ coordinates: [127.54190, 37.40752], imageUrl: 'photos/day2/photo13.jpg'},
{ coordinates: [127.54794, 37.39270], imageUrl: 'photos/day2/photo14.jpg', caption: 'This is what they call an auto camping leisure site. People will come in their cars and then hang out in one of these tents. There are a few sites like these along the trail.'},
]
},
{
day: 3,
bicycles: [
{ coordinates: [127.6552380, 37.2995600], popupContent: '<h3>Day 3 Starting Point: Yeoju</h3>' },
{ coordinates: [127.7235566, 37.2455033], popupContent: 'Climb 1 of 5.<br><br>Elevation: 257 ft | 78 m<br>Distance: 1.4 mi | 2.2 km' },
{ coordinates: [127.75772, 37.1660366], popupContent: 'Climb 2 of 5: Gangcheon-ri. This one is a short, but steep one!<br><br>Elevation: 131 ft | 40 m<br>Distance: 0.1 mi | 0.2 km' },
{ coordinates: [127.8158866, 37.0995783], popupContent: 'Climb 3 of 5.<br><br>Elevation: 274 ft | 84 m<br>Distance: 1 mi | 1.6 km' },
{ coordinates: [127.8786233, 37.0714233], popupContent: 'Climb 4 of 5.<br><br>Elevation: 217 ft | 66 m<br>Distance: 0.3 mi | 0.5 km' },
{ coordinates: [127.8685816, 37.0488733], popupContent: 'Climb 5 of 5.<br><br>Elevation: 262 ft | 80 m<br>Distance: 0.5 mi | 0.8 km' },
{ coordinates: [127.9288070, 36.9882480], popupContent: '<h3>Day 3 Ending Point: Chungju</h3>' },
],
photos: [
{ coordinates: [127.66114, 37.29399], imageUrl: 'photos/day3/photo1.jpg', caption: 'Yeoju Sileuksa Temple' },
{ coordinates: [127.68100, 37.27721], imageUrl: 'photos/day3/photo2.jpg', caption: 'Han River Culture Pavilion' },
{ coordinates: [127.68682, 37.25218], imageUrl: 'photos/day3/photo3.jpg' },
{ coordinates: [127.69406, 37.23446], imageUrl: 'photos/day3/photo4.jpg', caption: 'Gangcheon Island Healing Center' },
{ coordinates: [127.74806, 37.23169], imageUrl: 'photos/day3/photo5.jpg' },
{ coordinates: [127.78755, 37.13155], imageUrl: 'photos/day3/photo6.jpg', caption:'Jagyejeong Schwimteo (Cafe)' },
{ coordinates: [127.80952, 37.11049], imageUrl: 'photos/day3/photo7.jpg', caption:'Bindeseom Schwimteo (Cafe)' },
{ coordinates: [127.87286, 37.07566], imageUrl: 'photos/day3/photo8.jpg' },
{ coordinates: [127.86562, 37.03616], imageUrl: 'photos/day3/photo9.jpg' },
{ coordinates: [127.92959, 36.98826], imageUrl: 'photos/day3/photo10.jpg', caption:'We were in Chungju during Chuseok, a major Korean holiday, and were pleasantly surprised to see how lively it was. Plenty of restaurants and cafes open.' },
]
},
{
day: 4,
bicycles: [
{ coordinates: [127.9288070, 36.9882480], popupContent: '<h3>Day 4 Starting Point: Chungju</h3>' },
{ coordinates: [127.9948916, 36.8455649], popupContent: 'Climb 1 of 2 - be prepared for very long climbs ahead.<br><br>Elevation: 1,233 ft | 376 m<br>Distance: 3.9 mi | 6.3 km' },
{ coordinates: [128.0031966, 36.76737], popupContent: 'Climb 2 of 2 - the most insane climb of my life. It felt like it was never going to come to an end. I made it without stopping with only 500 m left to go.<br><br>Elevation: 1,720 ft | 524 m<br>Distance: 3.5 mi | 5.6 km' },
{ coordinates: [128.1938910, 36.5866620], popupContent: '<h3>Day 4 Ending Point: Mungyeong</h3>' }
],
photos: [
{ coordinates: [127.89125, 36.94780], imageUrl: 'photos/day4/photo1.jpg', caption: 'We saw many golf courses along the trail. People were out playing no matter the heat or the rain.' },
{ coordinates: [127.89318, 36.94336], imageUrl: 'photos/day4/photo2.jpg', caption: 'Many cafes right outside of Chungju. Something to keep in mind is that there are fewer as you ride along the trail.' },
{ coordinates: [127.91476, 36.91415], imageUrl: 'photos/day4/photo6.jpg' },
{ coordinates: [127.93332, 36.88789], imageUrl: 'photos/day4/photo4.jpg' },
{ coordinates: [127.97214, 36.86554], imageUrl: 'photos/day4/photo7.jpg' },
{ coordinates: [127.97952, 36.85161], imageUrl: 'photos/day4/photo8.jpg' },
{ coordinates: [127.98928, 36.84866], imageUrl: 'photos/day4/photo9.jpg' },
{ coordinates: [128.01630, 36.78571], imageUrl: 'photos/day4/photo10.jpg' },
{ coordinates: [128.03175, 36.75193], imageUrl: 'photos/day4/photo12.jpg', caption: 'View from the top of the mountain! You can see how high we climbed looking at the roads below.' },
{ coordinates: [128.11165, 36.72495], imageUrl: 'photos/day4/photo13.jpg' },
{ coordinates: [128.21231, 36.60282], imageUrl: 'photos/day4/photo14.jpg' },
]
},
{
day: 5,
bicycles: [
{ coordinates: [128.1938910, 36.5866620], popupContent: '<h3>Day 5 Starting Point: Mungyeong</h3>' },
{ coordinates: [128.4193740, 36.1093040], popupContent: '<h3>Day 5 Ending Point: Gumi</h3>' }
],
photos: [
{ coordinates: [128.21922, 36.53516], imageUrl: 'photos/day5/photo1.jpg' },
{ coordinates: [128.24608, 36.46971], imageUrl: 'photos/day5/photo2.jpg' },
{ coordinates: [128.24329, 36.46605], imageUrl: 'photos/day5/photo3.jpg' },
// { coordinates: [128.24060, 36.45763], imageUrl: 'photos/day5/photo4.jpg' },
// { coordinates: [128.24078, 36.45726], imageUrl: 'photos/day5/photo5.jpg' },
{ coordinates: [128.24358, 36.45567], imageUrl: 'photos/day5/photo6.jpg' },
// { coordinates: [128.24768, 36.45623], imageUrl: 'photos/day5/photo7.jpg' },
{ coordinates: [128.25570, 36.45333], imageUrl: 'photos/day5/photo8.jpg', caption: 'Sangju Bicycle Museum'},
// { coordinates: [128.25572, 36.45358], imageUrl: 'photos/day5/photo9.jpg', caption: 'Sangju really loves its bicycles. Across the street from the Bicycle Museum was a bicycle bridge!'},
{ coordinates: [128.25850, 36.45442], imageUrl: 'photos/day5/photo10.jpg'},
// { coordinates: [128.25740, 36.44932], imageUrl: 'photos/day5/photo11.jpg'},
{ coordinates: [128.25630, 36.44636], imageUrl: 'photos/day5/photo12.jpg'},
{ coordinates: [128.25641, 36.44076], imageUrl: 'photos/day5/photo13.jpg'},
{ coordinates: [128.30869, 36.36490], imageUrl: 'photos/day5/photo14.jpg'},
{ coordinates: [128.30289, 36.35662], imageUrl: 'photos/day5/photo15.jpg'},
{ coordinates: [128.32542, 36.30229], imageUrl: 'photos/day5/photo16.jpg'},
{ coordinates: [128.38930, 36.16447], imageUrl: 'photos/day5/photo17.jpg'},
{ coordinates: [128.38495, 36.14971], imageUrl: 'photos/day5/photo18.jpg'},
]
},
{
day: 6,
bicycles: [
{ coordinates: [128.4193740, 36.1093040], popupContent: '<h3>Day 6 Starting Point: Gumi</h3>' },
{ coordinates: [128.4897710, 35.8361590], popupContent: '<h3>Day 6 Ending Point: Daegu</h3>' }
],
photos: [
{ coordinates: [128.40123, 36.08787], imageUrl: 'photos/day6/photo1.jpg' },
{ coordinates: [128.40918, 35.90570], imageUrl: 'photos/day6/photo2.jpg' },
{ coordinates: [128.40979, 35.85694], imageUrl: 'photos/day6/photo3.jpg' },
{ coordinates: [128.46284, 35.84198], imageUrl: 'photos/day6/photo4.jpg' },
{ coordinates: [128.46745, 35.83866], imageUrl: 'photos/day6/photo6.jpg' },
// { coordinates: [128.59409, 35.86289], imageUrl: 'photos/day6/photo7.jpg' },
]
},
{
day: 7,
bicycles: [
{ coordinates: [128.4897710, 35.8361590], popupContent: '<h3>Day 7 Starting Point: Daegu</h3>' },
{ coordinates: [128.4745870, 35.3923670], popupContent: '<h3>Day 7 Ending Point: Changnyeong</h3>' }
],
photos: [
{ coordinates: [128.49219, 35.82321], imageUrl: 'photos/day7/photo1.jpg' },
{ coordinates: [128.47904, 35.80876], imageUrl: 'photos/day7/photo2.jpg' },
{ coordinates: [128.46977, 35.80478], imageUrl: 'photos/day7/photo3.jpg' },
{ coordinates: [128.40674, 35.77996], imageUrl: 'photos/day7/photo4.jpg' },
{ coordinates: [128.39400, 35.75250], imageUrl: 'photos/day7/photo5.jpg' },
{ coordinates: [128.43413, 35.72590], imageUrl: 'photos/day7/photo6.jpg' },
{ coordinates: [128.43636, 35.71629], imageUrl: 'photos/day7/photo7-b.jpg' },
{ coordinates: [128.37227, 35.70144], imageUrl: 'photos/day7/photo9-b.jpg' },
{ coordinates: [128.37186, 35.70107], imageUrl: 'photos/day7/photo13.jpg' },
{ coordinates: [128.37169, 35.70240], imageUrl: 'photos/day7/photo14.jpg' },
{ coordinates: [128.36408, 35.70377], imageUrl: 'photos/day7/photo15.jpg' },
{ coordinates: [128.36376, 35.70370], imageUrl: 'photos/day7/photo16.jpg' },
{ coordinates: [128.40396, 35.63989], imageUrl: 'photos/day7/photo17.jpg' },
{ coordinates: [128.40347, 35.63143], imageUrl: 'photos/day7/photo18.jpg' },
{ coordinates: [128.39949, 35.62904], imageUrl: 'photos/day7/photo19.jpg' },
{ coordinates: [128.39949, 35.62904], imageUrl: 'photos/day7/photo20.jpg' },
{ coordinates: [128.36146, 35.59096], imageUrl: 'photos/day7/photo21.jpg' },
{ coordinates: [128.34080, 35.56990], imageUrl: 'photos/day7/photo22.jpg' },
{ coordinates: [128.35861, 35.52698], imageUrl: 'photos/day7/photo23.jpg' },
{ coordinates: [128.36845, 35.45445], imageUrl: 'photos/day7/photo24.jpg' },
{ coordinates: [128.39395, 35.42919], imageUrl: 'photos/day7/photo25.jpg' },
{ coordinates: [128.42008, 35.43538], imageUrl: 'photos/day7/photo26.jpg' },
{ coordinates: [128.47919, 35.38596], imageUrl: 'photos/day7/photo27.jpg' },
]
},
{
day: 8,
bicycles: [
{ coordinates: [128.4745870, 35.3923670], popupContent: '<h3>Day 8 Starting Point: Changnyeong</h3>' },
{ coordinates: [128.94804, 35.10832], popupContent: '<h3>Day 8 Starting Point: Busan</h3>' }
],
photos: [
{ coordinates: [128.47336, 35.37927], imageUrl: 'photos/day8/photo1.jpg' },
{ coordinates: [128.47584, 35.37847], imageUrl: 'photos/day8/photo2.jpg' },
{ coordinates: [128.52160, 35.38159], imageUrl: 'photos/day8/photo3.jpg' },
{ coordinates: [128.59503, 35.39518], imageUrl: 'photos/day8/photo4.jpg' },
{ coordinates: [128.59627, 35.39610], imageUrl: 'photos/day8/photo5.jpg' },
{ coordinates: [128.63927, 35.37687], imageUrl: 'photos/day8/photo6.jpg' },
{ coordinates: [128.67076, 35.37282], imageUrl: 'photos/day8/photo7.jpg' },
{ coordinates: [128.81027, 35.35217], imageUrl: 'photos/day8/photo9.jpg' },
{ coordinates: [128.82205, 35.38385], imageUrl: 'photos/day8/photo10.jpg' },
{ coordinates: [128.82400, 35.38495], imageUrl: 'photos/day8/photo12.jpg' },
// { coordinates: [128.82400, 35.38495], imageUrl: 'photos/day8/photo11.jpg' },
{ coordinates: [128.82622, 35.38510], imageUrl: 'photos/day8/photo13.jpg' },
{ coordinates: [128.87170, 35.39041], imageUrl: 'photos/day8/photo14.jpg' },
{ coordinates: [129.01775, 35.27141], imageUrl: 'photos/day8/photo15.jpg' },
{ coordinates: [129.01038, 35.25542], imageUrl: 'photos/day8/photo16.jpg' },
{ coordinates: [129.00833, 35.25114], imageUrl: 'photos/day8/photo17.jpg' },
{ coordinates: [129.00307, 35.22857], imageUrl: 'photos/day8/photo18.jpg' },
// { coordinates: [129.06613, 35.15674], imageUrl: 'photos/day8/photo20.jpg' },
{ coordinates: [128.98283, 35.16366], imageUrl: 'photos/day8/photo21.jpg' },
]
},
];
let bicycleIcons = [];
let photoMarkers = [];
function addBicycleIcons(day) {
removeBicycleIcons();
dayData[day - 1].bicycles.forEach(bicycle => {
const el = document.createElement('div');
el.className = 'bicycle-icon';
el.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="5.5" cy="17.5" r="3.5"/>
<circle cx="18.5" cy="17.5" r="3.5"/>
<path d="M15 6a1 1 0 100-2 1 1 0 000 2zm-3 11.5V14l-3-3 4-3 2 3h2"/>
</svg>`;
const popup = new mapboxgl.Popup({
offset: 25,
// closeButton: false,
closeOnClick: false,
className: 'bicycle-popup'
}).setHTML(bicycle.popupContent);
const marker = new mapboxgl.Marker(el)
.setLngLat(bicycle.coordinates)
.setPopup(popup)
.addTo(map);
marker.getElement().addEventListener('click', (e) => {
e.stopPropagation();
if (marker.getPopup().isOpen()) {
marker.getPopup().remove();
} else {
marker.togglePopup();
}
});
bicycleIcons.push(marker);
});
}
function addPhotoMarkers(day) {
removePhotoMarkers();
dayData[day - 1].photos.forEach(photo => {
const el = document.createElement('div');
el.className = 'photo-marker';
el.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"></path><circle cx="12" cy="13" r="4"></circle></svg>`;
const popup = new mapboxgl.Popup({
offset: 25,
maxWidth: 'none',
// closeButton: false,
closeOnClick: false
}).setHTML(`
<div class="photo-popup">
<img src="${photo.imageUrl}" alt="Day ${day} Photo" onload="this.parentElement.className='photo-popup ' + (this.naturalWidth > this.naturalHeight ? 'landscape' : 'portrait')">
<p class="photo-caption">${photo.caption || ''}</p>
</div>
`);
const marker = new mapboxgl.Marker(el)
.setLngLat(photo.coordinates)
.setPopup(popup)
.addTo(map);
marker.getElement().addEventListener('click', (e) => {
e.stopPropagation();
if (marker.getPopup().isOpen()) {
marker.getPopup().remove();
} else {
marker.togglePopup();
}
});
photoMarkers.push(marker);
});
}
function removeBicycleIcons() {
bicycleIcons.forEach(marker => marker.remove());
bicycleIcons = [];
}
function removePhotoMarkers() {
photoMarkers.forEach(marker => marker.remove());
photoMarkers = [];
}
function displayDay(day) {
loadAndDisplayRoute(day);
addBicycleIcons(day);
addPhotoMarkers(day);
}
// Day functions remain the same
function day1() { displayDay(1); }
function day2() { displayDay(2); }
function day3() { displayDay(3); }
function day4() { displayDay(4); }
function day5() { displayDay(5); }
function day6() { displayDay(6); }
function day7() { displayDay(7); }
function day8() { displayDay(8); }
function viewAll() {
for (let i = 1; i <= 8; i++) {
if (map.getLayer(`day${i}-line`)) {
map.setLayoutProperty(`day${i}-line`, 'visibility', 'visible');
map.setPaintProperty(`day${i}-line`, 'line-width', 5);
}
}
removeBicycleIcons();
removePhotoMarkers();
fitMapToAllRoutes();
}
function updateMapView() {
var width = window.innerWidth;
if (width <= 480) {
// For mobile
map.setMinZoom(5); // Allow further zoom out on mobile
map.easeTo({
center: [127.7669, 36.3],
zoom: 5.5,
duration: 0
});
} else if (width <= 768) {
// For tablets
map.setMinZoom(6); // Allow some zoom out on tablets
map.easeTo({
center: [127.7669, 36.3],
zoom: 6.5,
duration: 0
});
} else {
// For desktop
map.setMinZoom(7); // Restore minZoom to 7 for desktop
map.easeTo({
center: [127.7669, 36.3],
zoom: 7,
duration: 0
});
}
}
map.on('load', updateMapView);
window.addEventListener('resize', updateMapView);
</script>
<footer id="footer">
© Designed and coded by <a href="https://christinamyli.com">Christina Li</a>.
<br>
Photos taken on Fujifilm X100F, Olympus XA2, and iPhone 15 Pro.
<!-- Style inspired by <a href="https://tabacobooks.kr/">Tabaco Books</a> located in Daegu, South Korea. -->
</footer>
</body>
</html>