From fd2c72bfbd50f94d38852c53b8b252d91f35190d Mon Sep 17 00:00:00 2001 From: KaiPUecker Date: Thu, 16 May 2024 14:48:55 +0200 Subject: [PATCH] Feature/tooltip (#41) * feature/tooltip: added pure CSS-based tooltip * feature/tooltip: small optimization * feature/tooltip: finalized tooltip, adapted inspector to last changes --- src/lib/components/a11y-inspector.svelte | 74 ++++++++++----------- src/lib/components/tooltip.svelte | 82 ++++++++++++++++++++++++ src/routes/+page.svelte | 3 +- 3 files changed, 122 insertions(+), 37 deletions(-) create mode 100644 src/lib/components/tooltip.svelte diff --git a/src/lib/components/a11y-inspector.svelte b/src/lib/components/a11y-inspector.svelte index 6098878..dcef440 100644 --- a/src/lib/components/a11y-inspector.svelte +++ b/src/lib/components/a11y-inspector.svelte @@ -2,27 +2,19 @@ import { watchedA11yContent, testA11yRules } from '$lib/helpers/a11y-manager'; import { onMount } from 'svelte'; - let src = 'https://google.com/'; + let + elmIframe, + // The URL to test (initial value). + src = 'https://google.com/', + // The URL for the proxy-server we're using to bypass CORS-issues. + proxy = 'http://localhost:8080/', + inputDelay; - let // The URL for the proxy-server we're using to bypass CORS-issues. - proxy = 'http://localhost:8080/'; - // http://localhost:8080/ - // https://a11y.neofonie.de/cors/ - - let elmIframe, inputDelay; - - // As soon 'src' changes (like when editing text in input.address) + // As soon 'src' or 'proxy' changes (like when editing text in any input) // this will be triggered. We use `setTimeout` to delay the input // so loading will happen after the user has stopped typing after // a reasonable time (250ms). - $: if (src) { - if (inputDelay) { - clearTimeout(inputDelay); - } - inputDelay = setTimeout(() => loadPagePerProxy(), 250); - } - - $: if (proxy) { + $: if (src || proxy) { if (inputDelay) { clearTimeout(inputDelay); } @@ -61,11 +53,9 @@
-
- - - -
+ + +
\ No newline at end of file diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index bf3b310..3b1bc73 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -10,6 +10,7 @@ import ShowCode from '$lib/components/show-code.svelte'; import SplitPane from '$lib/components/split-pane.svelte'; import StoredCheckbox from '$lib/components/stored-checkbox.svelte'; + import Tooltip from '$lib/components/tooltip.svelte'; @@ -25,7 +26,7 @@
- Test Accessibility „A11y“ (11 stehen für 11 Buchstaben, ergo eine Abkürzung) + Test Accessibility „A11y“