adds tooltips for elevation profile wps
This commit is contained in:
@@ -59,10 +59,11 @@
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
content: attr(data-title);
|
content: attr(data-title);
|
||||||
font-size: 14px;
|
font-size: 12px;
|
||||||
padding: 6px 10px;
|
padding: 6px 10px;
|
||||||
top: 24px;
|
top: 24px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
z-index: 10
|
||||||
}
|
}
|
||||||
|
|
||||||
.tooltip:hover:after,
|
.tooltip:hover:after,
|
||||||
|
|||||||
@@ -691,7 +691,8 @@ export class ElevationProfile {
|
|||||||
|
|
||||||
// Create custom HTML tick
|
// Create custom HTML tick
|
||||||
const wpDiv = document.createElement("div");
|
const wpDiv = document.createElement("div");
|
||||||
wpDiv.className = "wp-marker absolute -translate-x-1/2 w-6 aspect-square bg-background-inverse rounded-full flex justify-center items-center text-content-inverse cursor-pointer hover:scale-110";
|
wpDiv.className = "wp-marker tooltip absolute -translate-x-1/2 w-6 aspect-square bg-background-inverse rounded-full flex justify-center items-center text-content-inverse cursor-pointer hover:scale-110";
|
||||||
|
wpDiv.dataset.title = this.waypoints[index].name ?? "?"
|
||||||
wpDiv.style.left = `${xPos}px`; // Position horizontally
|
wpDiv.style.left = `${xPos}px`; // Position horizontally
|
||||||
wpDiv.style.top = `8px`; // Position horizontally
|
wpDiv.style.top = `8px`; // Position horizontally
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user