diff options
Diffstat (limited to 'lume')
| -rw-r--r-- | lume/src/_includes/blog.njk | 6 | ||||
| -rw-r--r-- | lume/src/js/swal.js | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lume/src/_includes/blog.njk b/lume/src/_includes/blog.njk index 9e8d625..07f3b6d 100644 --- a/lume/src/_includes/blog.njk +++ b/lume/src/_includes/blog.njk @@ -38,7 +38,9 @@ layout: base.njk </svg> </button> - <script> + <script type="module"> + import swal from "/js/swal.js"; + const shareButton = document.getElementById("shareButton"); function doShareButton() { const shareData = { @@ -62,8 +64,10 @@ layout: base.njk console.log("Thanks for sharing!"); }) .catch(console.error); + swal("Link copied to clipboard", "Feel free to paste it anywhere you like!", "success"); } else { console.log("can't share directly, but feel free to copy the url from addressbar manually"); + swal("Can't share directly", "Feel free to copy the url from addressbar manually!", "info"); } } shareButton.addEventListener("click", doShareButton); diff --git a/lume/src/js/swal.js b/lume/src/js/swal.js new file mode 100644 index 0000000..1ee8022 --- /dev/null +++ b/lume/src/js/swal.js @@ -0,0 +1,3 @@ +import swal from "npm:sweetalert"; + +export default swal;
\ No newline at end of file |
