الرئيسية
تسجيل الدخول
هل نسيت كلمة المرور؟
تسجيل عضوية جديدة
0
/* === Left Social Bar (small, clean, no stray text) === */ (function(){ if (window.__LSB__) return; window.__LSB__ = true; // 1) CSS صغير وآمن (بدون ظهور نص على الصفحة) var css = '' +'.lsb-wrap{position:fixed;left:12px;top:50%;transform:translateY(-50%);z-index:2147483647;pointer-events:auto;font-family:Segoe UI,Tahoma,Arial,sans-serif}' +'.lsb-list{margin:0;padding:4px;list-style:none;display:flex;flex-direction:column;gap:8px;align-items:flex-start}' +'.lsb-item{position:relative;display:flex;align-items:center;gap:8px;background:rgba(0,0,0,.42);padding:6px;border-radius:12px;min-width:40px;height:40px;box-shadow:0 8px 22px rgba(0,0,0,.25);cursor:pointer;transition:transform .18s ease,background .18s ease;will-change:transform}' +'.lsb-item:hover{transform:translateX(6px);background:rgba(0,0,0,.6)}' +'.lsb-item:focus{outline:none;box-shadow:0 0 0 3px rgba(88,222,238,.18)}' +'.lsb-icon{width:24px;height:24px;object-fit:contain;display:block;border-radius:6px;background:transparent}' +'.lsb-tooltip{position:absolute;left:52px;top:50%;transform:translateY(-50%) translateX(-8px);background:rgba(18,18,20,.96);color:#fff;padding:8px 10px;border-radius:10px;min-width:150px;max-width:220px;box-shadow:0 10px 30px rgba(2,6,23,.6);opacity:0;pointer-events:none;transition:opacity .18s ease,transform .22s cubic-bezier(.2,.9,.3,1);transform-origin:left center}' +'.lsb-tooltip::before{content:"";position:absolute;left:-6px;top:50%;transform:translateY(-50%);border:6px solid transparent;border-right-color:rgba(18,18,20,.96)}' +'.lsb-tooltip strong{display:block;font-size:13px;line-height:1.1;margin-bottom:2px}' +'.lsb-tooltip .lsb-sub{font-size:11.5px;color:rgba(255,255,255,.85)}' +'.lsb-item.lsb-open .lsb-tooltip,.lsb-item:hover .lsb-tooltip{opacity:1;transform:translateY(-50%) translateX(0);pointer-events:auto}' +'@media(max-width:720px){.lsb-wrap{left:6px}.lsb-item{min-width:38px;height:38px;padding:6px;border-radius:50%;justify-content:center}.lsb-tooltip{left:50px;min-width:135px}.lsb-icon{width:22px;height:22px}}'; var s = document.createElement('style'); s.id = 'lsb_styles'; s.textContent = css; (document.head || document.documentElement).appendChild(s); // 2) HTML var wrap = document.createElement('div'); wrap.className = 'lsb-wrap'; wrap.innerHTML = ''; (document.body || document.documentElement).appendChild(wrap); // 3) السلوك: هوفر/لمس/كيبورد function openItem(li){ closeAll(); li.classList.add('lsb-open'); } function closeItem(li){ li.classList.remove('lsb-open'); } function closeAll(){ document.querySelectorAll('.lsb-item.lsb-open').forEach(i=>i.classList.remove('lsb-open')); } document.querySelectorAll('.lsb-item').forEach(function(li){ // desktop li.addEventListener('mouseenter', function(){ openItem(li); }); li.addEventListener('mouseleave', function(){ closeItem(li); }); li.addEventListener('focus', function(){ openItem(li); }); li.addEventListener('blur', function(){ closeItem(li); }); // click: أول نقرة تفتح التولتيب على الجوال، الثانية تفتح الرابط li.addEventListener('click', function(e){ var href = li.getAttribute('data-href'); if (!href) return; if (li.classList.contains('lsb-open')) { window.open(href, '_blank', 'noopener'); } else { openItem(li); } }); // keyboard li.addEventListener('keydown', function(ev){ if (ev.key === 'Enter' || ev.key === ' ') { ev.preventDefault(); var href = li.getAttribute('data-href'); if (href) window.open(href, '_blank', 'noopener'); } }); // touch ( للجوال ) var t; li.addEventListener('touchstart', function(ev){ ev.stopPropagation(); if (li.classList.contains('lsb-open')) { var href = li.getAttribute('data-href'); if (href) window.open(href, '_blank', 'noopener'); return; } openItem(li); if (t) clearTimeout(t); t = setTimeout(function(){ closeItem(li); }, 3500); }, {passive:true}); }); // إغلاق عند الضغط خارج الشريط document.addEventListener('click', function(e){ if (!e.target.closest('.lsb-wrap')) closeAll(); }, {passive:true}); })();
تصميم وبرمجة