Build 29095000

This commit is contained in:
Renan LE CARO 2025-04-26 22:40:32 +02:00
parent 096f7d4abd
commit 4c324d211c
27 changed files with 500 additions and 1350 deletions

View file

@ -14,9 +14,9 @@ export function hideAnyTooltip() {
const tooltip = document.getElementById("tooltip") as HTMLDivElement;
function setupMobileTooltips(tooltip: HTMLDivElement) {
tooltip.className='mobile'
tooltip.className = "mobile";
function openTooltip(e: Event) {
hideAnyTooltip()
hideAnyTooltip();
const hovering = e.target as HTMLElement;
if (!hovering?.hasAttribute("data-help-content")) {
return;
@ -25,9 +25,8 @@ function setupMobileTooltips(tooltip: HTMLDivElement) {
e.preventDefault();
tooltip.innerHTML = hovering.getAttribute("data-help-content") || "";
tooltip.style.display = "";
const { top } = hovering.getBoundingClientRect();
const { top } = hovering.getBoundingClientRect();
tooltip.style.transform = `translate(0,${top}px) translate(0,-100%)`;
}
document.body.addEventListener("touchstart", openTooltip, true);
@ -62,7 +61,7 @@ function setupMobileTooltips(tooltip: HTMLDivElement) {
}
function setupDesktopTooltips(tooltip: HTMLDivElement) {
tooltip.className='desktop'
tooltip.className = "desktop";
function updateTooltipPosition(e: { clientX: number; clientY: number }) {
tooltip.style.transform = `translate(${e.clientX}px,${e.clientY}px) translate(${e.clientX > window.innerWidth / 2 ? "-100%" : "0"},${e.clientY > (window.innerHeight * 2) / 3 ? "-100%" : "20px"})`;
}