forked from tangly1024/NotionNext
-
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.
Merge pull request tangly1024#2381 from tangly1024/feat/mouse-follow
鼠标跟随动画
- Loading branch information
Showing
4 changed files
with
753 additions
and
1 deletion.
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,27 @@ | ||
import { useEffect } from 'react' | ||
// import anime from 'animejs' | ||
import { siteConfig } from '@/lib/config' | ||
import { loadExternalResource } from '@/lib/utils' | ||
|
||
/** | ||
* 鼠标跟随特效 | ||
* @returns | ||
*/ | ||
const MOUSE_FOLLOW = () => { | ||
const type = siteConfig('MOUSE_FOLLOW_EFFECT_TYPE') | ||
const color = siteConfig('MOUSE_FOLLOW_EFFECT_COLOR') | ||
|
||
useEffect(() => { | ||
loadExternalResource('/js/mouse-follow.js', 'js').then(url => { | ||
if (window.createMouseCanvas) { | ||
window.createMouseCanvas()({ | ||
type, | ||
color | ||
}) | ||
} | ||
}) | ||
}, []) | ||
|
||
return <></> | ||
} | ||
export default MOUSE_FOLLOW |
Oops, something went wrong.