summaryrefslogtreecommitdiff
path: root/script.js
diff options
context:
space:
mode:
Diffstat (limited to 'script.js')
-rw-r--r--script.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/script.js b/script.js
index ca69230..ad80f63 100644
--- a/script.js
+++ b/script.js
@@ -12,14 +12,15 @@ const observer = new IntersectionObserver(entries => {
// note - if the boundingClientRect.y is negative, then they are scrolling down
// note - since using id, only 1 entry
const {intersectionRatio, boundingClientRect} = entries[0];
- if (intersectionRatio !== 1 && boundingClientRect.y <= 0) {
+ console.log(entries[0])
+ if (intersectionRatio !== 1 ) {
videoTitle.currentTime = 5 - 3 * intersectionRatio;
} else {
videoTitle.currentTime = 2;
}
}, {
threshold: [...Array(THRESHOLD_FIDELITY).keys()].map(num => num/THRESHOLD_FIDELITY),
- rootMargin: '-75px'
+ rootMargin: '-150px 0px 0px 0px'
});
// after two seconds pause the video