/* Add custom Js code below */ const footerCopyright = document.querySelector('.store-footer .copyright-text'); footerCopyright.innerHTML = `
تصميم وبرمجة شركه اول اساس لخدمات الاعمال
`; // انتظر تحميل الصفحة بالكامل document.addEventListener('DOMContentLoaded', function() { // جرب كل الطرق الممكنة للوصول للـ testimonials section let testimonialsSection = document.querySelector('body.index .s-block--testimonials section'); // لو مش لاقيها، جرب بدون body.index if (!testimonialsSection) { testimonialsSection = document.querySelector('.s-block--testimonials section'); } // لو برضو مش لاقيها، جرب testimonials لوحدها if (!testimonialsSection) { testimonialsSection = document.querySelector('.s-block--testimonials'); } if (!testimonialsSection) { return; } // Create the section element const mapSection = document.createElement('section'); mapSection.className = 's-block--map'; mapSection.style.cssText = ` padding: 80px 20px; background: #065e6d; overflow: hidden; `; // Create container const container = document.createElement('div'); container.style.cssText = ` max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 60px; flex-wrap: wrap; `; // Create text content (right side) const textContent = document.createElement('div'); textContent.style.cssText = ` flex: 1; min-width: 280px; color: white; text-align: center; `; const heading = document.createElement('h2'); heading.textContent = 'يشرفنا زيارتكم، موقعنا هنا'; heading.style.cssText = ` font-family: inherit; font-size: clamp(25px, 4vw, 35px); font-weight: bold; margin: 0 0 20px 0; line-height: 1.4; text-shadow: 2px 2px 4px rgba(0,0,0,0.2); `; textContent.appendChild(heading); // Create map container (left side) const mapContainer = document.createElement('div'); mapContainer.style.cssText = ` flex: 1; min-width: 280px; position: relative; cursor: pointer; border-radius: 20px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.3); transition: transform 0.3s ease, box-shadow 0.3s ease; `; // Create iframe const iframe = document.createElement('iframe'); iframe.src = 'https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3621.8792723848455!2d46.77523408499835!3d24.79958718408265!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3e2effbdcdf820f3%3A0x59c861ab146fbd12!2z2YXYpNiz2LPYqSDYp9mE2YPYs9mI2Kkg2KfZhNmG2YXZiNiw2KzZitipINmE2YTYqtis2KfYsdip!5e0!3m2!1sar!2seg!4v1761597770839!5m2!1sar!2seg'; iframe.width = '100%'; iframe.height = '450'; iframe.style.cssText = ` border: 0; display: block; max-height: 450px; `; iframe.setAttribute('allowfullscreen', ''); iframe.setAttribute('loading', 'lazy'); iframe.setAttribute('referrerpolicy', 'no-referrer-when-downgrade'); mapContainer.appendChild(iframe); // Add hover effect mapContainer.addEventListener('mouseenter', () => { mapContainer.style.transform = 'translateY(-10px) scale(1.02)'; mapContainer.style.boxShadow = '0 25px 70px rgba(0,0,0,0.4)'; }); mapContainer.addEventListener('mouseleave', () => { mapContainer.style.transform = 'translateY(0) scale(1)'; mapContainer.style.boxShadow = '0 20px 60px rgba(0,0,0,0.3)'; }); // Click to open Google Maps mapContainer.addEventListener('click', () => { window.open('https://maps.app.goo.gl/bbCXTJ7JeTuQb5Q46', '_blank'); }); // Append elements container.appendChild(textContent); container.appendChild(mapContainer); mapSection.appendChild(container); // Insert after testimonials section testimonialsSection.insertAdjacentElement('afterend', mapSection); // Responsive adjustments const mediaQuery = window.matchMedia('(max-width: 768px)'); function handleResponsive(e) { if (e.matches) { container.style.flexDirection = 'column'; mapSection.style.padding = '60px 15px'; iframe.style.maxHeight = '350px'; iframe.height = '350'; } else { container.style.flexDirection = 'row'; mapSection.style.padding = '80px 20px'; iframe.style.maxHeight = '450px'; iframe.height = '450'; } } mediaQuery.addListener(handleResponsive); handleResponsive(mediaQuery); }); // قائمة المنتجات المستثناة const excludedProducts = ['1562102729', '1928543352', '1990947601', '938375515']; // الحصول على معرف المنتج function getProductId() { const urlMatch = window.location.pathname.match(/\/p(\d+)/); if (urlMatch) return urlMatch[1]; const wishlistBtn = document.querySelector('salla-button[data-id]'); if (wishlistBtn) return wishlistBtn.getAttribute('data-id'); return null; } // إضافة رسالة الشحن function addShippingMessage() { const productId = getProductId(); if (!productId || excludedProducts.includes(productId)) return; if (document.querySelector('.free-shipping-notice')) return; const slider = document.querySelector('salla-slider.details-slider'); if (!slider) return; const shippingNotice = document.createElement('div'); shippingNotice.className = 'free-shipping-notice'; shippingNotice.innerHTML = `