(() => {
const sel = '.container__availablepackages';
function apply(el){
// inject keyframes مرة واحدة
if (!document.getElementById('bgAnimStyle')) {
const st = document.createElement('style');
st.id = 'bgAnimStyle';
st.textContent = `
@keyframes bgMoveX {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
`;
document.head.appendChild(st);
}
el.style.setProperty('min-height','300px','important');
el.style.setProperty('background','linear-gradient(270deg,#0f2027,#203a43,#2c5364)','important');
el.style.setProperty('background-size','500% 500%','important');
el.style.setProperty('animation','bgMoveX 12s ease infinite','important');
el.style.setProperty('outline','5px solid lime','important');
console.log('✅ Applied animated background to:', el);
}
const now = document.querySelector(sel);
if (now) return apply(now);
const obs = new MutationObserver(() => {
const el = document.querySelector(sel);
if (el) {
apply(el);
obs.disconnect();
}
});
obs.observe(document.documentElement, { childList: true, subtree: true });
console.log('👀 Waiting for element to appear:', sel);
})();