/* متجر هدباء - تخصيص JavaScript */ document.addEventListener('DOMContentLoaded', () => { // 1. إخفاء روابط سلة document.querySelectorAll('footer a').forEach(link => { const href = link?.href || ''; const text = link?.textContent || ''; if (href.includes('salla.sa') || text.includes('سلة')) { link.style.display = 'none'; } }); // 2. تغيير نصوص أزرار الشراء const updateButtonText = () => { document.querySelectorAll('button, .btn').forEach(btn => { const text = btn.textContent.trim(); if (text.includes('أضف للسلة') || text.includes('اشترِ الآن')) { btn.textContent = 'اطلب الآن'; } }); }; updateButtonText(); // تنفيذ أولي const observer = new MutationObserver(updateButtonText); observer.observe(document.body, { childList: true, subtree: true }); // 3. تغيير عنوان الهيدر const headerTitle = document.querySelector('header h1, .header h1, .site-title'); if (headerTitle) { headerTitle.textContent = 'متجر هدباء'; } // 4. زر الرجوع للأعلى const toTopBtn = document.querySelector('.back-to-top, .scroll-top'); if (toTopBtn) { toTopBtn.addEventListener('click', () => { window.scrollTo({ top: 0, behavior: 'smooth' }); }); } // 5. تعديل نص الحقوق const copyright = document.querySelector('.copyright-text p'); if (copyright) { copyright.innerHTML = 'جميع الحقوق محفوظة لموقع هدباء'; } // 6. رسالة ترحيب بالكونسول console.log('✨ مرحباً بك في متجر هدباء!'); });