Popup Article Generator (Netlify)

πŸ“„ Popup Article Generator

Fill the fields β†’ Generate β†’ Download HTML β†’ Upload to Netlify. (Your link is used exactly as you type itβ€”UTM untouched.)

Done!
`; }const out = $("output"); const stat = $("status");function showStatus(msg){ stat.textContent = msg; stat.style.display = "inline"; setTimeout(()=> { stat.style.display="none"; stat.textContent="Done!"; }, 1200); }document.getElementById("genBtn").addEventListener("click", () => { const title = $("title").value.trim() || "Article Title"; const image = $("image").value.trim(); const teaser = $("teaser").value.trim() || "Sample teaser text..."; const link = $("link").value.trim() || "#";const html = buildStandalone({ title, img:image, teaser, link }); out.textContent = html; showStatus("Generated!"); });document.getElementById("copyBtn").addEventListener("click", async () => { if (!out.textContent) document.getElementById("genBtn").click(); await navigator.clipboard.writeText(out.textContent); showStatus("Copied!"); });document.getElementById("dlBtn").addEventListener("click", () => { if (!out.textContent) document.getElementById("genBtn").click(); const name = normFile($("filename").value); const blob = new Blob([out.textContent], {type:"text/html;charset=utf-8"}); const url = URL.createObjectURL(blob); const a = document.createElement("a"); a.href = url; a.download = name; document.body.appendChild(a); a.click(); a.remove(); URL.revokeObjectURL(url); showStatus("Downloaded!"); }); })();