diff --git a/islands/ImageForm.tsx b/islands/ImageForm.tsx index 8f5f6af..824043b 100644 --- a/islands/ImageForm.tsx +++ b/islands/ImageForm.tsx @@ -74,6 +74,21 @@ export default function ImageForm() { buttonDisable.value = false; isAnnounsing.value = false; }; + + const downloadAsciiArt = () => { + const asciiArtPreview = document.getElementById( + "ascii-art", + ) as HTMLImageElement; + const asciiArt = asciiArtPreview.src; + console.log(asciiArt); + const download = document.createElement("a"); + download.href = asciiArt; + download.download = "ascii-art.png"; + document.body.appendChild(download); + download.click(); + document.body.removeChild(download); + }; + return (
@@ -103,6 +118,13 @@ export default function ImageForm() { : undefined} +
); }