2024-10-15 06:55:50 +00:00
|
|
|
<script lang="ts">
|
|
|
|
|
import { onDestroy, onMount } from 'svelte';
|
|
|
|
|
|
|
|
|
|
export let x;
|
|
|
|
|
export let y;
|
|
|
|
|
|
|
|
|
|
let popupElement = null;
|
|
|
|
|
|
|
|
|
|
onMount(() => {
|
|
|
|
|
document.body.appendChild(popupElement);
|
|
|
|
|
document.body.style.overflow = 'hidden';
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
onDestroy(() => {
|
2025-12-05 01:40:52 +00:00
|
|
|
if (popupElement && popupElement.parentNode) {
|
|
|
|
|
try {
|
|
|
|
|
popupElement.parentNode.removeChild(popupElement);
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.warn('Failed to remove popupElement:', err);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-15 06:55:50 +00:00
|
|
|
document.body.style.overflow = 'unset';
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
|
|
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
bind:this={popupElement}
|
2024-10-15 09:12:39 +00:00
|
|
|
class="fixed top-0 left-0 w-screen h-[100dvh] z-50 touch-none pointer-events-none"
|
2024-10-15 06:55:50 +00:00
|
|
|
>
|
2025-02-16 03:27:25 +00:00
|
|
|
<div class=" absolute text-white z-99999" style="top: {y + 10}px; left: {x + 10}px;">
|
2024-10-15 09:12:39 +00:00
|
|
|
<slot></slot>
|
|
|
|
|
</div>
|
2024-10-15 06:55:50 +00:00
|
|
|
</div>
|