diff options
author | Michael Foiani <sotech117@michaels-mbp-21.devices.brown.edu> | 2022-09-06 14:00:57 -0400 |
---|---|---|
committer | Michael Foiani <sotech117@michaels-mbp-21.devices.brown.edu> | 2022-09-06 14:00:57 -0400 |
commit | a8ebf0d5f5224a1d89945145ee6de1e3d79f7262 (patch) | |
tree | 1fbd29e1fd248a3459f8333b3538a002e64baaec /script.js | |
parent | c7274825b5fc28d5e82d7984db8312ef05bfad0f (diff) |
review with connie - good stylistic changes
Diffstat (limited to 'script.js')
-rw-r--r-- | script.js | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 |