refactor: use dialog element in favor of useragent check

This commit is contained in:
madkarmaa
2025-06-05 18:10:32 +02:00
parent 5afa5f29af
commit d5be4c5927
3 changed files with 5 additions and 11 deletions

View File

@@ -8,7 +8,7 @@
export let fullscreen = false;
export let notDismissible = false;
let element: HTMLDivElement;
let element: HTMLDialogElement;
let y = 0;
function parseScroll() {
@@ -28,9 +28,8 @@
transition:fade={{ easing: quadInOut, duration: 150 }}
/>
<div
<dialog
class="modal"
role="dialog"
class:fullscreen
class:scrolled={y > 10}
aria-modal="true"
@@ -69,7 +68,7 @@
</div>
{/if}
</div>
</div>
</dialog>
{/if}
<style>
@@ -121,6 +120,7 @@
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border: none;
border-radius: 26px;
background-color: var(--surface-seven);
display: flex;

File diff suppressed because one or more lines are too long

View File

@@ -26,7 +26,6 @@
import { RV_GOOGLE_TAG_MANAGER_ID } from '$env/static/public';
import FooterHost from '$layout/Footer/FooterHost.svelte';
import { isCrawler } from '$lib/utils';
const queryClient = new QueryClient({
defaultOptions: {
@@ -67,7 +66,7 @@
allowAnalytics = localStorage.getItem('analytics') === 'true';
if (allowAnalytics) enableAnalytics();
} else {
showConsentModal = !isCrawler(navigator.userAgent);
showConsentModal = true;
}
new DateTriggerEventHandler(themeEvents);