File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -357,16 +357,21 @@ const GlobalSpotlight = ({
357357 document . body . appendChild ( spotlight ) ;
358358 spotlightRef . current = spotlight ;
359359
360+ let rAF = null ;
361+
360362 const handleMouseMove = e => {
361- if ( ! spotlightRef . current || ! gridRef . current ) return ;
363+ if ( rAF ) cancelAnimationFrame ( rAF ) ;
364+
365+ rAF = requestAnimationFrame ( ( ) => {
366+ if ( ! spotlightRef . current || ! gridRef . current ) return ;
362367
363- const section = gridRef . current . closest ( '.bento-section' ) ;
364- const rect = section ?. getBoundingClientRect ( ) ;
365- const mouseInside =
366- rect && e . clientX >= rect . left && e . clientX <= rect . right && e . clientY >= rect . top && e . clientY <= rect . bottom ;
368+ const section = gridRef . current . closest ( '.bento-section' ) ;
369+ const rect = section ?. getBoundingClientRect ( ) ;
370+ const mouseInside =
371+ rect && e . clientX >= rect . left && e . clientX <= rect . right && e . clientY >= rect . top && e . clientY <= rect . bottom ;
367372
368- isInsideSection . current = mouseInside || false ;
369- const cards = gridRef . current . querySelectorAll ( '.magic-bento-card' ) ;
373+ isInsideSection . current = mouseInside || false ;
374+ const cards = gridRef . current . querySelectorAll ( '.magic-bento-card' ) ;
370375
371376 if ( ! mouseInside ) {
372377 gsap . to ( spotlightRef . current , {
@@ -423,6 +428,7 @@ const GlobalSpotlight = ({
423428 duration : targetOpacity > 0 ? 0.2 : 0.5 ,
424429 ease : 'power2.out'
425430 } ) ;
431+ } ) ;
426432 } ;
427433
428434 const handleMouseLeave = ( ) => {
Original file line number Diff line number Diff line change @@ -82,7 +82,6 @@ const FAQ_ITEMS = [
8282 <div class =" hyperspeed-wrapper" >
8383 <Hyperspeed client:load effectOptions ={ HYPERSPEED_OPTIONS } />
8484 </div >
85- <LiquidBackground client:load />
8685 <div class =" hero-glow" ></div >
8786
8887 <div class =" hero-split" style =" position: relative; z-index: 1;" >
You can’t perform that action at this time.
0 commit comments