StaticImage

 import React, { useEffect, useRef } from "react"

import { StaticImage } from "gatsby-plugin-image"
import { gsap } from 'gsap';

export default function Hero() {

  let logo = useRef(null);

  useEffect(() => {
    let tl = gsap.timeline({ defaults: {opacity: 0, delay: 0.5} });
    tl.from(logo.current, {x:-100});  
  })

  return (
    <main>
      <div ref={logo}>
        <StaticImage
           src="../images/logo.png"
           width={500}
           alt="Hero Image"
         />
      </div>
    </main>
  )
}

Không có nhận xét nào:

StaticImage

  import React , { useEffect , useRef } from "react" import { StaticImage } from "gatsby-plugin-image" impor...