scroll trigger fix

This commit is contained in:
saml33 2023-05-17 21:44:05 +10:00
parent e4be9849d6
commit b34e78ada8
1 changed files with 4 additions and 6 deletions

View File

@ -12,10 +12,13 @@ import IconWithText from '../shared/IconWithText'
import SectionWrapper from '../shared/SectionWrapper'
import { gsap } from 'gsap'
import { ScrollTrigger } from 'gsap/ScrollTrigger'
import { useEffect, useLayoutEffect, useRef } from 'react'
import { useLayoutEffect, useRef } from 'react'
import { MotionPathPlugin } from 'gsap/dist/MotionPathPlugin'
import ColorBlur from '../shared/ColorBlur'
gsap.registerPlugin(MotionPathPlugin)
gsap.registerPlugin(ScrollTrigger)
const tokenIcons = [
{ icon: 'coin-orange.png', x: '10%', y: '20%' },
{ icon: 'coin-silver.png', x: '2%', y: '10%' },
@ -41,11 +44,6 @@ const HomePage = () => {
const swapPanel = useRef()
const coreFeatures = useRef()
useEffect(() => {
gsap.registerPlugin(MotionPathPlugin)
gsap.registerPlugin(ScrollTrigger)
}, [])
useLayoutEffect(() => {
const ctx = gsap.context((self) => {
const boxes = self.selector('.highlight-features')