// كود الزرار والبوت الذكي - نسخة نهائية مع تسجيل في Google Form (function () { const button = document.createElement("button"); button.innerText = "هل تبحث عن تصميم؟ 🔍"; button.style.position = "fixed"; button.style.bottom = "20px"; button.style.right = "20px"; button.style.backgroundColor = "#4b3b5b"; button.style.color = "white"; button.style.border = "none"; button.style.padding = "10px 20px"; button.style.borderRadius = "10px"; button.style.zIndex = "9999"; button.style.cursor = "pointer"; const formBox = document.createElement("div"); formBox.style.position = "fixed"; formBox.style.bottom = "80px"; formBox.style.right = "20px"; formBox.style.backgroundColor = "white"; formBox.style.border = "1px solid #ccc"; formBox.style.borderRadius = "10px"; formBox.style.padding = "15px"; formBox.style.boxShadow = "0 2px 6px rgba(0,0,0,0.2)"; formBox.style.zIndex = "9999"; formBox.style.display = "none"; const closeBtn = document.createElement("span"); closeBtn.innerText = "✖"; closeBtn.style.position = "absolute"; closeBtn.style.top = "5px"; closeBtn.style.right = "10px"; closeBtn.style.cursor = "pointer"; closeBtn.style.color = "#888"; formBox.appendChild(closeBtn); const input = document.createElement("input"); input.type = "text"; input.placeholder = "اكتب هنا..."; input.style.width = "100%"; input.style.padding = "8px"; input.style.marginBottom = "10px"; formBox.appendChild(input); const resultsBox = document.createElement("div"); formBox.appendChild(resultsBox); closeBtn.onclick = () => (formBox.style.display = "none"); button.onclick = () => { formBox.style.display = formBox.style.display === "none" ? "block" : "none"; }; input.onkeydown = async function (e) { if (e.key === "Enter") { e.preventDefault(); const query = input.value.trim(); if (!query) return; const lang = document.documentElement.lang.includes("en") ? "en" : "ar"; const lower = query.toLowerCase(); let found = false; let match = ""; let url = ""; const keywords = { "لوجو عقارات": "https://www.tasmimak.com/ar/templates/لوجو-عقارات", "تصميم ختم": "https://www.tasmimak.com/ar/templates/ختم-شخصي", "بوست حضانة": "https://www.tasmimak.com/ar/templates/بوستات-حضانة", "كارت طبيب": "https://www.tasmimak.com/ar/templates/كارت-أطباء", }; for (const key in keywords) { if (lower.includes(key.toLowerCase())) { url = keywords[key]; match = key; found = true; break; } } if (found) { window.location.href = url; } // 🔴 Send to Google Form const formUrl = "https://docs.google.com/forms/d/e/1FAIpQLSfIlszSHeQGZsI4f5J_beM6KVBk_qDyQ7Gfx_YiMe63f1iqpw/formResponse"; const formData = new FormData(); formData.append("entry.1965910005", query); // Query formData.append("entry.371801406", url); // Result URL formData.append("entry.1833294064", match); // Found Match formData.append("entry.415645249", lang); // Language fetch(formUrl, { method: "POST", mode: "no-cors", body: formData, }); } }; document.body.appendChild(button); document.body.appendChild(formBox); })();
تصميمات متعلقة
تصميمات اخرى