{"size": 402, "ext": "js", "max_stars_repo_path": "js/components/TheBackToTopBtnComponent.js", "max_stars_repo_name": "selenaelisewells/LRG_site_build", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "js/components/TheBackToTopBtnComponent.js", "max_issues_repo_name": "selenaelisewells/LRG_site_build", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "js/components/TheBackToTopBtnComponent.js", "max_forks_repo_name": "selenaelisewells/LRG_site_build", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.8, "max_line_length": 69, "alphanum_fraction": 0.6268656716}
export default () => {

    const scrollToTopBtn = document.getElementById("scrollToTopBtn");
    const rootElement = document.documentElement;
    //add the click event to the button
    function scrollToTop() {
        //scroll to top logic
        rootElement.scrollTo({
            top: 0,
            behavior: "smooth"
        })
    }

    scrollToTopBtn.addEventListener("click", scrollToTop)
}