מחולל אתרי HTML

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

עמוד 1 — האתר הראשי

הטקסט נשמר בתצוגה באמצעות white-space: pre-wrap, כך שרווחים וירידות שורה נשמרים. קישורים מזוהים אוטומטית.

עמוד 2

קוד HTML מלא ומוכן להעתקה

`; document.getElementById("codeOutput").value = generatedHTML; document.getElementById("outputSection").style.display = "block"; document.getElementById("outputSection") .scrollIntoView({ behavior: "smooth", block: "start" }); showStatus( "הקוד המלא נוצר בהצלחה בעיצוב יוקרתי אקראי." ); if (copyAfter) { setTimeout(copyExistingCode, 150); } return generatedHTML; } /* ============================================================ עמוד 2 ============================================================ */ function showPage2() { page2Enabled = true; const container = document.getElementById("page2Container"); container.style.display = "block"; container.scrollIntoView({ behavior: "smooth", block: "center" }); document.getElementById("title2").focus(); } function removePage2() { page2Enabled = false; document.getElementById("title2").value = ""; document.getElementById("text2").value = ""; document.getElementById("page2Container").style.display = "none"; showStatus("עמוד 2 הוסר. ניתן ליצור אותו מחדש בכל עת."); } /* ============================================================ העתקה למקלדת ============================================================ */ async function copyExistingCode() { const code = document.getElementById("codeOutput").value; if (!code.trim()) { generateHTML(false); } const finalCode = document.getElementById("codeOutput").value; try { await navigator.clipboard.writeText(finalCode); showStatus("הקוד המלא הועתק בהצלחה למקלדת."); } catch (error) { /* * Fallback לדפדפנים ישנים / הרשאות Clipboard. */ const textarea = document.getElementById("codeOutput"); textarea.focus(); textarea.select(); textarea.setSelectionRange(0, textarea.value.length); try { document.execCommand("copy"); showStatus("הקוד הועתק בהצלחה למקלדת."); } catch (copyError) { showStatus( "לא ניתן היה להעתיק אוטומטית. הקוד מסומן וניתן להעתיקו ידנית." ); } } } /* ============================================================ יצירה + העתקה ============================================================ */ function generateAndCopy() { generateHTML(true); } /* ============================================================ הורדת HTML ============================================================ */ function downloadHTML() { if (!generatedHTML.trim()) { generateHTML(false); } const blob = new Blob( [generatedHTML], { type: "text/html;charset=utf-8" } ); const url = URL.createObjectURL(blob); const a = document.createElement("a"); a.href = url; a.download = "my-luxury-site.html"; document.body.appendChild(a); a.click(); a.remove(); URL.revokeObjectURL(url); showStatus("קובץ HTML הורד בהצלחה."); } /* ============================================================ הודעות סטטוס ============================================================ */ let statusTimer = null; function showStatus(message) { const status = document.getElementById("status"); status.textContent = message; clearTimeout(statusTimer); statusTimer = setTimeout(() => { status.textContent = ""; }, 4500); } /* ============================================================ Ctrl + Enter יצירת HTML מהירה ============================================================ */ document.addEventListener("keydown", function(event) { if ( (event.ctrlKey || event.metaKey) && event.key === "Enter" ) { event.preventDefault(); generateAndCopy(); } }); /* ============================================================ אתחול ============================================================ */ document.addEventListener("DOMContentLoaded", function() { /* * אין יצירת קוד אוטומטית בזמן הטעינה, * כדי שהמשתמש יוכל להזין את הנתונים תחילה. */ });