-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import dynamic from 'next/dynamic'; | ||
import {prefersReducedMotion} from '@/utils/isPrefersReducedMotion'; | ||
import options from './customCursorOptions'; | ||
|
||
const AnimatedCursor = dynamic(() => import('react-animated-cursor'), { | ||
ssr: false, | ||
}); | ||
|
||
/** | ||
* @returns Custom cursor. | ||
*/ | ||
export default function CustomCursor() { | ||
return prefersReducedMotion ? null : <AnimatedCursor {...options} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const customCursorClickableClass = 'custom-cursor-clickable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import {ComponentProps} from 'react'; | ||
import AnimatedCursor from 'react-animated-cursor'; | ||
import {customCursorClickableClass} from './customCursorClickableClass'; | ||
|
||
// eslint-disable-next-line jsdoc/require-jsdoc | ||
type Options = ComponentProps<typeof AnimatedCursor>; | ||
|
||
const options: Options = { | ||
innerSize: 12, | ||
outerStyle: { | ||
border: '2px solid white', | ||
}, | ||
outerSize: 20, | ||
outerScale: 2, | ||
outerAlpha: 0.2, | ||
color: '255, 255, 255', | ||
innerScale: 0, | ||
clickables: [ | ||
'a', | ||
'input[type="text"]', | ||
'input[type="email"]', | ||
'input[type="number"]', | ||
'label[for]', | ||
'button', | ||
`.${customCursorClickableClass}`, | ||
], | ||
}; | ||
|
||
export default options; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters