...
`; document.body.appendChild(overlay); setTimeout(()=>overlay.classList.add('active'),30); const cleanUrl = window.location.origin + window.location.pathname; window.history.replaceState({}, document.title, cleanUrl); // الإغلاق بالنقر على الخلفية فقط overlay.addEventListener('click', function(e){ if(e.target === overlay){ overlay.classList.remove('active'); setTimeout(()=>overlay.remove(),300); } }); } });