@@ -3218,14 +3225,20 @@ function resumeProgress() {
}
}
-// Define a function to toggle the opacity
-function toggleOpacity() {
- const element = document.getElementById('shadow');
+ function toggleOpacity() {
+ const element = document.getElementById('shadow'); // Replace 'yourElementId' with the ID of your element
+ const video = document.getElementById('video'); // Assuming your video element has an ID of 'video'
const currentOpacity = parseFloat(window.getComputedStyle(element).opacity);
+ if (video.paused) {
+ return;
+ }
+
if (currentOpacity === 1) {
+ element.style.transition = 'opacity 1s ease'; // Adjust the duration as needed
element.style.opacity = 0;
} else {
+ element.style.transition = 'opacity 1s ease'; // Adjust the duration as needed
element.style.opacity = 1;
}
}
@@ -3234,6 +3247,11 @@ function toggleOpacity() {
setInterval(toggleOpacity, 200);
};
+
+ window.onload = function() {
+ setInterval(toggleOpacity, 200);
+};
+
video.addEventListener('timeupdate', () => {
if (Math.floor(video.currentTime) % 1 === 0) {
saveProgress();