const scrollButtons = `
`
document.body.insertAdjacentHTML('beforeend', scrollButtons);
const scroll_up = document.querySelector('#scroll-up');
const scroll_down = document.querySelector('#scroll-down');
scroll_up.style.transition = scroll_down.style.transition = 'display 1.5s ease-in-out';
scroll_up.style.display = scroll_down.style.display = 'none';
scroll_up.addEventListener('click', () =>
window.scrollTo({ top: 0, behavior: 'smooth' }))
scroll_down.addEventListener('click', () =>
window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' }))
const check = () => {
scroll_down.style.display = (window.scrollY + window.innerHeight) > document.body.scrollHeight * .8 ? 'none' : 'block'
scroll_up.style.display = (window.scrollY) < document.body.scrollHeight * .2 ? 'none' : 'block'
}
['scroll', 'resize'].forEach(e => window.addEventListener(e, check))