document.addEventListener("DOMContentLoaded", function () {
const section = document.querySelector(".transparent-on-top");
if (section) {
window.addEventListener("scroll", function () {
if (window.scrollY > 50) { // Adjust the value for when the background should change
section.classList.add("scrolled");
} else {
section.classList.remove("scrolled");
}
});
}
});