mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-13 23:16:47 +00:00
theme-proxio-init
This commit is contained in:
36
components/Lenis.js
Normal file
36
components/Lenis.js
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* 鼠标滚动阻尼感
|
||||
*/
|
||||
import { useEffect } from 'react'
|
||||
// import anime from 'animejs'
|
||||
import { siteConfig } from '@/lib/config'
|
||||
import { loadExternalResource } from '@/lib/utils'
|
||||
|
||||
/**
|
||||
* 鼠标点击烟花特效
|
||||
* @returns
|
||||
*/
|
||||
const Lenis = () => {
|
||||
|
||||
useEffect(() => {
|
||||
// 异步加载
|
||||
async function loadLenis() {
|
||||
loadExternalResource(
|
||||
'https://unpkg.com/lenis@1.2.3/dist/lenis.mjs',
|
||||
'js'
|
||||
).then(() => {
|
||||
console.log('Lenis',window.Lenis)
|
||||
})
|
||||
}
|
||||
|
||||
loadLenis()
|
||||
|
||||
return () => {
|
||||
// 在组件卸载时清理资源
|
||||
}
|
||||
}, [])
|
||||
|
||||
return <></>
|
||||
}
|
||||
|
||||
export default Lenis
|
||||
Reference in New Issue
Block a user