Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 41 additions & 37 deletions src/assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1430,49 +1430,53 @@ function finalizeFooterDot(core, ping) {
document.getElementById("footer-surge-button").style.cursor = "default";
}

// Re-initialize skills after Surprise scroll or any DOM changes
window.addEventListener("DOMContentLoaded", () => {
initSkillXP();

const unlockedEggs = JSON.parse(localStorage.getItem("unlockedEggs") || "[]");
if (unlockedEggs.includes("footer_surge")) {
finalizeFooterDot(
document.getElementById("footer-dot-core"),
document.getElementById("footer-dot-ping"),
);
}
});

/**
* INITIALIZATION
*/
document.addEventListener("DOMContentLoaded", () => {
const devToolsVisible = localStorage.getItem("devToolsVisible") === "true";
const devPanel = document.getElementById("dev-tools");

if (devToolsVisible && devPanel) {
devPanel.classList.remove("hidden");
(() => {
function initFooterSurgeState() {
const unlockedEggs = JSON.parse(localStorage.getItem("unlockedEggs") || "[]");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'unlockedEggs' is already declared in the upper scope on line 20 column 7


Two variables can have the same name if they're declared in different scopes. In the example below, the parameter x is said to "shadow" the variable x declared above it. The outer x can no longer be accessed inside the sum function.

if (unlockedEggs.includes("footer_surge")) {
finalizeFooterDot(
document.getElementById("footer-dot-core"),
document.getElementById("footer-dot-ping"),
);
}
}

const container = document.getElementById("matrix-console-container");
const reopenBtn = document.getElementById("reopen-console-btn");
function initConsoleState() {
const devToolsVisible = localStorage.getItem("devToolsVisible") === "true";
const devPanel = document.getElementById("dev-tools");

// Force closed state on load
if (container) {
container.classList.add("hidden");
container.style.opacity = "0";
container.style.transform = "translateY(20px)";
}
if (devToolsVisible && devPanel) {
devPanel.classList.remove("hidden");
}

if (reopenBtn) {
reopenBtn.classList.remove("hidden");
}
const container = document.getElementById("matrix-console-container");
const reopenBtn = document.getElementById("reopen-console-btn");

initDotEasterEgg();
initSkillMining();
// Initialize the profile counter
initProfileTracker();
// Force closed state on load
if (container) {
container.classList.add("hidden");
container.style.opacity = "0";
container.style.transform = "translateY(20px)";
}

applyTheme(localStorage.getItem("theme") || "light");
updateGameUI();
});
if (reopenBtn) {
reopenBtn.classList.remove("hidden");
}
}

document.addEventListener("DOMContentLoaded", () => {
initSkillXP();
initFooterSurgeState();
initConsoleState();
initDotEasterEgg();
initSkillMining();
// Initialize the profile counter
initProfileTracker();

applyTheme(localStorage.getItem("theme") || "light");
updateGameUI();
});
})();