diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 4623b3ff..f5ca45d6 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -38,9 +38,13 @@ anchor.addEventListener("click", function (e) { e.preventDefault(); var id = this.getAttribute("href").substr(1); - document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView({ - behavior: "smooth" - }); + if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) { + document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView({ + behavior: "smooth" + }); + } else { + document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView(); + } if (id === "top") { history.replaceState(null, null, " "); } else {