diff --git a/components/BackgroundWrapper.tsx b/components/BackgroundWrapper.tsx index 91a729c..0a3bed9 100644 --- a/components/BackgroundWrapper.tsx +++ b/components/BackgroundWrapper.tsx @@ -5,6 +5,7 @@ import { Canvas, useFrame } from '@react-three/fiber' import { motion } from 'framer-motion' import dynamic from 'next/dynamic' import React, { useRef } from 'react' +import Cursor from './Cursor' import { pointsInner, pointsOuter } from './utils' const ScrollTopAndComment = dynamic(() => import('./ScrollTopAndComment'), { ssr: false }) @@ -60,6 +61,7 @@ function Point({ position, color }) { export default function BackgroundWrapper({ children }: { children: React.ReactNode }) { return (
+ { + const mouseMove = (e) => { + setPosition({ x: e.clientX, y: e.clientY }) + } + + window.addEventListener('mousemove', mouseMove) + + return () => { + window.removeEventListener('mousemove', mouseMove) + } + }, []) + + return ( + + + ) +}