Add checks for container presence in animation functions to prevent errors when elements are removed from the DOM [skip ci]
This commit is contained in:
@@ -203,12 +203,12 @@ function createSports() {
|
||||
}, arcDuration * 1000 + 500);
|
||||
|
||||
// Schedule the next trophy
|
||||
setTimeout(launchTrophy, Math.random() * 20000 + 10000); // Wait 10-30s until next trophy
|
||||
setTimeout(() => { if (document.body.contains(container)) launchTrophy(); }, Math.random() * 20000 + 10000); // Wait 10-30s until next trophy
|
||||
}
|
||||
|
||||
// Launch initial trophy after a short delay
|
||||
if (enableTrophy) {
|
||||
setTimeout(launchTrophy, Math.random() * 5000 + 2000);
|
||||
setTimeout(() => { if (document.body.contains(container)) launchTrophy(); }, Math.random() * 5000 + 2000);
|
||||
}
|
||||
|
||||
// Add Germany Colored confetti (Black, Red, Gold)
|
||||
|
||||
Reference in New Issue
Block a user