diff options
author | Michael Foiani <sotech117@michaels-mbp-21.devices.brown.edu> | 2022-09-06 07:43:01 -0400 |
---|---|---|
committer | Michael Foiani <sotech117@michaels-mbp-21.devices.brown.edu> | 2022-09-06 07:43:01 -0400 |
commit | 2d21c6efd18b8a393b61012a0d805fccc51759c8 (patch) | |
tree | 631f29aa1696f981d4a2a544da62d3e940e2b297 /index.js | |
parent | 5f8787568dbdaa25b2af55e55c04144d459282de (diff) |
done except for the drawer
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 37 |
1 files changed, 24 insertions, 13 deletions
@@ -13,12 +13,13 @@ const observer = new IntersectionObserver(entries => { // note - since using id, only 1 entry const {intersectionRatio, boundingClientRect} = entries[0]; if (intersectionRatio !== 1 && boundingClientRect.y <= 0) { - videoTitle.currentTime = 5 - 2 * intersectionRatio; + videoTitle.currentTime = 5 - 3 * intersectionRatio; } else { videoTitle.currentTime = 2; } }, { - threshold: [...Array(THRESHOLD_FIDELITY).keys()].map(num => num/THRESHOLD_FIDELITY) + threshold: [...Array(THRESHOLD_FIDELITY).keys()].map(num => num/THRESHOLD_FIDELITY), + rootMargin: '-50px', }); // after two seconds pause the video @@ -29,14 +30,24 @@ setTimeout(() => { observer.observe(videoTitle); }, 2500) -// math for interactive conic border on weekly specials -const conicElement = document.querySelector('.conic-border'); -window.addEventListener('mousemove', ({ clientX, clientY }) => { - const { x, y, width, height } = conicElement.getBoundingClientRect(); - const dx = clientX - (x + 0.5 * width); - const dy = clientY - (y + 0.5 * height); - const angle = Math.atan2(dy, dx) * 180 / Math.PI; - - conicElement.style.setProperty('--startDeg', `${angle + 90}deg`); -}, false); - +// // math for interactive conic border on weekly specials +// const conicElement = document.querySelector('.conic-border'); +// window.addEventListener('mousemove', ({ clientX, clientY }) => { +// const { x, y, width, height } = conicElement.getBoundingClientRect(); +// const dx = clientX - (x + 0.5 * width); +// const dy = clientY - (y + 0.5 * height); +// const angle = Math.atan2(dy, dx) * 180 / Math.PI; +// +// conicElement.style.setProperty('--startDeg', `${angle + 90}deg`); +// }, false); + +// borrowed from https://www.w3schools.com/howto/howto_js_collapse_sidepanel.asp +/* Set the width of the sidebar to 250px (show it) */ +openNav = () => { + document.querySelector('#sidepanel').style.width = "250px"; +} + +/* Set the width of the sidebar to 0 (hide it) */ +closeNav = () => { + document.querySelector('#sidepanel').style.width = "0"; +}
\ No newline at end of file |