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

View File

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