内置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

@@ -26,10 +26,7 @@ const Hero = props => {
updateHeaderHeight()
if (!typed && window && document.getElementById('typed')) {
loadExternalResource(
'https://cdn.bootcdn.net/ajax/libs/typed.js/2.0.12/typed.min.js',
'js'
).then(() => {
loadExternalResource('/js/typed.min.js', 'js').then(() => {
if (window.Typed) {
changeType(
new window.Typed('#typed', {

View File

@@ -21,10 +21,7 @@ const Hero = props => {
useEffect(() => {
updateHeaderHeight()
if (!typed && window && document.getElementById('typed')) {
loadExternalResource(
'https://cdn.bootcdn.net/ajax/libs/typed.js/2.0.12/typed.min.js',
'js'
).then(() => {
loadExternalResource('/js/typed.min.js', 'js').then(() => {
if (window.Typed) {
changeType(
new window.Typed('#typed', {