Skip to content

Commit 9f41b3d

Browse files
authored
sdf
1 parent d6b8a97 commit 9f41b3d

1 file changed

Lines changed: 4 additions & 38 deletions

File tree

_includes/map.html

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
<style>
22
.map-wrap { position: relative; display: block; width: 100%; }
3-
4-
/* Your background map image */
53
.map-wrap img.basemap { width: 100%; display: block; }
6-
7-
/* Each pin is absolutely positioned over the map */
84
.pin {
95
position: absolute;
106
cursor: pointer;
11-
transform: translate(-50%, -100%); /* anchor at the bottom-center of the dot */
7+
transform: translate(-50%, -100%);
128
}
13-
149
.pin-dot {
1510
width: 14px; height: 14px;
1611
border-radius: 50%;
@@ -20,16 +15,14 @@
2015
transition: transform 0.18s ease;
2116
}
2217
.pin:hover .pin-dot { transform: scale(1.6); }
23-
24-
/* Tooltip balloon */
2518
.tooltip {
2619
position: absolute;
2720
background: white;
2821
border: 1px solid #ddd;
2922
border-radius: 10px;
3023
padding: 10px 12px;
3124
width: 200px;
32-
bottom: calc(100% + 10px); /* sits above the pin */
25+
bottom: calc(100% + 10px);
3326
left: 50%;
3427
transform: translateX(-50%) translateY(4px);
3528
opacity: 0;
@@ -42,13 +35,9 @@
4235
opacity: 1;
4336
transform: translateX(-50%) translateY(0);
4437
}
45-
46-
/* Small image inside tooltip */
4738
.tooltip img { width: 100%; border-radius: 6px; margin-bottom: 6px; }
4839
.tooltip h3 { margin: 0 0 4px; font-size: 14px; }
49-
.tooltip p { margin: 0; font-size: 12px; color: #666; }
50-
51-
/* Tail triangle */
40+
.tooltip p { margin: 0; font-size: 12px; color: #666; }
5241
.tail {
5342
position: absolute;
5443
bottom: -6px; left: 50%;
@@ -59,52 +48,29 @@
5948
transform: translateX(-50%) rotate(45deg);
6049
}
6150
</style>
62-
6351
<div class="map-wrap" markdown="0">
6452
<img class="basemap" src="/images/testmap.jpg" alt="World map" />
65-
66-
<!-- Pin: left/top are % of the map image dimensions -->
6753
<div class="pin" style="left: 10%; top: 30%;">
6854
<div class="tooltip">
6955
<img src="/images/travels/lawncrush exp.png" alt="EXPERI" />
7056
<h3>Vancouver, Canada</h3>
71-
<p>Testing an experiment idealsdfsoidfj sfj fit this all</p>
57+
<p>Testing an experiment idealsdfsoidfj dskfjjnsdfn sdkjfnsf can this fit?</p>
7258
<div class="tail"></div>
7359
</div>
7460
<div class="pin-dot"></div>
7561
</div>
76-
77-
<div class="pin" style="left: 55%; top: 88%;">
78-
<div class="tooltip">
79-
<img src="/images/travels/NA" alt="NA" />
80-
<h3>another place</h3>
81-
<p>second pin</p>
82-
<div class="tail"></div>
83-
</div>
84-
<div class="pin-dot"></div>
85-
</div>
86-
87-
88-
<!-- Add more pins here -->
8962
</div>
9063

91-
92-
93-
<!-- extra bit for mobile click/hover functionality -->
9464
<script>
9565
document.querySelectorAll('.pin').forEach(pin => {
9666
pin.addEventListener('click', function(e) {
9767
e.stopPropagation();
98-
// Close any other open pins first
9968
document.querySelectorAll('.pin.active').forEach(p => {
10069
if (p !== pin) p.classList.remove('active');
10170
});
102-
// Toggle this one
10371
pin.classList.toggle('active');
10472
});
10573
});
106-
107-
// Tap anywhere else on the map to close all tooltips
10874
document.addEventListener('click', () => {
10975
document.querySelectorAll('.pin.active').forEach(p => p.classList.remove('active'));
11076
});

0 commit comments

Comments
 (0)