-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
22 additions
and
12 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
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,19 +1,19 @@ | ||
// JavaScript | ||
const image = document.getElementById('animatedImage'); | ||
|
||
function startVanishAnimation() { | ||
image.style.animation = 'vanish 2s forwards'; | ||
function startRollOutAnimation() { | ||
image.style.animation = 'rollOut 2s forwards'; | ||
} | ||
|
||
function startReloadAnimation() { | ||
image.style.animation = 'reload 2s forwards'; | ||
function startRollInAnimation() { | ||
image.style.animation = 'rollIn 2s forwards'; | ||
} | ||
|
||
function startAnimationLoop() { | ||
startVanishAnimation(); | ||
startRollOutAnimation(); | ||
setTimeout(() => { | ||
startReloadAnimation(); | ||
}, 2000); // Timing should match the vanish animation duration | ||
startRollInAnimation(); | ||
}, 2000); // Timing should match the roll out animation duration | ||
} | ||
|
||
setInterval(startAnimationLoop, 4000); // Adjust interval timing based on the total duration of vanish and reload | ||
setInterval(startAnimationLoop, 4000); // Adjust interval timing based on the total duration of roll out and roll in |