17 lines
487 B
JavaScript
17 lines
487 B
JavaScript
{cf8e01c75a36cdb3de68c858259df2ea721c3d92 true 487 main.js 0xc002d7cc40}
const btn = document.querySelector(".btn");
|
|
const video = document.querySelector(".background-video");
|
|
const fa = document.querySelector(".fa");
|
|
|
|
btn.addEventListener("click", () => {
|
|
if (btn.classList.contains("pause")) {
|
|
btn.classList.remove("pause");
|
|
video.play();
|
|
fa.classList.add("fa-pause");
|
|
fa.classList.remove("fa-play");
|
|
} else {
|
|
btn.classList.add("pause");
|
|
video.pause();
|
|
fa.classList.remove("fa-pause");
|
|
fa.classList.add("fa-play");
|
|
}
|
|
}); |