(function () {
function run() {
document.getElementById("siteBGStyle")?.remove();
const style = document.createElement("style");
style.id = "siteBGStyle";
style.textContent = `
:root { --mx: 50%; --my: 50%; }
html, body { min-height: 100%; }
body{
background:
radial-gradient(
1000px 700px at var(--mx) var(--my),
rgba(255,163,0,0.38),
transparent 60%
),
radial-gradient(
900px 650px at 20% 25%,
rgba(255,193,80,0.28),
transparent 60%
),
radial-gradient(
900px 650px at 80% 75%,
rgba(255,140,0,0.22),
transparent 60%
),
linear-gradient(
120deg,
#ffffff,
#f6f7fb,
#ffffff
);
background-attachment: fixed;
animation: auroraShift 18s ease-in-out infinite;
color: #0f172a;
}
@keyframes auroraShift {
0% { filter: hue-rotate(0deg); }
50% { filter: hue-rotate(8deg); }
100% { filter: hue-rotate(0deg); }
}
@media (prefers-reduced-motion: reduce){
body { animation: none; }
}
`;
document.head.appendChild(style);
/* تفاعل الماوس */
let raf = null;
document.addEventListener("mousemove", (e) => {
if (raf) return;
raf = requestAnimationFrame(() => {
const x = Math.round((e.clientX / window.innerWidth) * 100);
const y = Math.round((e.clientY / window.innerHeight) * 100);
document.documentElement.style.setProperty("--mx", x + "%");
document.documentElement.style.setProperty("--my", y + "%");
raf = null;
});
}, { passive: true });
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", run);
} else {
run();
}
})();