diff options
author | Michael Foiani <sotech117@michaels-mbp-21.devices.brown.edu> | 2022-09-02 13:38:17 -0400 |
---|---|---|
committer | Michael Foiani <sotech117@michaels-mbp-21.devices.brown.edu> | 2022-09-02 13:38:17 -0400 |
commit | c966372da35b16bb03652fdb9ceca681610066df (patch) | |
tree | 299cc8a888c6e8419e875d6af4a8f8a9ec72feaf /index.js | |
parent | 1a8ec25c000bbc01a02eeab8f25c2ec3ab5db829 (diff) |
remove particles, remove link rainbows
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 29 |
1 files changed, 5 insertions, 24 deletions
@@ -1,31 +1,12 @@ -particlesJS.load('particles-js', '/particles.json', () => - console.log('callback - particles.js config loaded') -); -// -// //canvas of the particles -// const particleWrapper = document.querySelector('#particles-js') -// console.log(document.body.scrollHeight, particleWrapper.style.height) - -const thresholdFidelity = 500; - -// const particleObserver = new IntersectionObserver(entries => { -// // note - if the boundingClientRect.y is negative, then they are scrolling down -// // note - since using id, only 1 entry -// console.log(entries[0]) -// const {intersectionRatio, boundingClientRect} = entries[0]; -// if (intersectionRatio !== 1) { -// console.log(particleWrapper.style) -// particleWrapper.style.top = `${parseFloat(particleWrapper.style.top.replace('px', '')) - boundingClientRect.top}px`; -// } -// }, { -// threshold: .5 -// }); -// particleObserver.observe(particleWrapper) +const THRESHOLD_FIDELITY = 1000; // mutation observer for the video element const videoTitle = document.querySelector('#video-title'); console.log(videoTitle); +const pastryIframe = document.querySelector('#connie-pastries') +console.log(pastryIframe.textContent); + const observer = new IntersectionObserver(entries => { // note - if the boundingClientRect.y is negative, then they are scrolling down @@ -37,7 +18,7 @@ const observer = new IntersectionObserver(entries => { videoTitle.currentTime = 2; } }, { - threshold: [...Array(thresholdFidelity).keys()].map(num => num/thresholdFidelity) + threshold: [...Array(THRESHOLD_FIDELITY).keys()].map(num => num/THRESHOLD_FIDELITY) }); // after two seconds pause the video |