added some nice graphs to the tasks

This commit is contained in:
2024-04-18 15:01:36 +01:00
parent f41cdf78df
commit 2fa7680d0b
13 changed files with 407 additions and 75 deletions

View File

@@ -5,20 +5,20 @@
let x = $state(0);
let y = $state(0);
let div: HTMLDivElement;
let div: HTMLDivElement;
function mouseOver(event: MouseEvent) {
isHovered = true;
x = event.pageX + 5;
y = event.pageY + 5;
}
function focus() {
isHovered = true;
function focus() {
isHovered = true;
const box = div.getBoundingClientRect();
x = box.x + 5;
y = box.y;
}
const box = div.getBoundingClientRect();
x = box.x + 5;
y = box.y;
}
function mouseMove(event: MouseEvent) {
x = event.pageX + 5;
y = event.pageY + 5;
@@ -28,7 +28,15 @@
}
</script>
<div bind:this={div} on:mouseover={mouseOver} on:mouseleave={mouseLeave} on:mousemove={mouseMove} on:focus={focus} role="tooltip">
<div
bind:this={div}
on:mouseover={mouseOver}
on:mouseleave={mouseLeave}
on:mousemove={mouseMove}
on:focus={focus}
role="tooltip"
class="tooltipContainer"
>
<slot />
</div>
@@ -37,6 +45,9 @@
{/if}
<style>
.tooltipContainer {
display: inline-block;
}
.tooltip {
border: 1px solid #ddd;
box-shadow: 1px 1px 1px #ddd;