export default (() => {
    const preFooter = document.querySelector('.pre-footer')

    const backToTop = preFooter.querySelector('[data-back-to-top]')

    if (window.innerHeight < document.body.offsetHeight) {
        backToTop.style.display = 'inline-block'

        backToTop.addEventListener('click', (e) => {
            e.preventDefault()
            window.scrollTo({
                top: 0,
                behavior: 'smooth',
            });
        })
    }
})()