دسترسی محدود شده

برای استفاده از امکانات هوشایا، لطفاً ابتدا در سایت عضو شوید یا وارد حساب کاربری خود شوید.

ورود / ثبت نام

ساخت المان ها(دکمه/باکس…) هوش مصنوعی

تولید هوشمند کد با هوش مصنوعی
۰/۱۵۰۰
`); frameDoc.close(); }$("#hoosh-content-copy-current").on("click", function() { let code = ""; if (currentTab === "html") { code = $("#hoosh-content-html-code code").text(); } else if (currentTab === "css") { code = $("#hoosh-content-css-code code").text(); } if (!code) { notify(`هیچ کدی در تب ${currentTab === "html" ? "HTML" : "CSS"} برای کپی وجود ندارد`, "warning"); return; }const button = $(this); button.addClass("copying"); navigator.clipboard.writeText(code).then( () => { notify(`کد ${currentTab === "html" ? "HTML" : "CSS"} با موفقیت کپی شد`, "success"); button.html(` کپی شد`); setTimeout(() => { button.removeClass("copying").html(` کپی تب فعلی `); }, 2000); }, () => notify("خطا در کپی کردن کد", "error") ); });$("#hoosh-content-copy-all").on("click", function() { const htmlCode = $("#hoosh-content-html-code code").text(); const cssCode = $("#hoosh-content-css-code code").text(); if (!htmlCode && !cssCode) { notify("هیچ کدی برای کپی وجود ندارد", "warning"); return; }let fullCode = ""; if (htmlCode) { fullCode += "\n" + htmlCode + "\n\n"; } if (cssCode) { fullCode += "/* CSS CODE */\n" + cssCode; }const button = $(this); button.addClass("copying"); navigator.clipboard.writeText(fullCode).then( () => { notify("همه کدها با موفقیت کپی شدند", "success"); button.html(` کپی شد`); setTimeout(() => { button.removeClass("copying").html(` کپی همه `); }, 2000); }, () => notify("خطا در کپی کردن کد", "error") ); });$("#hoosh-content-download").on("click", function() { const htmlCode = $("#hoosh-content-html-code code").text(); const cssCode = $("#hoosh-content-css-code code").text(); if (!htmlCode && !cssCode) { notify("هیچ کدی برای دانلود وجود ندارد", "warning"); return; }const timestamp = new Date().toISOString().replace(/[^0-9]/g, "").slice(0, 14); const filename = `hooshaya-content-code-${timestamp}.html`; let fullHtml = `کد تولیدشده توسط هوشایا ${htmlCode} `; const blob = new Blob([fullHtml], { type: "text/html;charset=utf-8" }); const url = window.URL.createObjectURL(blob); const a = document.createElement("a"); a.href = url; a.download = filename; document.body.appendChild(a); a.click(); document.body.removeChild(a); window.URL.revokeObjectURL(url); notify("کد با موفقیت دانلود شد", "success"); });let isEditing = { html: false, css: false };$("#hoosh-content-prettify").on("click", function() { let currentCodeElement, currentEditingState; if (currentTab === "html") { currentCodeElement = $("#hoosh-content-html-code code"); currentEditingState = isEditing.html; } else { currentCodeElement = $("#hoosh-content-css-code code"); currentEditingState = isEditing.css; } if (!currentCodeElement.text()) { notify(`کدی برای ویرایش در تب ${currentTab === "html" ? "HTML" : "CSS"} وجود ندارد`, "warning"); return; }if (!currentEditingState) { currentCodeElement.attr("contenteditable", "true").focus(); $(this).html(` ذخیره`); notify(`حالت ویرایش برای تب ${currentTab === "html" ? "HTML" : "CSS"} فعال شد`, "info"); } else { currentCodeElement.attr("contenteditable", "false"); $(this).html(` زیباسازی`); if (currentTab === "html") { lastGeneratedHtml = currentCodeElement.text(); isEditing.html = false; } else { lastGeneratedCss = currentCodeElement.text(); isEditing.css = false; } updatePreview(lastGeneratedHtml, lastGeneratedCss); notify(`تغییرات تب ${currentTab === "html" ? "HTML" : "CSS"} با موفقیت ذخیره شد`, "success"); } if (currentTab === "html") { isEditing.html = !isEditing.html; } else { isEditing.css = !isEditing.css; } });$("#hoosh-content-refresh").on("click", function() { if (lastGeneratedHtml || lastGeneratedCss) { updatePreview(lastGeneratedHtml, lastGeneratedCss); notify("پیش‌نمایش بروزرسانی شد", "success"); } else { notify("کدی برای نمایش وجود ندارد", "warning"); } });$("#hoosh-content-clear").on("click", function() { $("#hoosh-content-prompt").val("").trigger("input"); const htmlCodeElement = $("#hoosh-content-html-code code"); const cssCodeElement = $("#hoosh-content-css-code code"); if (htmlCodeElement.text() || cssCodeElement.text()) { htmlCodeElement.addClass("clearing"); cssCodeElement.addClass("clearing"); setTimeout(() => { htmlCodeElement.text("").removeClass("clearing"); cssCodeElement.text("").removeClass("clearing"); }, 300); } updatePreview("", ""); lastGeneratedHtml = ""; lastGeneratedCss = ""; notify("همه محتوا پاک شد", "info"); updateStatus("آماده برای تولید کد جدید"); });$(document).on("keydown", function(e) { if ((e.ctrlKey || e.metaKey) && e.keyCode === 13) { $("#hoosh-content-generate").click(); } if ((e.ctrlKey || e.metaKey) && e.keyCode === 83) { e.preventDefault(); $("#hoosh-content-download").click(); } if ((e.ctrlKey || e.metaKey) && e.keyCode === 67 && !window.getSelection().toString()) { e.preventDefault(); $("#hoosh-content-copy-current").click(); } if (e.keyCode === 27) { if ((currentTab === "html" && isEditing.html) || (currentTab === "css" && isEditing.css)) { $("#hoosh-content-prettify").click(); } } if (e.keyCode === 9 && e.altKey) { e.preventDefault(); if (currentTab === "html") { $(".tab-button[data-tab='css']").click(); } else { $(".tab-button[data-tab='html']").click(); } } });updateStatus("آماده برای تولید کد"); setInterval(() => { const now = new Date().toLocaleTimeString("fa-IR", { hour: "2-digit", minute: "2-digit", second: "2-digit" }); $("#last-update").text(now); }, 1000);// بررسی اولیه برای نمایش افکت مات در صورت اتمام توکن‌ها if ($("#tokens-count").text() === "0") { $(".hoosh-aya-content-container").addClass("expired"); $(".hoosh-aya-content-overlay.expired").show(); } }); /* ]]> */