/* Add custom Js code below */ const metaViewport = document.querySelector('meta[name="viewport"]'); if (metaViewport) { metaViewport.content = "width=device-width, initial-scale=1, maximum-scale=5"; } const logo = document.querySelector(".navbar-brand img"); logo.alt = "Rafal Logo"; const allImgs = document.querySelectorAll("salla-slider.photos-slider .swiper-slide img"); const allA = document.querySelectorAll("salla-slider.photos-slider .swiper-slide a"); allImgs.forEach((img, index) => {img.alt = `slider img ${index}` img.setAttribute("width", "100vh"); img.setAttribute("height", "100vh"); }); allA.forEach((a, index) => a.setAttribute("aria-label", `a link ${index}`)); const menu = document.querySelector('a[href="#mobile-menu"]'); menu.setAttribute("aria-label", `mobile menu link `); const userBtn = document.querySelector('.header-btn'); userBtn.setAttribute("aria-label", `userBtn link `); // Create the WhatsApp button dynamically const whatsappButton = document.createElement("button"); whatsappButton.id = "whatsapp-button"; whatsappButton.setAttribute("aria-label", "whatsapp-button-label"); whatsappButton.className = "whatsapp-button"; whatsappButton.innerHTML = ` whatsapp-btn `; // Insert the WhatsApp button into the body of the page document.body.appendChild(whatsappButton); //HM // ننتظر تحميل كل العناصر setTimeout(function() { // العنصر المراد نقله const shareDiv = document.querySelector('salla-social-share').parentElement; // المكان الجديد - تحت الصور const imagesSection = document.querySelector('.product-single-media, .product-media, .swiper, .product-image'); if (shareDiv && imagesSection) { // إنشاء wrapper const wrapper = document.createElement('div'); wrapper.className = 'moved-share-btns'; // نسخ العنصر للمكان الجديد wrapper.appendChild(shareDiv.cloneNode(true)); // إضافته بعد الصور imagesSection.after(wrapper); // إخفاء العنصر الأصلي shareDiv.style.display = 'none'; } }, 1500);