From 89c3ddcef9a4df94608299dc039e747bd3a3e3a9 Mon Sep 17 00:00:00 2001 From: Ihor_Zhekov Date: Thu, 12 Feb 2026 13:32:33 +0100 Subject: [PATCH] phone --- Profice WebSite/index.html | 4 +- Profice WebSite/scripts/script.js | 81 +++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 2 deletions(-) diff --git a/Profice WebSite/index.html b/Profice WebSite/index.html index ceb3933..c72a8c7 100644 --- a/Profice WebSite/index.html +++ b/Profice WebSite/index.html @@ -74,7 +74,7 @@ Systeme Für wen? Prozess - Kontakt + Kontakt @@ -179,7 +179,7 @@

KI-Telefonassistent

Rufen Sie jetzt an und erleben Sie, wie unsere KI Ihr Anliegen aufnimmt und verarbeitet.

- + Jetzt anrufen Kostenlos · Keine Wartezeit · 24/7 diff --git a/Profice WebSite/scripts/script.js b/Profice WebSite/scripts/script.js index c2f113e..631eee2 100644 --- a/Profice WebSite/scripts/script.js +++ b/Profice WebSite/scripts/script.js @@ -73,6 +73,87 @@ document.addEventListener("DOMContentLoaded", function() { initButtonNavigation(); + // ========================================== + // 1.6. PHONE CALL FUNCTIONALITY + // ========================================== + + function initPhoneCallFunctionality() { + const demoPhoneBtn = document.getElementById('demoPhoneBtn'); + + if (demoPhoneBtn) { + demoPhoneBtn.addEventListener('click', function(e) { + // Check if mobile device + const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); + + if (!isMobile) { + e.preventDefault(); + + // Show desktop fallback message + const phoneNumber = '+49 123 456789'; + const message = `Bitte rufen Sie uns direkt an: ${phoneNumber}\n\nOder nutzen Sie das Kontaktformular für eine schriftliche Anfrage.`; + + // Create a custom modal instead of alert + const modal = document.createElement('div'); + modal.style.cssText = ` + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0,0,0,0.5); + display: flex; + align-items: center; + justify-content: center; + z-index: 10000; + font-family: system-ui, -apple-system, sans-serif; + `; + + modal.innerHTML = ` +
+

Telefonnummer

+

${message}

+ +
+ `; + + document.body.appendChild(modal); + + // Close modal on click + modal.addEventListener('click', function(e) { + if (e.target === modal || e.target.tagName === 'BUTTON') { + document.body.removeChild(modal); + } + }); + + // Auto-close after 5 seconds + setTimeout(() => { + if (document.body.contains(modal)) { + document.body.removeChild(modal); + } + }, 5000); + } + }); + } + } + + initPhoneCallFunctionality(); + // ========================================== // 2. MENU TOGGLE // ==========================================