HEX
Server: Apache
System: Linux linplesk41.pumo.com.tw 3.10.0-962.3.2.lve1.5.27.el7.x86_64 #1 SMP Sat Nov 30 02:18:52 EST 2019 x86_64
User: rajlaw (10192)
PHP: 7.4.24
Disabled: phpinfo,passthru,exec,shell_exec,system,popen,proc_open,proc_close,show_source,pcntl_exec,escapeshellcmd,proc_get_status,proc_nice,proc_terminate,escapeshellarg
Upload Files
File: /home/httpd/vhosts/rajlaw.com.tw/httpdocs/wp-content/themes/patterns-agency/src/public/index.js
/*CSS*/
import './index.scss';

/* Scroll to Top */
const scrollToTopBtn = document.querySelector(
    '.is-style-scroll-to-top .wp-element-button'
);
if (scrollToTopBtn) {
    window.addEventListener('scroll', () => {
        if (window.scrollY > 300) {
            scrollToTopBtn.style.opacity = '1';
            scrollToTopBtn.style.visibility = 'visible';
        } else {
            scrollToTopBtn.style.opacity = '0';
            scrollToTopBtn.style.visibility = 'hidden';
        }
    });

    scrollToTopBtn.addEventListener('click', () => {
        window.scrollTo({
            top: 0,
            behavior: 'smooth',
        });
    });
}
/* Write own JS */