mirror of
https://github.com/pheralb/svgl.git
synced 2025-02-06 15:17:58 +08:00
♿️ Make card visibile for screen readers
This commit is contained in:
parent
dd314719b4
commit
fae5d8543b
@ -1,13 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
let div: HTMLDivElement;
|
let domElement: HTMLElement;
|
||||||
let focused = false;
|
let focused = false;
|
||||||
let position = { x: 0, y: 0 };
|
let position = { x: 0, y: 0 };
|
||||||
let opacity = 0;
|
let opacity = 0;
|
||||||
|
|
||||||
const handleMouseMove = (e: MouseEvent) => {
|
const handleMouseMove = (e: MouseEvent) => {
|
||||||
if (!div || focused) return;
|
if (!domElement || focused) return;
|
||||||
|
|
||||||
const rect = div.getBoundingClientRect();
|
const rect = domElement.getBoundingClientRect();
|
||||||
|
|
||||||
position = {
|
position = {
|
||||||
x: e.clientX - rect.left,
|
x: e.clientX - rect.left,
|
||||||
@ -34,9 +34,8 @@
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<article
|
||||||
aria-hidden="true"
|
bind:this={domElement}
|
||||||
bind:this={div}
|
|
||||||
on:mousemove={handleMouseMove}
|
on:mousemove={handleMouseMove}
|
||||||
on:focus={handleFocus}
|
on:focus={handleFocus}
|
||||||
on:blur={handleBlur}
|
on:blur={handleBlur}
|
||||||
@ -52,4 +51,4 @@
|
|||||||
`}
|
`}
|
||||||
/>
|
/>
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</article>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user