mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 15:09:22 +00:00
25 lines
520 B
JavaScript
25 lines
520 B
JavaScript
import { loadExternalResource } from '@/lib/utils'
|
|
import { useEffect } from 'react'
|
|
// import AOS from 'aos'
|
|
|
|
/**
|
|
* 加载滚动动画
|
|
* 改从外部CDN读取
|
|
* https://michalsnik.github.io/aos/
|
|
*/
|
|
export default function AOSAnimation() {
|
|
const initAOS = () => {
|
|
Promise.all([
|
|
loadExternalResource('/js/aos.js', 'js'),
|
|
loadExternalResource('/css/aos.css', 'css')
|
|
]).then(() => {
|
|
if (window.AOS) {
|
|
window.AOS.init()
|
|
}
|
|
})
|
|
}
|
|
useEffect(() => {
|
|
initAOS()
|
|
}, [])
|
|
}
|