-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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 #2280 from tangly1024/release/4.4.3
Release/4.4.3
- Loading branch information
Showing
86 changed files
with
4,288 additions
and
3,704 deletions.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,12 +1,30 @@ | ||
import AOS from 'aos' | ||
import { isBrowser } from 'react-notion-x' | ||
import { loadExternalResource } from '@/lib/utils' | ||
import { useEffect } from 'react' | ||
// import AOS from 'aos' | ||
|
||
/** | ||
* 加载滚动动画 | ||
* 改从外部CDN读取 | ||
* https://michalsnik.github.io/aos/ | ||
*/ | ||
export default function AOSAnimation() { | ||
if (isBrowser) { | ||
AOS.init() | ||
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' | ||
) | ||
]).then(() => { | ||
if (window.AOS) { | ||
window.AOS.init() | ||
} | ||
}) | ||
} | ||
useEffect(() => { | ||
initAOS() | ||
}, []) | ||
} |
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
Oops, something went wrong.