diff --git a/src/assets/cardfoldr.js b/src/assets/cardfoldr.js index 49ae305..773a779 100644 --- a/src/assets/cardfoldr.js +++ b/src/assets/cardfoldr.js @@ -868,6 +868,14 @@ document.getElementById("deletePreset").addEventListener("click", (event) => { } }); +document.getElementById("shareLink").addEventListener("click", (event) => { + const query = generateQuery(); + const url = `https://foosel.github.io/cardfoldr/?${query}`; + navigator.clipboard.writeText(url).then(() => { + alert(`Link copied to clipboard!`); + }); +}); + // --- Event listeners --- const syncQueryParams = () => { diff --git a/src/index.html b/src/index.html index e55f013..5527614 100644 --- a/src/index.html +++ b/src/index.html @@ -75,6 +75,7 @@

Step 2: Create Grid

+