//https://www.smashingmagazine.com/2021/10/respecting-users-motion-preferences/ const animationButton = document.querySelector(".button--toggle-animations"); const heroVideoContainer = document.querySelector(".hero__video"); const heroVideo = heroVideoContainer.querySelector("video"); const fsocVideo = document.querySelector("#fsoc"); const staticImages = document.querySelectorAll(".content-block-visuals__item-static"); animationButton.addEventListener("click", () =>{ staticImages.forEach(image => { image.classList.toggle('show'); }) if (animationButton.innerHTML === "ANIMATIONS ON") { animationButton.innerHTML = "ANIMATIONS OFF"; } else { animationButton.innerHTML = "ANIMATIONS ON"; } heroVideo.paused ? heroVideo.play() : heroVideo.pause(); fsocVideo.paused ? fsocVideo.play() : fsocVideo.pause(); });