<script src="assets/js/bharat-impact.bundle.min.js"></script>
<!-- JS for jQuery -->
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> -->
<script src="assets/js/jquery.min.js"></script>
<span id="top-to-bottom" class="position-fixed d-flex justify-content-center align-items-center bg-secondary">
    <i class="fa-solid fa-arrow-up-long"></i>
</span>
<script>
    document.addEventListener('DOMContentLoaded', () => {
        const scrollTop = document.querySelector('#top-to-bottom');
        if (scrollTop) {
            const toggleScrollTop = function() {
                window.scrollY > 100 ? scrollTop.classList.add('active') : scrollTop.classList.remove('active');
            };

            window.addEventListener('load', toggleScrollTop);
            document.addEventListener('scroll', toggleScrollTop);

            // Add click event listener correctly
            scrollTop.addEventListener('click', () => {
                window.scrollTo({
                    top: 0,
                    behavior: 'smooth'
                });
            });
        }
    });
</script>