production refactor

This commit is contained in:
Andrew Gundersen 2021-10-16 09:39:10 -05:00
commit 41528e7e27
115 changed files with 20719 additions and 22107 deletions

View file

@ -0,0 +1,24 @@
let el;
const initScroll = (elementId) => {
el = document.getElementById(elementId);
el.addEventListener('adjust-scroll', adjustScroll);
window.addEventListener('resize', adjustScroll);
}
const isBottom = () => {
if (el) {
return el.scrollHeight - el.clientHeight <= el.scrollTop + 1;
}
}
const adjustScroll = () => {
if (el) {
el.scrollTo({
top: el.scrollHeight - el.clientHeight,
behavior: 'smooth'
});
}
}
export default initScroll;