HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/quadcode/frontend/src/js/components/animations/AnimationAbout.js
import { gsap, Power4 } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import { headerRemoveWhite, headerWhite } from "../header/Header";

gsap.registerPlugin(ScrollTrigger, Power4);

export const firstAnimation = () => {
  gsap.to(".js-about-animation-left-1", {x: 0, duration: .65, opacity: 1, delay: .5});
  gsap.to(".js-about-animation-left-2", {x: 0, duration: .52, opacity: 1, delay: .5});
  gsap.to(".js-about-animation-left-3", {x: 0, duration: .43, opacity: 1, delay: .5});
  gsap.to(".js-about-animation-left-4", {x: 0, duration: .65, opacity: 1, delay: .5});
  gsap.to(".js-about-animation-right-1", {x: 0, duration: .55, opacity: 1, delay: .5});
  gsap.to(".js-about-animation-right-2", {x: 0, duration: .45, opacity: 1, delay: .5});
  const firstBlock = document.querySelector('.main-screen__first-animation');

  if (firstBlock) {
    gsap.to(".main-screen__first-animation-span-left-1", {left: 1200, duration: 1, opacity: 0, delay: .3});
    gsap.to(".main-screen__first-animation-span-left-2", {left: 1200, duration: 1, opacity: 0, delay: .3});
    gsap.to(".main-screen__first-animation-span-left-3", {left: 1200, duration: 1, opacity: 0, delay: .3});
    gsap.to(".main-screen__first-animation-span-right-1", {left: -1200, duration: 1, opacity: 0, delay: .3});
    gsap.to(".main-screen__first-animation-span-right-2", {left: -1200, duration: 1, opacity: 0, delay: .3});

    setTimeout(() => {
      firstBlock.remove();
    }, 1300);
  }
}

export const twoAnimation = () => {
  gsap.to('.main-screen__title', {
    y: 0,
    opacity: 1,
    duration: .5,
  });

  gsap.to('.main-screen__text', {
    y: 0,
    opacity: 1,
    duration: .5,
    delay: .1,
  });
}

export const threeAnimation = () => {
  const block = document.querySelectorAll('.block');

  block.forEach(item => {
    const title = item.querySelector('.block__title')
    const desc = item.querySelector('.block__desc')
    const img = item.querySelector('.block__img')
    const icon = item.querySelectorAll('.block-icon__item')
    const appIcon = item.querySelectorAll('.block__content-icon-item')

    if (title) {
      gsap.to(title, {
        y: 0,
        opacity: 1,
        duration: .5,
        delay: .1
      });
    }
    if (desc) {
      gsap.to(desc, {
        y: 0,
        opacity: 1,
        duration: .5,
        delay: .2
      });
    }
    if (img) {
      gsap.to(img, {

        y: 0,
        opacity: 1,
        duration: .5,
        delay: .3
      });
    }
    if (icon) {
      let time = 0.1;
      icon.forEach(itemIcon => {
        gsap.to(itemIcon, {
          y: 0,
          opacity: 1,
          delay: time
        });
        time += 0.05
      })
    }
    if (appIcon) {
      let time = 0.1;
      appIcon.forEach(itemIcon => {
        gsap.to(itemIcon, {
          y: 0,
          opacity: 1,
          delay: time
        });
        time += 0.1
      })
    }
  })
}

export const AnimationAboutScreen = (screen) => {

  if (screen === 1) {
    firstAnimation();
    setTimeout(() => {
      gsap.to('.main-screen__video-one', {opacity: 1, duration: .5});
    }, 800);
    gsap.to('.main-screen__video-two', {opacity: 0, duration: .5});
  }

  if (screen === 2) {
    setTimeout(() => {
      twoAnimation();
    }, 800);
    headerRemoveWhite();
    gsap.to('.main-screen__video-one', {opacity: 0, duration: .5});
    setTimeout(() => {
      gsap.to('.main-screen__video-two', {opacity: 1, duration: .5});
    }, 800);
  }

  if (screen === 3) {
    gsap.to('.main-screen__video-two', {opacity: 0, duration: .5});
    setTimeout(() => {
      threeAnimation();
    }, 600);
    setTimeout(() => {
      headerWhite();
    }, 600);
  }
}