From 8fe8472d2e175c52fe22ad508713e509efe4d2c9 Mon Sep 17 00:00:00 2001 From: Alvaro Date: Fri, 15 Nov 2024 12:09:37 +0100 Subject: [PATCH] Simplify scrolling --- src/components/globe-map/globe.tsx | 5 ++- src/components/home/section-2/index.tsx | 56 ++++++++++++------------- src/lib/utils.ts | 11 ----- 3 files changed, 31 insertions(+), 41 deletions(-) diff --git a/src/components/globe-map/globe.tsx b/src/components/globe-map/globe.tsx index b7197ec..9055859 100644 --- a/src/components/globe-map/globe.tsx +++ b/src/components/globe-map/globe.tsx @@ -1,8 +1,9 @@ -import { useTexture, useVideoTexture } from "@react-three/drei"; import { Suspense } from "react"; -import { ShaderMaterial, DoubleSide, NearestFilter } from "three"; import { useRef, useMemo } from "react"; +import { useTexture, useVideoTexture } from "@react-three/drei"; +import { ShaderMaterial, DoubleSide, NearestFilter } from "three"; + function VideoMaterial({ url }: { url: string }) { const texture = useVideoTexture(url, { playsInline: true, diff --git a/src/components/home/section-2/index.tsx b/src/components/home/section-2/index.tsx index 29cf298..451c55f 100644 --- a/src/components/home/section-2/index.tsx +++ b/src/components/home/section-2/index.tsx @@ -1,23 +1,29 @@ "use client"; import { useRef, useEffect, useState, forwardRef } from "react"; + import dynamic from "next/dynamic"; + const Lines = dynamic(() => import("@/components/lines"), { ssr: false }); -import GlobeMap from "@/components/globe-map"; -import { Resizable } from "re-resizable"; -import { Button } from "@/components/button"; -import CaretRight from "@/svgs/caret-right.svg"; -import { cn } from "@/lib/utils"; +import { useGesture } from "@use-gesture/react"; import { useScroll, motion, useMotionValueEvent, useInView, AnimatePresence } from "framer-motion"; +import { Resizable } from "re-resizable"; +import { useRecoilState } from "recoil"; + import { useWindowWidth } from "@/lib/hooks"; -import { scrollToSection } from "@/lib/utils"; import { useIsMobile } from "@/lib/hooks"; -import InfoPopover from "../../info-popover"; -import ArrowRight from "@/svgs/arrow-right.svg"; -import { useGesture } from "@use-gesture/react"; -import { useRecoilState } from "recoil"; +import { cn } from "@/lib/utils"; + import { globePhaseAtom } from "@/store"; +import { Button } from "@/components/button"; +import GlobeMap from "@/components/globe-map"; + +import ArrowRight from "@/svgs/arrow-right.svg"; +import CaretRight from "@/svgs/caret-right.svg"; + +import InfoPopover from "../../info-popover"; + const ResizeButton = () => ( <>