Spaces:
Runtime error
Runtime error
File size: 927 Bytes
66ed450 4346adf 304976c 66ed450 32561d8 423b87b 8239db2 7cb7420 e5b9b7e 7cb7420 66ed450 a439de3 304976c a439de3 4346adf a439de3 72be512 a439de3 304976c 66ed450 |
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 |
<script lang="ts">
import LoadingIcon from '$lib/Icons/LoadingIcon.svelte';
import type { ZoomTransform } from 'd3-zoom';
export let transform: ZoomTransform;
export let position = { x: 0, y: 0 };
export let prompt = '';
export let isLoading = false;
$: coord = {
x: transform.applyX(position.x),
y: transform.applyY(position.y)
};
</script>
<div
class="frame @apply absolute top-0 left-0 ring-8 ring-[#EC8E65] w-[512px] h-[512px]"
style={`transform: translateX(${coord.x}px) translateY(${coord.y}px) scale(${transform.k}); transform-origin: 0 0;`}
>
<div class="pointer-events-none touch-none">
<div class="font-bold text-xl text-[#EC8E65] text-center px-2 line-clamp-4">{prompt}</div>
</div>
{#if isLoading}
<div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2">
<LoadingIcon classList={'animate-spin'} />
</div>
{/if}
</div>
<style lang="postcss" scoped>
</style>
|