summaryrefslogtreecommitdiff
path: root/script.js
diff options
context:
space:
mode:
authorMichael Foiani <sotech117@michaels-mbp-21.devices.brown.edu>2022-09-06 14:00:57 -0400
committerMichael Foiani <sotech117@michaels-mbp-21.devices.brown.edu>2022-09-06 14:00:57 -0400
commita8ebf0d5f5224a1d89945145ee6de1e3d79f7262 (patch)
tree1fbd29e1fd248a3459f8333b3538a002e64baaec /script.js
parentc7274825b5fc28d5e82d7984db8312ef05bfad0f (diff)
review with connie - good stylistic changes
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