From a8ebf0d5f5224a1d89945145ee6de1e3d79f7262 Mon Sep 17 00:00:00 2001 From: Michael Foiani Date: Tue, 6 Sep 2022 14:00:57 -0400 Subject: review with connie - good stylistic changes --- script.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'script.js') 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 -- cgit v1.2.3-70-g09d2