מחולל אתרים עצמאי

יוצרים אתר שלם ומייצרים מחדש את המחולל עצמו

עריכת האתר

הוסיפו פסקאות, כתבו טקסט או כתובות אינטרנט. כל שינוי יעדכן את הקוד המיוצר.

תצוגה מקדימה

קוד HTML + CSS שנוצר

קוד JavaScript שנוצר

`; return output; } function generateJs() { const data = JSON.stringify(paragraphs) .replace(//g, "\\u003e") .replace(/&/g, "\\u0026"); return getEngineSource(data); } /* העתקה בטוחה ככל האפשר. */ async function copyText(text, label) { try { if (navigator.clipboard && window.isSecureContext) { await navigator.clipboard.writeText(text); } else { const temp = document.createElement("textarea"); temp.value = text; temp.style.position = "fixed"; temp.style.opacity = "0"; document.body.appendChild(temp); temp.select(); const ok = document.execCommand("copy"); temp.remove(); if (!ok) throw new Error("Copy failed"); } showStatus(label + " הועתק בהצלחה."); } catch (_) { showStatus("ההעתקה נכשלה. ניתן להעתיק מתיבת הקוד."); } } function downloadFile(filename, text, type) { const blob = new Blob([text], { type: type + ";charset=utf-8" }); const url = URL.createObjectURL(blob); const a = document.createElement("a"); a.href = url; a.download = filename; document.body.appendChild(a); a.click(); a.remove(); setTimeout(() => URL.revokeObjectURL(url), 1000); } function updateCode() { htmlOutput.value = generateHtml(); jsOutput.value = generateJs(); } document.getElementById("addParagraph") .addEventListener("click", addParagraph); document.getElementById("copyHtml") .addEventListener("click", () => { copyText(generateHtml(), "HTML + CSS"); }); document.getElementById("copyHtmlAgain") .addEventListener("click", () => { copyText(generateHtml(), "HTML + CSS"); }); document.getElementById("copyJs") .addEventListener("click", () => { copyText(generateJs(), "JavaScript"); }); document.getElementById("copyJsAgain") .addEventListener("click", () => { copyText(generateJs(), "JavaScript"); }); document.getElementById("downloadHtml") .addEventListener("click", () => { downloadFile("index.html", generateHtml(), "text/html"); }); document.getElementById("downloadJs") .addEventListener("click", () => { downloadFile("script.js", generateJs(), "text/javascript"); }); renderEditor(); renderPreview(); updateCode(); })();