-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The `Animation-1707227617481.json` file is no longer required and has been removed. This helps clean up unused assets, reducing clutter in the repository.
- Loading branch information
SquirrelDevelopper
committed
Feb 23, 2025
1 parent
b54e695
commit 15919cd
Showing
13 changed files
with
802 additions
and
624 deletions.
There are no files selected for viewing
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
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
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,15 +1,33 @@ | ||
import { DotLottie, DotLottieReact } from '@lottiefiles/dotlottie-react'; | ||
import React from 'react'; | ||
import { DotLottiePlayer, PlayMode } from '@dotlottie/react-player'; | ||
|
||
const AnimationPlayer = () => ( | ||
<DotLottiePlayer | ||
src="/Animation-1709649662243.json" | ||
autoplay | ||
loop | ||
intermission={5000} | ||
playMode={PlayMode.Bounce} | ||
style={{ height: '90%', width: '90%', alignSelf: 'center' }} | ||
/> | ||
); | ||
|
||
const intermission = 5000; | ||
|
||
const AnimationPlayer = () => { | ||
const [dotLottie, setDotLottie] = React.useState<DotLottie | null>(null); | ||
React.useEffect(() => { | ||
function onComplete() { | ||
// Set a timeout to pause for the intermission duration, then replay the animation | ||
setTimeout(() => dotLottie?.play(), intermission); | ||
} | ||
|
||
// Add the event listener for the complete event | ||
dotLottie?.addEventListener('complete', onComplete); | ||
|
||
return () => { | ||
dotLottie?.removeEventListener('complete', onComplete); | ||
}; | ||
}, [dotLottie]); | ||
return ( | ||
<DotLottieReact | ||
dotLottieRefCallback={setDotLottie} | ||
src="/lotties/squirrel_find_nut.lottie" | ||
autoplay | ||
loop={false} | ||
mode={'bounce'} | ||
style={{ height: '90%', width: '90%', alignSelf: 'center' }} | ||
/> | ||
); | ||
}; | ||
|
||
export default AnimationPlayer; |
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.