document.addEventListener('DOMContentLoaded', function () { // 1. تغيير النصوص ديناميكيًا document.querySelector('h1').innerText = 'مرحبًا بك في بريق النحل'; document.querySelector('h2').innerText = 'اكتشف منتجاتنا'; // 2. حل مشكلة ملفات تعريف الارتباط (Cookies) if (!localStorage.getItem('cookies_accepted')) { var cookieBanner = document.createElement('div'); cookieBanner.id = 'cookie-banner'; cookieBanner.innerHTML = `

نحن نستخدم ملفات تعريف الارتباط لتحسين تجربتك. اعرف المزيد.

`; document.body.appendChild(cookieBanner); document.getElementById('accept-cookies').addEventListener('click', function () { localStorage.setItem('cookies_accepted', 'true'); document.getElementById('cookie-banner').style.display = 'none'; loadExternalScripts(); }); } else { loadExternalScripts(); } function loadExternalScripts() { var script = document.createElement('script'); script.src = 'https://sc-static.net/scevent.min.js'; document.head.appendChild(script); } // 3. إضافة زر واتساب let whatsappButton = document.createElement('div'); whatsappButton.id = 'whatsapp-button'; whatsappButton.innerHTML = ` `; document.body.appendChild(whatsappButton); // 4. تحسين التصميم وتحديد نسب العرض إلى الارتفاع var style = document.createElement('style'); style.innerHTML = ` /* تحسين زر واتساب */ #whatsapp-button { position: fixed; bottom: 20px; right: 20px; z-index: 9999; } #whatsapp-button a { display: inline-block; background-color: #b47227; padding: 15px; border-radius: 50%; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); transition: transform 0.3s ease, box-shadow 0.3s ease; text-decoration: none; border: 3px solid #f8b654; animation: shine 3s infinite; } #whatsapp-button a:hover { transform: scale(1.1); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); } @keyframes shine { 0% { box-shadow: 0 0 8px #b47227, 0 0 20px #b47227; } 50% { box-shadow: 0 0 15px #f8b654, 0 0 30px #f8b654; } 100% { box-shadow: 0 0 8px #b47227, 0 0 20px #b47227; } } /* تحسين تسلسل النصوص */ h1, h2 { text-align: center; margin: 1rem auto; } h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } /* تحديد نسب العرض إلى الارتفاع */ img { width: auto; height: auto; max-width: 100%; } `; document.head.appendChild(style); // تحسين عرض الصفحة var viewportMeta = document.createElement('meta'); viewportMeta.name = "viewport"; viewportMeta.content = "width=device-width, initial-scale=1, maximum-scale=5, user-scalable=yes"; document.head.appendChild(viewportMeta); // 5. إضافة لوجو مع أبعاد ثابتة var logo = document.createElement('img'); logo.src = "https://cdn.assets.salla.network/themes/1034648396/1.100.0/images/mada.png"; logo.alt = "mada"; logo.style.cssText = "display: block; margin: 0 auto; max-width: 200px; height: auto;"; document.body.appendChild(logo); });