@@ -1430,49 +1430,52 @@ function finalizeFooterDot(core, ping) {
14301430 document . getElementById ( "footer-surge-button" ) . style . cursor = "default" ;
14311431}
14321432
1433- // Re-initialize skills after Surprise scroll or any DOM changes
1434- window . addEventListener ( "DOMContentLoaded" , ( ) => {
1435- initSkillXP ( ) ;
1436-
1437- const unlockedEggs = JSON . parse ( localStorage . getItem ( "unlockedEggs" ) || "[]" ) ;
1438- if ( unlockedEggs . includes ( "footer_surge" ) ) {
1439- finalizeFooterDot (
1440- document . getElementById ( "footer-dot-core" ) ,
1441- document . getElementById ( "footer-dot-ping" ) ,
1442- ) ;
1443- }
1444- } ) ;
1445-
14461433/**
14471434 * INITIALIZATION
14481435 */
1449- document . addEventListener ( "DOMContentLoaded" , ( ) => {
1450- const devToolsVisible = localStorage . getItem ( "devToolsVisible" ) === "true" ;
1451- const devPanel = document . getElementById ( "dev-tools" ) ;
1452-
1453- if ( devToolsVisible && devPanel ) {
1454- devPanel . classList . remove ( "hidden" ) ;
1436+ ( ( ) => {
1437+ function initFooterSurgeState ( ) {
1438+ if ( unlockedEggs . includes ( "footer_surge" ) ) {
1439+ finalizeFooterDot (
1440+ document . getElementById ( "footer-dot-core" ) ,
1441+ document . getElementById ( "footer-dot-ping" ) ,
1442+ ) ;
1443+ }
14551444 }
14561445
1457- const container = document . getElementById ( "matrix-console-container" ) ;
1458- const reopenBtn = document . getElementById ( "reopen-console-btn" ) ;
1446+ function initConsoleState ( ) {
1447+ const devToolsVisible = localStorage . getItem ( "devToolsVisible" ) === "true" ;
1448+ const devPanel = document . getElementById ( "dev-tools" ) ;
14591449
1460- // Force closed state on load
1461- if ( container ) {
1462- container . classList . add ( "hidden" ) ;
1463- container . style . opacity = "0" ;
1464- container . style . transform = "translateY(20px)" ;
1465- }
1450+ if ( devToolsVisible && devPanel ) {
1451+ devPanel . classList . remove ( "hidden" ) ;
1452+ }
14661453
1467- if ( reopenBtn ) {
1468- reopenBtn . classList . remove ( "hidden" ) ;
1469- }
1454+ const container = document . getElementById ( "matrix-console-container" ) ;
1455+ const reopenBtn = document . getElementById ( "reopen-console-btn" ) ;
14701456
1471- initDotEasterEgg ( ) ;
1472- initSkillMining ( ) ;
1473- // Initialize the profile counter
1474- initProfileTracker ( ) ;
1457+ // Force closed state on load
1458+ if ( container ) {
1459+ container . classList . add ( "hidden" ) ;
1460+ container . style . opacity = "0" ;
1461+ container . style . transform = "translateY(20px)" ;
1462+ }
14751463
1476- applyTheme ( localStorage . getItem ( "theme" ) || "light" ) ;
1477- updateGameUI ( ) ;
1478- } ) ;
1464+ if ( reopenBtn ) {
1465+ reopenBtn . classList . remove ( "hidden" ) ;
1466+ }
1467+ }
1468+
1469+ document . addEventListener ( "DOMContentLoaded" , ( ) => {
1470+ initSkillXP ( ) ;
1471+ initFooterSurgeState ( ) ;
1472+ initConsoleState ( ) ;
1473+ initDotEasterEgg ( ) ;
1474+ initSkillMining ( ) ;
1475+ // Initialize the profile counter
1476+ initProfileTracker ( ) ;
1477+
1478+ applyTheme ( localStorage . getItem ( "theme" ) || "light" ) ;
1479+ updateGameUI ( ) ;
1480+ } ) ;
1481+ } ) ( ) ;
0 commit comments