#toTopBtn {
position: fixed;
bottom: 30px;
right: 25px;
z-index: 999;
background-color: #E11315; /* Rouge Eat2Serve */
color: #fff;
padding: 12px 16px;
border-radius: 50px;
font-size: 14px;
font-weight: 600;
border: none;
cursor: pointer;
box-shadow: 0 6px 15px rgba(0,0,0,0.2);
transition: all 0.3s ease-in-out;
display: none;
}
#toTopBtn:hover {
background-color: #b50e11;
transform: translateY(-2px);
}
⬆ Haut
window.onscroll = function() {
const btn = document.getElementById(« toTopBtn »);
if (document.body.scrollTop > 300 || document.documentElement.scrollTop > 300) {
btn.style.display = « block »;
} else {
btn.style.display = « none »;
}
};
document.getElementById(« toTopBtn »).addEventListener(« click », () => {
window.scrollTo({ top: 0, behavior: « smooth » });
});