function fixAll() { // إضافة label "اختر اللون" فوق الصور document.querySelectorAll('.s-product-options-option[data-option-type="thumbnail"]').forEach(function(opt) { if (opt.dataset.labelAdded) return; opt.dataset.labelAdded = true; var wrapper = opt.querySelector('.s-product-options-thumbnails-wrapper'); if (wrapper) { var label = document.createElement('p'); label.textContent = 'اختر اللون *'; label.style.cssText = 'color: red; font-weight: bold; font-size: 14px; margin-bottom: 6px; text-align: right;'; wrapper.parentNode.insertBefore(label, wrapper); } }); // اختر اللون بالأحمر عن طريق JS document.querySelectorAll('.s-product-options-option[data-option-type="thumbnail"] .s-product-options-option-label b').forEach(function(el) { el.style.setProperty('color', 'red', 'important'); el.style.setProperty('-webkit-text-fill-color', 'red', 'important'); }); // المقاس والارتفاع document.querySelectorAll('select[name^="options["]').forEach(function(select) { if (select.dataset.fixed) return; select.dataset.fixed = true; var container = select.closest('.s-product-options-option-container'); var labelText = container ? (container.querySelector('label b') || {}).textContent || '' : ''; var placeholder = select.querySelector('option[value=""]'); if (placeholder) { placeholder.textContent = labelText.includes('ارتفاع') ? 'اختر الارتفاع ↓' : 'اختر المقاس ↓'; } function updateColor() { select.style.color = select.value === '' ? 'red' : '#000'; } updateColor(); select.addEventListener('change', updateColor); }); } function updateColor() { if (select.value === '') { select.setAttribute('style', 'color: red !important'); } else { select.setAttribute('style', 'color: #000 !important'); } } setTimeout(fixAll, 500); setTimeout(fixAll, 1500); setTimeout(fixAll, 3000); /** * ============================================================ * SLEEPLINE — Custom JS | sleepline.com.sa * ============================================================ * الهيكل: * 0. CONFIG & HELPERS — الإعدادات والدوال المشتركة * 1. GLOBAL FEATURES — مميزات تعمل على كل الموقع * 1.1 Login popup * 1.2 Poptin pixel * 1.3 Hide cashback * 1.4 Pulsing menu items * 1.5 Purchase counter * 1.6 LinkedIn social icon * 1.7 Footer badges (ISO / صنع في السعودية) * 1.8 Size guide modal * 2. PAGE: BRANCH SELECTOR — page-309604307 * 3. PAGE: OLD BRANCHES — test01/page-2105897825 * 4. PAGE: B2B PROJECTS — page-658176410 * 5. PAGE: PACKAGES PROMO — page-252804995 * 6. PAGE: PACKAGES ERSAN — page-734960492 * 7. PAGE: CATEGORY BANNER — c1347300850 * ============================================================ */ ;(function () { 'use strict'; /* ============================================================ * 0. CONFIG & HELPERS * ============================================================ */ const CDN = 'https://cdn.salla.sa/BrAqEr/'; const cdnImg = (hash, ext = 'jpg') => `${CDN}${hash}.${ext}`; // brand tokens — مركزية كل الألوان const T = { primary: '#1e3c72', secondary: '#667393', accent: '#25d366', red: '#e63946', white: '#ffffff', offwhite: '#f8f9fa', border: '#e0e8f0', text: '#2d3748', muted: '#6b7280', }; /** إضافة