svelte-layer-zoomable

GitHub repository: mvolfik/svelte-layer-zoomable

NPM: svelte-layer-zoomable

Note: do not confuse with svelte-zoomable

Usage:

<script lang="ts">
  import Zoomable from "svelte-layer-zoomable";
  import type { MoveResize } from "svelte-layer-zoomable";

  let moveResize: MoveResize;
  let transitionDuration = 0.2;
  let minScale = 0.3;
  let maxScale = 10;

  // ...
</script>

<Zoomable
  bind:moveResize
  initialScale={1}
  initialX={0.4}
  initialY={0.4}
  {transitionDuration}
  {minScale}
  {maxScale}
>
  <!-- layer content -->
</Zoomable>
<p>
  <button
    on:click={() =>
      moveResize({ newScale: 1, newX: 0.4, newY: 0.4 })}
  >
    Execute
  </button>
</p>