Jump to content
Search Community

gilperez

Premium
  • Posts

    4
  • Joined

  • Last visited

About gilperez

gilperez's Achievements

  1. Thank you. i was just trying that one. I'll try it and see what happens. Thanks for your help!
  2. Yes, I did! But now i'm trying to figure out how to deploy it to Vercel. I keep getting this error ( Module not found: Can't resolve 'gsap/dist/ScrollSmoother' in '/vercel/path0/src/components' 21:28:49.322 ) Is there something i need to do when deploying because i'm a member and am using the token? Any ideas?
  3. Thanks for the quick response. Using the gsap/dist/ worked but only after i implemented the ScrollTrigger (Which ScrollSmoother seems to be dependent on) and implementation of a useEffect. Here is my final code. import React from 'react' import Footer from './Footer' import Header from './Header' import { useRouter } from 'next/router' import { useEffect } from 'react' import { gsap } from 'gsap/dist/gsap' import { ScrollTrigger } from 'gsap/dist/ScrollTrigger' import { ScrollSmoother } from "gsap/dist/ScrollSmoother" export default function Layout({ children }) { gsap.registerPlugin(ScrollTrigger, ScrollSmoother) useEffect(() => { const smoother = ScrollSmoother.create({ wrapper: "#smooth-wrapper", content: "#smooth-content", }) return () => { smoother } }, []) const router = useRouter() return ( <div id='smooth-wrapper' className='grid grid-cols-[1fr] w-full'> <div id='smooth-content' className={router && router.pathname === '/more' ? 'darkmode' : 'lightmode'}> {router.pathname !== '/posts/[slug]' && router.pathname !== '/projects/[slug]' ? <Header /> : ''} <div className='grid py-40 w-auto p-5'>{children}</div> <Footer /> </div> </div> ) }
  4. Hi, I just joined the club. I installed via NPM. I'm using NextJs. Packages seemed to be installed correctly, but when I implement it in my file I get the "unexpected token 'export' Error. Any thoughts or solutions would be appreciated.
×
×
  • Create New...