内置AOS和TypedJS,避免CDN网络问题

This commit is contained in:
tangly1024.com
2024-07-12 10:04:06 +08:00
parent 50c687ffcb
commit d4c9f2c3fe
6 changed files with 2218 additions and 16 deletions

View File

@@ -10,14 +10,8 @@ import { useEffect } from 'react'
export default function AOSAnimation() {
const initAOS = async () => {
Promise.all([
loadExternalResource(
'https://cdn.bootcdn.net/ajax/libs/aos/2.3.4/aos.js',
'js'
),
loadExternalResource(
'https://cdn.bootcdn.net/ajax/libs/aos/2.3.4/aos.css',
'css'
)
loadExternalResource('/js/aos.js', 'js'),
loadExternalResource('/css/aos.css', 'css')
]).then(() => {
if (window.AOS) {
window.AOS.init()