mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
37 lines
643 B
JavaScript
37 lines
643 B
JavaScript
/**
|
|
* 鼠标滚动阻尼感
|
|
*/
|
|
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
|