Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var vid = document.getElementById("bgvid");
- var pauseButton = document.querySelector("#baba button");
- if (window.matchMedia('(prefers-reduced-motion)').matches) {
- vid.removeAttribute("autoplay");
- vid.pause();
- pauseButton.innerHTML = "D U R D U R";
- }
- function vidFade() {
- vid.classList.add("stopfade");
- }
- vid.addEventListener('ended', function()
- {
- vid.pause();
- vidFade();
- });
- pauseButton.addEventListener("click", function() {
- vid.classList.toggle("stopfade");
- if (vid.paused) {
- vid.play();
- pauseButton.innerHTML = "D U R D U R";
- } else {
- vid.pause();
- pauseButton.innerHTML = "O Y N A T";
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement