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