display position popup

This commit is contained in:
ouidade 2024-10-04 15:02:19 +02:00
parent 806988276f
commit 9668e6368a
2 changed files with 8 additions and 3 deletions

View File

@ -5,6 +5,7 @@
#sites-map-container {
background-color: #cecfcc;
text-align: center;
position: relative;
}
/* #sites-map-container .circle {
fill: black;
@ -25,7 +26,7 @@
#sites-map-container #popup {
font-family: 'gilroy-semibold';
display: none;
position: fixed;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
@ -56,3 +57,7 @@
padding-left: 0.2rem;
}
#popup-content{
width: 300px;
}

View File

@ -12,8 +12,8 @@ function showPopup(content, x, y) {
const rect = svgElement.getBoundingClientRect();
// Calcul de la position du popup
let popupX = rect.left + x + 120;
let popupY = rect.top + y + 20;
let popupX = rect.left + x + 100;
let popupY = rect.top + y + -300;
// Dimensions de la fenêtre et du popup
const viewportWidth = window.innerWidth;