From fed3c8882a799501cb2541332052d6a46eff2281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Sat, 3 Feb 2024 18:14:58 +0100 Subject: [PATCH] feat: fullscreen on double click --- src/lib/TestCard.svelte | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/TestCard.svelte b/src/lib/TestCard.svelte index e16b42e..de93e06 100644 --- a/src/lib/TestCard.svelte +++ b/src/lib/TestCard.svelte @@ -4,6 +4,7 @@ import Axes from '$lib/Axes.svelte'; import ColorGradient from '$lib/ColorGradient.svelte'; import BrightnessGradient from '$lib/BrightnessGradient.svelte'; + import { onMount } from 'svelte'; let sizes = { blockSize: 64, @@ -19,6 +20,12 @@ $: circleBlocks = 2 * Math.floor((Math.min(sizes.horizontalCount, sizes.verticalCount) * 0.66) / 2) + (sizes.horizontalCount % 2); + + onMount(() => { + window.addEventListener('dblclick', () => { + document.body.requestFullscreen(); + }) + });