-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
22 lines (21 loc) · 717 Bytes
/
script.js
File metadata and controls
22 lines (21 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
document.addEventListener('DOMContentLoaded', () => {
const logoSVG = document.getElementById('logo');
const logoSVGPath = document.querySelector('.cls-1');
logoSVGPath.addEventListener('animationend', () => {
logoSVG.classList.remove('animate');
setTimeout(() => {
logoSVG.classList.add('animate');
}, 5000);
});
const mediaQuery = matchMedia('(prefers-reduced-motion)');
const checkReducedMotion = () => {
const video = document.querySelectorAll('.bg-video');
if (mediaQuery.matches) {
video.forEach((v) => v.pause());
} else {
video.forEach((v) => v.play());
}
};
checkReducedMotion();
mediaQuery.addEventListener('change', checkReducedMotion);
});