Tehnički audit web stranice

const questions = [ { question: { hr: "Koju uslugu vas zanima?", en: "What service are you interested in?", de: "Welche Dienstleistung interessiert Sie?", it: "Quale servizio ti interessa?" }, options: { hr: ["Izrada web stranice", "Izrada mobilne aplikacije", "Tehnička SEO optimizacija", "Nešto drugo"], en: ["Web Design", "Mobile App Development", "Technical SEO Optimization", "Something else"], de: ["Webdesign", "Mobile App-Entwicklung", "Technische SEO-Optimierung", "Etwas anderes"], it: ["Progettazione web", "Sviluppo app mobili", "Ottimizzazione SEO tecnica", "Altro"] } }, { question: { hr: "Koji vam je okvirni budžet?", en: "What is your estimated budget?", de: "Was ist Ihr geschätztes Budget?", it: "Qual è il tuo budget stimato?" }, options: { hr: ["1.000 – 2.000 €", "2.000 – 5.000 €", "5.000 – 10.000 €", "Preko 10.000 €"], en: ["1,000 – 2,000 €", "2,000 – 5,000 €", "5,000 – 10,000 €", "Over 10,000 €"], de: ["1.000 – 2.000 €", "2.000 – 5.000 €", "5.000 – 10.000 €", "Über 10.000 €"], it: ["1.000 – 2.000 €", "2.000 – 5.000 €", "5.000 – 10.000 €", "Oltre 10.000 €"] } }, { question: { hr: "Unesite vaše ime i email za više informacija", en: "Enter your name and email for more information", de: "Geben Sie Ihren Namen und Ihre E-Mail-Adresse für weitere Informationen ein", it: "Inserisci il tuo nome e email per maggiori informazioni" }, input: true } ]; let answers = []; let current = 0; const leadBot = document.getElementById("leadBot"); const toggle = document.getElementById("leadBotToggle"); const question = document.getElementById("botQuestion"); const options = document.getElementById("botOptions"); const closeBtn = document.getElementById("leadBotClose"); const overlay = document.getElementById("leadBotOverlay"); const language = window.location.pathname.split('/')[1]; // HR, EN, DE function showQuestion() { const q = questions[current]; question.innerHTML = `
${q.question[language]}
`; options.innerHTML = ""; if (q.input) { const input = document.createElement("input"); input.type = "text"; input.required = true; input.style = "width:100%; padding:8px; margin-bottom:10px; border:1px solid #ccc; border-radius:6px; font-family:Poppins,sans-serif;"; options.appendChild(input); const next = document.createElement("button"); next.innerText = "Dalje"; next.style = "padding:8px 16px; border:none; background:#1881f4; color:#fff; border-radius:6px; cursor:pointer; font-family:Poppins,sans-serif;"; next.on-click = () => { answers.push(input.value.trim()); current++; if (current < questions.length) { showQuestion(); } else { submitLead(); } }; options.appendChild(next); } else { q.options[language].forEach(opt => { const btn = document.createElement("button"); btn.innerText = opt; btn.style = "margin:5px 0; padding:10px; border:1px solid #ccc; border-radius:6px; background:#f9f9f9; cursor:pointer; width:100%; font-size:15px; color:#1881f4; font-family:Poppins,sans-serif;"; btn.on-click = () => { answers.push(opt); current++; showQuestion(); }; options.appendChild(btn); }); } } function submitLead() { question.innerHTML = "Hvala! Javit ćemo vam se ubrzo. 👋"; options.innerHTML = ""; const message = ` Novi upit: 1. Usluga: ${answers[0]} 2. Budžet: ${answers[1]} 3. Ime: ${answers[2]} 4. Email: ${answers[3]} `; fetch("https://formsubmit.co/ajax/[email protected]", { method: "POST", headers: { "Content-Type": "application/json", "Accept": "application/json" }, body: JSON.stringify({ name: answers[2], email: answers[3], message: message, _subject: "Novo upit od Sale agent" }) }).then(() => { setTimeout(() => { leadBot.style.display = "none"; overlay.style.display = "none"; toggle.style.display = "block"; }, 3000); }); } toggle.on-click = () => { leadBot.style.display = "block"; overlay.style.display = window.innerWidth > 768 ? "block" : "none"; toggle.style.display = "none"; current = 0; answers = []; showQuestion(); }; closeBtn.on-click = () => { leadBot.style.display = "none"; overlay.style.display = "none"; toggle.style.display = "block"; }; overlay.on-click = () => { leadBot.style.display = "none"; overlay.style.display = "none"; toggle.style.display = "block"; }; // Open only on the homepage once per session if (window.location.pathname === "/" && !sessionStorage.getItem("leadBotShown")) { setTimeout(() => { leadBot.style.display = "block"; showQuestion(); if (window.innerWidth > 768) overlay.style.display = "block"; sessionStorage.setItem("leadBotShown", "true"); }, 7000); } else { // Ensure bot is always visible on other pages but doesn't automatically open leadBot.style.display = "block"; overlay.style.display = window.innerWidth > 768 ? "block" : "none"; }

Kontaktirajte nas

💬 Pošaljite upit