File size: 857 Bytes
70b8e47
32561d8
f7d189a
32561d8
70b8e47
32561d8
70b8e47
7cb7420
e5b9b7e
 
7cb7420
70b8e47
 
304976c
27cf1bb
7cb7420
70b8e47
2d4904b
19722de
be26971
 
27cf1bb
be26971
 
 
 
19722de
304976c
70b8e47
 
e5b9b7e
 
 
 
70b8e47
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<script lang="ts">
	import type { ZoomTransform } from 'd3-zoom';
	import Cursor from '$lib/Icons/Cursor.svelte';
	export let transform: ZoomTransform;
	export let color = '';
	export let position = { x: 0, y: 0 };

	$: coord = {
		x: transform.applyX(position.x),
		y: transform.applyY(position.y)
	};
</script>

<div
	class="cursor text-4xl"
	style={`transform: translateX(${coord.x}px) translateY(${coord.y}px) scale(${transform.k});`}
>
	<Cursor classList={'block z-0 col-span-2 row-span-2 text-8xl'} fill={color} />
	<!-- 
	{#if emoji}
		<div
			class="absolute right-0 col-start-2 row-start-2 text-8xl"
			style={`text-shadow: 0px 5px 5px ${color}`}
		>
			{emoji}
		</div>
	{/if} -->
</div>

<style lang="postcss" scoped>
	.cursor {
		@apply absolute top-0 left-0 grid grid-cols-3 touch-none pointer-events-none;
		transform-origin: 0 0;
	}
</style>