Skip to content

Commit 048ce51

Browse files
authored
css fixes maybe
1 parent 30466c1 commit 048ce51

3 files changed

Lines changed: 91 additions & 52 deletions

File tree

_includes/map.html

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,114 @@
1-
<div class="map-wrap" markdown="0">
1+
<style>
2+
.map-wrap { position: relative; display: block; width: 100%; }
3+
4+
/* Your background map image */
5+
.map-wrap img.basemap { width: 100%; display: block; }
6+
7+
/* Each pin is absolutely positioned over the map */
8+
.pin {
9+
position: absolute;
10+
cursor: pointer;
11+
transform: translate(-50%, -100%); /* anchor at the bottom-center of the dot */
12+
}
13+
14+
.pin-dot {
15+
width: 14px; height: 14px;
16+
border-radius: 50%;
17+
background: #e24b4a;
18+
border: 2.5px solid white;
19+
box-shadow: 0 1px 4px rgba(0,0,0,0.3);
20+
transition: transform 0.18s ease;
21+
}
22+
.pin:hover .pin-dot { transform: scale(1.6); }
23+
24+
/* Tooltip balloon */
25+
.tooltip {
26+
position: absolute;
27+
background: white;
28+
border: 1px solid #ddd;
29+
border-radius: 10px;
30+
padding: 10px 12px;
31+
width: 200px;
32+
bottom: calc(100% + 10px); /* sits above the pin */
33+
left: 50%;
34+
transform: translateX(-50%) translateY(4px);
35+
opacity: 0;
36+
transition: opacity 0.18s ease, transform 0.18s ease;
37+
pointer-events: none;
38+
z-index: 100;
39+
box-shadow: 0 4px 12px rgba(0,0,0,0.12);
40+
}
41+
.pin:hover .tooltip {
42+
opacity: 1;
43+
transform: translateX(-50%) translateY(0);
44+
}
45+
46+
/* Small image inside tooltip */
47+
.tooltip img { width: 100%; border-radius: 6px; margin-bottom: 6px; }
48+
.tooltip h3 { margin: 0 0 4px; font-size: 14px; }
49+
.tooltip p { margin: 0; font-size: 12px; color: #666; }
50+
51+
/* Tail triangle */
52+
.tail {
53+
position: absolute;
54+
bottom: -6px; left: 50%;
55+
width: 10px; height: 10px;
56+
background: white;
57+
border-right: 1px solid #ddd;
58+
border-bottom: 1px solid #ddd;
59+
transform: translateX(-50%) rotate(45deg);
60+
}
61+
</style>
62+
63+
<div class="map-wrap">
264
<img class="basemap" src="/images/testmap.jpg" alt="World map" />
65+
66+
<!-- Pin: left/top are % of the map image dimensions -->
367
<div class="pin" style="left: 10%; top: 30%;">
468
<div class="tooltip">
569
<img src="/images/travels/lawncrush exp.png" alt="EXPERI" />
670
<h3>Vancouver, Canada</h3>
7-
<p>Testing an experiment idealsdfsoidfj dskfjjnsdfn sdkjfnsf can this fit?</p>
71+
<p>Testing an experiment idealsdfsoidfj
72+
dskfjjnsdfn
73+
sdkjfnsf
74+
can this fit?
75+
</p>
876
<div class="tail"></div>
977
</div>
1078
<div class="pin-dot"></div>
1179
</div>
80+
81+
<div class="pin" style="left: 55%; top: 88%;">
82+
<div class="tooltip">
83+
<img src="/images/travels/NA" alt="Noimageaalttext" />
84+
<h3>another place</h3>
85+
<p>second pin</p>
86+
<div class="tail"></div>
87+
</div>
88+
<div class="pin-dot"></div>
89+
</div>
90+
91+
92+
<!-- Add more pins here -->
1293
</div>
1394

95+
96+
97+
<!-- extra bit for mobile click/hover functionality -->
1498
<script>
1599
document.querySelectorAll('.pin').forEach(pin => {
16100
pin.addEventListener('click', function(e) {
17101
e.stopPropagation();
102+
// Close any other open pins first
18103
document.querySelectorAll('.pin.active').forEach(p => {
19104
if (p !== pin) p.classList.remove('active');
20105
});
106+
// Toggle this one
21107
pin.classList.toggle('active');
22108
});
23109
});
110+
111+
// Tap anywhere else on the map to close all tooltips
24112
document.addEventListener('click', () => {
25113
document.querySelectorAll('.pin.active').forEach(p => p.classList.remove('active'));
26114
});

_sass/custom.scss

Lines changed: 0 additions & 48 deletions
This file was deleted.

assets/css/main.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,5 @@
3939

4040
"vendor/font-awesome/fontawesome",
4141
"vendor/font-awesome/solid",
42-
"vendor/font-awesome/brands",
43-
"custom"
42+
"vendor/font-awesome/brands"
4443
;

0 commit comments

Comments
 (0)