Update block-animation.js

This commit is contained in:
DJObleezy 2025-03-28 19:13:46 -07:00 committed by GitHub
parent 401655c3ae
commit 7aee1fe982
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -362,23 +362,23 @@ class BlockMiningAnimation {
}
// Initialize and start the animation when the page loads
document.addEventListener("DOMContentLoaded", function () {
console.log("DOM content loaded, initializing animation");
// document.addEventListener("DOMContentLoaded", function () {
// console.log("DOM content loaded, initializing animation");
// Ensure we give the SVG enough time to be fully rendered and accessible
setTimeout(() => {
const svgContainer = document.getElementById("svg-container");
if (!svgContainer) {
console.error("SVG container not found in DOM");
return;
}
// setTimeout(() => {
// const svgContainer = document.getElementById("svg-container");
// if (!svgContainer) {
// console.error("SVG container not found in DOM");
// return;
// }
try {
const animation = new BlockMiningAnimation("svg-container");
animation.start();
console.log("Animation started successfully");
} catch (error) {
console.error("Error starting animation:", error);
}
}, 1500); // Increased delay to ensure SVG is fully loaded
});
// try {
// const animation = new BlockMiningAnimation("svg-container");
// animation.start();
// console.log("Animation started successfully");
// } catch (error) {
// console.error("Error starting animation:", error);
// }
// }, 1500); // Increased delay to ensure SVG is fully loaded
// });