22
33import Image from 'next/image' ;
44import { Button , ExternalLink , ReuseCSS } from './common' ;
5- import { useState } from 'react' ;
5+ import { useEffect , useState } from 'react' ;
66import { GalleryAppContent as MemoriesAppContent } from './apps/memoriesApp' ;
77import { NewsAppContent } from './apps/discoverApp' ;
88import { SrikantAppContent } from './apps/srikantApp' ;
@@ -68,11 +68,11 @@ export const APP = {
6868 This project is a hobby endeavor that I'm proud of, and I hope it helps you understand the
6969 potential of Netlify's capabilities. < br />
7070 It took me more than 5 days to build this. I will be putting up what all challenges I have faced during
71- the development of this in the submission article. Would really appreciate if you liked it and can vote
72- my submission here 👇
71+ the development of this, and more details of implementation in the submission article. Would really
72+ appreciate if you liked it and can vote my submission here 👇
7373 < br />
7474 < Button >
75- < ExternalLink href = { 'https://dev.to/srikant_code' } > Please vote here😄</ ExternalLink >
75+ < ExternalLink href = { 'https://dev.to/srikant_code' } > Please give a 👍 here😄</ ExternalLink >
7676 </ Button >
7777 < br /> You can connect with me anytime here{ ' ' }
7878 < ExternalLink href = "https://www.linkedin.com/in/srikant-design/" > LinkedIn</ ExternalLink > |{ ' ' }
@@ -91,6 +91,8 @@ export const PageContent = (props) => {
9191 const [ activeApp , setActiveApp ] = useState ( 0 ) ;
9292 // console.log({ props });
9393
94+ typeof window !== 'undefined' ? ! window . location . origin ?. includes ( 'localhost' ) && ( console . log = ( ) => { } ) : null ;
95+
9496 const internalStyles = {
9597 main : {
9698 ...ReuseCSS . font ,
@@ -108,6 +110,7 @@ export const PageContent = (props) => {
108110 return (
109111 < main style = { internalStyles . main } >
110112 < Background />
113+ < Mouse />
111114 { Object . keys ( APP ) . map ( ( appKey , id ) => {
112115 return (
113116 < AppTemplate
@@ -319,7 +322,8 @@ export const Background = () => {
319322 overflow : 'hidden' ,
320323 width : '100vw' ,
321324 position : 'absolute' ,
322- transition : `all 0.2s linear`
325+ transition : `all 0.2s linear` ,
326+ filter : `brightness(60%)`
323327 }
324328 } ;
325329 return (
@@ -361,3 +365,41 @@ export const Modal = ({ children, style, open, onClose }) => {
361365 </ >
362366 ) ;
363367} ;
368+
369+ const Mouse = ( ) => {
370+ const [ cursorPosition , setCursorPosition ] = useState ( { x : 0 , y : 0 } ) ;
371+
372+ // Update cursor position on mouse move
373+ const handleMouseMove = ( e ) => {
374+ setCursorPosition ( { x : e . clientX - 25 , y : e . clientY - 25 } ) ;
375+ } ;
376+
377+ useEffect ( ( ) => {
378+ // Add event listener for mousemove
379+ typeof window !== 'undefined' ? window . addEventListener ( 'mousemove' , handleMouseMove ) : null ;
380+
381+ // Clean up the event listener when component unmounts
382+ return ( ) => {
383+ typeof window !== 'undefined' ? window . removeEventListener ( 'mousemove' , handleMouseMove ) : null ;
384+ } ;
385+ } , [ ] ) ;
386+
387+ // {/* Your other components go here */}
388+ return (
389+ < div
390+ style = { {
391+ position : 'absolute' ,
392+ left : cursorPosition . x ,
393+ top : cursorPosition . y ,
394+ width : 50 ,
395+ height : 50 ,
396+ borderRadius : '50%' ,
397+ pointerEvents : 'none' , // Prevent the circle from blocking interactions
398+ backgroundColor : `rgba(147, 147, 147, 0.26)` ,
399+ zIndex : 10000 ,
400+ border : `2px solid rgba(0, 210, 159, 0.69)` ,
401+ transition : `all 0.2s ease 0s`
402+ } }
403+ />
404+ ) ;
405+ } ;
0 commit comments