diff --git a/package-lock.json b/package-lock.json index 04bdffe..e17c43b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "svelte-app", "version": "1.0.0", "dependencies": { + "clipboard-polyfill": "^4.0.0-rc1", "sirv-cli": "^2.0.0", "svelte-icons": "^2.1.0" }, @@ -320,6 +321,12 @@ "fsevents": "~2.3.2" } }, + "node_modules/clipboard-polyfill": { + "version": "4.0.0-rc1", + "resolved": "https://registry.npmjs.org/clipboard-polyfill/-/clipboard-polyfill-4.0.0-rc1.tgz", + "integrity": "sha512-Cel03Es9ZgP6pYA2JT9cZ2VgvOH2/EHgB7jji84FpINBJWqfMEwiI1Y3LstVL+E43cm3CnCrLL2vwb9DMbr28A==", + "deprecated": "Use the browser-native async clipboard API instead of this library: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard" + }, "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -1575,6 +1582,11 @@ "readdirp": "~3.6.0" } }, + "clipboard-polyfill": { + "version": "4.0.0-rc1", + "resolved": "https://registry.npmjs.org/clipboard-polyfill/-/clipboard-polyfill-4.0.0-rc1.tgz", + "integrity": "sha512-Cel03Es9ZgP6pYA2JT9cZ2VgvOH2/EHgB7jji84FpINBJWqfMEwiI1Y3LstVL+E43cm3CnCrLL2vwb9DMbr28A==" + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", diff --git a/package.json b/package.json index c99c51e..f77fd3a 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "svelte-preprocess": "^4.10.4" }, "dependencies": { + "clipboard-polyfill": "^4.0.0-rc1", "sirv-cli": "^2.0.0", "svelte-icons": "^2.1.0" } diff --git a/src/App.svelte b/src/App.svelte index ab1e494..4147469 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -4,6 +4,14 @@ import ChartCreation from './ChartCreation.svelte'; import IoMdHeart from 'svelte-icons/io/IoMdHeart.svelte'; import { H1 } from 'attractions'; + import { onMount } from 'svelte'; + + onMount(async () => { + if (window.location.hash.length > 1) { + const code = window.location.hash.slice(1); + currentChartID.set(code); + } + }); + +
+
+
+
+ +
+
+
+ +
+
+ + {#if error} +
+
+
+ {error} +
+
+ {/if} + + {#if !isLoaded} +


+ + {/if} +
\ No newline at end of file