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/celestium/assets/js/animations.js
document.addEventListener('DOMContentLoaded', () => {
  let tl = gsap.timeline();

  // Hero image
  tl.to('.hero-image', {
    scale: 0.7,
    duration: 2.5, 
    ease: "slow(0.7, 0.7, false)",
    scrollTrigger: {
      trigger: '.hero-image',
      scrub: true,
      start: 'top center'
    }
  });

  // Number Counter
  if (document.querySelector(".number-counter")) {
    var numberDoms = document.querySelectorAll(".number-counter");
  
    numberDoms.forEach(function(numberDom) {
      var number = parseInt(numberDom.innerHTML);
  
      if (!isNaN(number)) {
        var counter = { number: 0 };
        gsap.to(counter, {
          duration: 3,
          number: number,
          onUpdate() {
            numberDom.innerHTML = counter.number.toFixed(0) + '+';
          }
        });
      }
    });
  }
  

  // Our Products
  if (document.querySelector('.our-products')) {
    const animationObject = document.querySelector('.our-products');
    gsap.from(animationObject.querySelectorAll('div'), {
      scrollTrigger: {
        trigger: animationObject,
        start: 'top 80%',
        toggleActions: "play none none none",
      },
      autoAlpha: 0,
      opacity: 0,
      y: -50,
      duration: 0.7,
      stagger: 0.075,
    });
  }


});