diff options
| author | martin f. krafft <madduck@madduck.net> | 2023-10-12 17:22:32 +0200 |
|---|---|---|
| committer | martin f. krafft <madduck@madduck.net> | 2023-10-12 17:22:32 +0200 |
| commit | a5b2adc1bf119d5ef941e3e227df444d482c027b (patch) | |
| tree | d6b2acc37e6ba191c3188be1afec1609f8b47aea /copyurl.js | |
| parent | fa7359d41f45a4a73ad183d58974261de5a0e4f1 (diff) | |
simplify copying
Diffstat (limited to 'copyurl.js')
| -rw-r--r-- | copyurl.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/copyurl.js b/copyurl.js new file mode 100644 index 0000000..421ab2c --- /dev/null +++ b/copyurl.js @@ -0,0 +1,13 @@ +function copyURL() { + var copyText = document.getElementById("url"); + navigator.clipboard.writeText(copyText.href); + copyText.classList.add("highlight"); + window.setTimeout(() => copyText.classList.remove("highlight"), 1500); + document.getElementById('share-notice').style.display = "none"; + document.getElementById('shared-notice').style.display = "initial"; +} + +function resetURL() { + document.getElementById('share-notice').style.display = "initial"; + document.getElementById('shared-notice').style.display = "none"; +} |
