diff --git a/src/components/SVGContent.svelte b/src/components/SVGContent.svelte index d8dc574..e644b0b 100644 --- a/src/components/SVGContent.svelte +++ b/src/components/SVGContent.svelte @@ -51,6 +51,7 @@ x: 0, y: 0, }; + let panToStart: undefined | (() => void); onMount(async () => { console.info("[SVG] Initializing."); @@ -219,6 +220,9 @@ console.debug(`[SVGCONTENT] Panning to start anchor.`); panToElement(start, false); } + if (start) { + panToStart = () => panToElement(start, true); + } // Anchors console.debug("[SVG] Processing anchors."); @@ -625,6 +629,9 @@ {#each audioAreas as audio (audio.id)} {/each} + {#if panToStart !== undefined} + + {/if}
Current viewport position: @@ -685,6 +692,19 @@ transition: width 0.2s; } + button { + position: fixed; + bottom: 0; + left: 50%; + font-size: 1.5rem; + transform: translateX(-50%); + padding: 1rem 2rem; + margin-bottom: 0.5rem; + background: #fefefe; + border-radius: 1rem; + cursor: pointer; + } + .dev { display: none; }