diff --git a/.eleventy.js b/.eleventy.js index 874f668..4ac2994 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,9 +1,8 @@ const yaml = require("js-yaml"); +const fs = require("node:fs/promises"); -module.exports = function (eleventyConfig) { - eleventyConfig.addShortcode("currentYear", function () { - return new Date().getFullYear(); - }); +module.exports = (eleventyConfig) => { + eleventyConfig.addShortcode("currentYear", () => new Date().getFullYear()); // Add this line to copy your external assets eleventyConfig.addPassthroughCopy("src/assets"); // 1. Recognize YAML as a template format @@ -20,19 +19,18 @@ module.exports = function (eleventyConfig) { }; }, getData: async (inputPath) => { - const fs = require("fs/promises"); const content = await fs.readFile(inputPath, "utf-8"); return yaml.load(content); }, }); // 2. The Randomized Collection - eleventyConfig.addCollection("randomPeople", function (collectionApi) { + eleventyConfig.addCollection("randomPeople", (collectionApi) => { // Grab all yaml files from the users folder const people = collectionApi.getFilteredByGlob("src/users/*.yaml"); // Create a copy of the array to avoid mutating the original global collection - let shuffled = [...people]; + const shuffled = [...people]; // Fisher-Yates Shuffle for (let i = shuffled.length - 1; i > 0; i--) { diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e1aef32..8455b21 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ default_stages: [pre-commit, pre-push] -minimum_prek_version: "0.2.22" +minimum_pre_commit_version: "0.2.22" default_language_version: python: python3 node: 24.13.0 @@ -118,17 +118,9 @@ repos: hooks: - id: biome-check name: run biome-check - description: Run Biome linter and formatter for JSON files + description: Run Biome linter and formatter for JS, CSS, and JSON files additional_dependencies: ["@biomejs/biome"] - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v4.0.0-alpha.8 - hooks: - - id: prettier - name: run prettier - types_or: [css, html, javascript, json, markdown, yaml] - additional_dependencies: ["prettier@3.8.1"] - - repo: https://github.com/igorshubovych/markdownlint-cli rev: v0.47.0 hooks: diff --git a/biome.json b/biome.json index 115edc8..f20867a 100644 --- a/biome.json +++ b/biome.json @@ -1,8 +1,5 @@ { "$schema": "https://biomejs.dev/schemas/2.3.13/schema.json", - "files": { - "includes": ["**/*.json"] - }, "linter": { "enabled": true, "rules": { diff --git a/src/_data/build.js b/src/_data/build.js index 7f753a2..bbb1c1d 100644 --- a/src/_data/build.js +++ b/src/_data/build.js @@ -1,4 +1,4 @@ -const { execSync } = require("child_process"); +const { execSync } = require("node:child_process"); module.exports = () => { const now = new Date(); @@ -13,7 +13,7 @@ module.exports = () => { try { // Get the short git hash (first 7 characters) gitHash = execSync("git rev-parse --short HEAD").toString().trim(); - } catch (e) { + } catch (_e) { console.warn("Could not fetch git hash, defaulting to 'development'"); } diff --git a/src/assets/css/style.css b/src/assets/css/style.css index 4381e01..307dd91 100644 --- a/src/assets/css/style.css +++ b/src/assets/css/style.css @@ -66,7 +66,7 @@ body { .user-card h2, .profile-link, .user-card a { - color: var(--accent) !important; + color: var(--accent); font-weight: 800; text-decoration: none; /* Animate ONLY the color property when theme changes */ @@ -88,16 +88,16 @@ body { /* Button to trigger Screenshot Mode in the Dev Panel */ .screenshot-btn { - border-color: var(--text-muted) !important; - color: var(--text-muted) !important; - font-size: 0.6rem !important; + border-color: var(--text-muted); + color: var(--text-muted); + font-size: 0.6rem; margin-top: 10px; } /* If your links look like tags/pills */ .link-pill { - background-color: var(--accent-light) !important; - color: var(--accent) !important; + background-color: var(--accent-light); + color: var(--accent); padding: 0.2rem 0.6rem; border-radius: 6px; font-size: 0.8rem; @@ -110,8 +110,8 @@ body { /* If you have a specific button-style profile link */ .profile-btn { - background-color: var(--accent-light) !important; - color: var(--accent) !important; + background-color: var(--accent-light); + color: var(--accent); border: 1px solid var(--accent); padding: 0.5rem 1rem; border-radius: 8px; @@ -120,8 +120,8 @@ body { } .profile-btn:hover { - background-color: var(--accent) !important; - color: #ffffff !important; + background-color: var(--accent); + color: #ffffff; box-shadow: 0 4px 15px var(--accent-light); } @@ -133,8 +133,8 @@ body { justify-content: center; gap: 0.4rem; padding: 0.4rem 0.9rem; - background-color: var(--accent-light) !important; - color: var(--accent) !important; + background-color: var(--accent-light); + color: var(--accent); border: 1px solid rgba(var(--accent-rgb), 0.2); border-radius: 9999px; font-size: 0.7rem; @@ -146,8 +146,8 @@ body { } .skill-item:hover { - background-color: var(--accent) !important; - color: #ffffff !important; + background-color: var(--accent); + color: #ffffff; transform: translateY(-3px) scale(1.05); box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.4); } @@ -156,9 +156,9 @@ body { * 3. BUTTONS & SHIMMER EFFECTS */ .surprise-btn { - background-color: #2563eb !important; - color: #ffffff !important; - display: inline-flex !important; + background-color: #2563eb; + color: #ffffff; + display: inline-flex; align-items: center; justify-content: center; padding: 0.6rem 1.5rem; @@ -175,7 +175,7 @@ body { } .dark .surprise-btn { - background-color: var(--accent) !important; + background-color: var(--accent); } .surprise-btn:hover { @@ -211,7 +211,7 @@ body { * 4. DEVELOPER TOOLS - INDESTRUCTIBLE VIEWPORT PANEL */ #dev-tools { - position: fixed !important; + position: fixed; top: 1rem; right: 1rem; width: 280px; @@ -225,7 +225,7 @@ body { padding: 1.25rem; border-radius: 12px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3); - z-index: 2147483647 !important; + z-index: 2147483647; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); transform: translateZ(0); /* Force layer isolation */ } @@ -233,16 +233,16 @@ body { /* NUCLEAR LOCK: Forces stability during page-wide glitches */ #dev-tools[data-lock="true"], html body #dev-tools[data-lock="true"] { - display: block !important; - visibility: visible !important; - opacity: 1 !important; - position: fixed !important; - top: 1rem !important; - right: 1rem !important; - transform: none !important; - animation: none !important; - border-left-color: #ef4444 !important; - box-shadow: 0 0 40px rgba(239, 68, 68, 0.6) !important; + display: block; + visibility: visible; + opacity: 1; + position: fixed; + top: 1rem; + right: 1rem; + transform: none; + animation: none; + border-left-color: #ef4444; + box-shadow: 0 0 40px rgba(239, 68, 68, 0.6); } #dev-tools button { @@ -268,16 +268,16 @@ html body #dev-tools[data-lock="true"] { /* Console Neon Overrides */ #dev-tools button[onclick*="matrix"] { - color: #00ff41 !important; + color: #00ff41; } #dev-tools button[onclick*="konami"] { - color: #ffcc00 !important; + color: #ffcc00; } #dev-tools button[onclick*="gravity"] { - color: #ff3333 !important; + color: #ff3333; } #dev-tools button[onclick*="badge_click"] { - color: #bc13fe !important; + color: #bc13fe; } /** @@ -302,8 +302,8 @@ html body #dev-tools[data-lock="true"] { } #repair-btn { - background-color: #2563eb !important; /* Restore to Blue */ - color: #fff !important; + background-color: #2563eb; /* Restore to Blue */ + color: #fff; border: 4px solid #fff; border-radius: 9999px; padding: 1.5rem 3rem; @@ -375,7 +375,7 @@ html body #dev-tools[data-lock="true"] { /* Ensure the card can show the trace glow */ .user-card.selected-fancy { z-index: 50; - overflow: visible !important; + overflow: visible; transform: scale(1.02); transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); } @@ -420,8 +420,8 @@ html body #dev-tools[data-lock="true"] { /* Special styling for those who have reached Level 5 (Data Miner) */ body[data-level="5"] .skill-item { - border-color: #06b6d4 !important; /* Data Miner Cyan */ - background: rgba(6, 182, 212, 0.1) !important; + border-color: #06b6d4; /* Data Miner Cyan */ + background: rgba(6, 182, 212, 0.1); position: relative; overflow: hidden; } @@ -466,8 +466,8 @@ body[data-level="5"] .skill-item::before { /* Level 5 Specific Visual Perk */ .level-architect .skill-item, body[data-level="5"] .skill-item { - border-color: #06b6d4 !important; - background: rgba(6, 182, 212, 0.1) !important; + border-color: #06b6d4; + background: rgba(6, 182, 212, 0.1); box-shadow: 0 0 10px rgba(6, 182, 212, 0.2); } @@ -496,7 +496,7 @@ body[data-level="6"]::after { /* Added via JS when XP increases */ .xp-pulse { transform: scale(1.3); - color: white !important; + color: white; } #jump-lvl { font-family: "Courier New", monospace; @@ -505,18 +505,18 @@ body[data-level="6"]::after { #jump-lvl { appearance: textfield; /* Removes default arrows */ -webkit-appearance: none; - line-height: 30px !important; + line-height: 30px; } #jump-lvl::placeholder { - color: rgba(0, 255, 204, 0.3) !important; + color: rgba(0, 255, 204, 0.3); } /* Force standard text color even on focus */ #jump-lvl:focus { - outline: 2px solid #00ffcc !important; - background-color: #000 !important; - color: #00ffcc !important; + outline: 2px solid #00ffcc; + background-color: #000; + color: #00ffcc; } /* Base Force Aura Animation */ @keyframes force-pulse { @@ -536,7 +536,7 @@ body[data-level="6"]::after { /* Ensure the parent container has a background so you can see the 'empty' part */ #game-stats .bg-black\/10 { - background-color: rgba(0, 0, 0, 0.1) !important; + background-color: rgba(0, 0, 0, 0.1); min-width: 80px; /* Ensure it hasn't collapsed to 0 width */ height: 6px; } @@ -545,8 +545,8 @@ body[data-level="6"]::after { #level-progress { height: 100%; background-color: var(--accent); /* This is the level color */ - transition: width 0.3s ease-in-out !important; /* Make it smooth */ - display: block !important; + transition: width 0.3s ease-in-out; /* Make it smooth */ + display: block; } /* Force Glow for the Badge */ @@ -571,7 +571,7 @@ body[data-level="6"]::after { letter-spacing: 0.02em; /* Remove any existing filters that cause fuzziness */ - filter: none !important; + filter: none; transition: color 0.3s ease; } @@ -814,12 +814,12 @@ a:hover { } /* Maximize State */ .console-maximized { - width: 90vw !important; - height: auto !important; - bottom: 5vh !important; - right: 5vw !important; - left: 5vw !important; - z-index: 2000 !important; + width: 90vw; + height: auto; + bottom: 5vh; + right: 5vw; + left: 5vw; + z-index: 2000; } #matrix-console-output { @@ -860,9 +860,9 @@ a:hover { /* Full-screen Force Field */ .force-field-overlay { - position: fixed !important; - inset: 0 !important; - z-index: 999999 !important; + position: fixed; + inset: 0; + z-index: 999999; background: radial-gradient( circle, rgba(0, 150, 255, 0.1) 0%, diff --git a/src/assets/js/eggs.js b/src/assets/js/eggs.js index 2ba15bb..a4c18a6 100644 --- a/src/assets/js/eggs.js +++ b/src/assets/js/eggs.js @@ -39,7 +39,7 @@ const emojiBurst = [ let heartClickCount = 0; let phaserStarted = false; -let gameInstance; +let _gameInstance; let player; let cursors; let aliens; @@ -110,7 +110,7 @@ function initPhaserGame() { }, }; - gameInstance = new Phaser.Game(config); + _gameInstance = new Phaser.Game(config); } // 4. PHASER SCENE FUNCTIONS @@ -187,23 +187,18 @@ function spawnExplosion(scene) { } function setupSpaceInvaders() { - const scene = this; - // Player Rocket - player = scene.add.text( - window.innerWidth / 2, - window.innerHeight - 80, - "🚀", - { fontSize: "50px" }, - ); - scene.physics.add.existing(player); + player = this.add.text(window.innerWidth / 2, window.innerHeight - 80, "🚀", { + fontSize: "50px", + }); + this.physics.add.existing(player); player.body.setCollideWorldBounds(true); // Bullets - bullets = scene.physics.add.group(); + bullets = this.physics.add.group(); // Aliens Grid - Adjusted for smaller size - aliens = scene.physics.add.group(); + aliens = this.physics.add.group(); const rows = 5; const cols = 10; const spacingX = 50; // Tighter horizontal spacing @@ -211,16 +206,16 @@ function setupSpaceInvaders() { for (let y = 0; y < rows; y++) { for (let x = 0; x < cols; x++) { - let alienEmoji = ["👾", "👽", "🛸", "🐙", "👾"][y]; + const alienEmoji = ["👾", "👽", "🛸", "🐙", "👾"][y]; // Shrink from 35px to 24px - let alien = scene.add.text( + const alien = this.add.text( x * spacingX + 80, y * spacingY + 80, alienEmoji, { fontSize: "24px" }, ); - scene.physics.add.existing(alien); + this.physics.add.existing(alien); alien.body.setAllowGravity(false); // Shrink the collision box to match the smaller emoji alien.body.setSize(24, 24); @@ -230,16 +225,16 @@ function setupSpaceInvaders() { } // Alien Movement Timer - scene.alienDirection = 1; - scene.time.addEvent({ + this.alienDirection = 1; + this.time.addEvent({ delay: 800, callback: moveAliens, - callbackScope: scene, + callbackScope: this, loop: true, }); // Collisions - scene.physics.add.overlap(bullets, aliens, (bullet, alien) => { + this.physics.add.overlap(bullets, aliens, (bullet, alien) => { bullet.destroy(); alien.destroy(); if (aliens.countActive() === 0) { @@ -248,7 +243,7 @@ function setupSpaceInvaders() { } }); - cursors = scene.input.keyboard.createCursorKeys(); + cursors = this.input.keyboard.createCursorKeys(); } function moveAliens() { diff --git a/src/assets/js/script.js b/src/assets/js/script.js index a6d41a9..f99dc6c 100644 --- a/src/assets/js/script.js +++ b/src/assets/js/script.js @@ -17,7 +17,7 @@ const NUM_LEVELS = LEVELS.length; let currentLevel = Number(localStorage.getItem("userLevel")) || 0; // Load saved XP or start at 0 -let currentXP = parseInt(localStorage.getItem("userXP")) || 0; +let currentXP = parseInt(localStorage.getItem("userXP"), 10) || 0; let isSurging = false; @@ -104,7 +104,7 @@ function playSound(type) { } } -let unlockedEggs = JSON.parse(localStorage.getItem("unlockedEggs")) || []; +const unlockedEggs = JSON.parse(localStorage.getItem("unlockedEggs")) || []; let surpriseClickCount = 0; let matrixActive = false; let destructInterval; @@ -174,7 +174,7 @@ document.addEventListener("mouseup", () => { dragHeader.style.cursor = "grab"; }); -function minimizeConsole() { +function _minimizeConsole() { // Toggles the height of the output area if (consoleOutput.style.display === "none") { consoleOutput.style.display = "block"; @@ -185,7 +185,7 @@ function minimizeConsole() { } } -function maximizeConsole() { +function _maximizeConsole() { // Toggles a full-screen-ish mode consoleContainer.classList.toggle("console-maximized"); @@ -233,7 +233,7 @@ function reopenConsole() { let isProcessingXP = false; // Ensure this is in the GLOBAL scope (not hidden inside another function) -window.createFloatingXP = function (e) { +window.createFloatingXP = (e) => { // Prevent "spam" firing from high-speed mouse movement if (isProcessingXP) return; isProcessingXP = true; @@ -270,7 +270,7 @@ window.createFloatingXP = function (e) { setTimeout(() => popup.remove(), 800); }; -function handleLevelClick() { +function _handleLevelClick() { triggerSecretUnlock("badge_click"); } @@ -327,7 +327,9 @@ function applyTheme(theme) { "--accent", "--accent-light", ]; - props.forEach((p) => html.style.removeProperty(p)); + props.forEach((p) => { + html.style.removeProperty(p); + }); if (theme === "dark") { html.classList.add("dark"); @@ -362,7 +364,7 @@ function applyTheme(theme) { updateThemeIcon(theme); } -function toggleTheme() { +function _toggleTheme() { playSound("click"); const current = localStorage.getItem("theme") || "light"; const next = @@ -460,7 +462,7 @@ function triggerForceSurge() { }, 8000); } -function triggerMagicXP() { +function _triggerMagicXP() { initAudio(); addExperience(XP_MAGIC_BONUS); } @@ -692,7 +694,7 @@ function initMatrix() { ctx.fillStyle = "rgba(0, 0, 0, 0.05)"; ctx.fillRect(0, 0, canvas.width, canvas.height); ctx.fillStyle = "#0F0"; - ctx.font = fontSize + "px monospace"; + ctx.font = `${fontSize}px monospace`; for (let i = 0; i < rainDrops.length; i++) { const text = alphabet.charAt(Math.floor(Math.random() * alphabet.length)); @@ -758,7 +760,7 @@ document /** * 7. SELF DESTRUCT ENGINE */ -window.startSelfDestruct = function () { +window.startSelfDestruct = () => { const btn = document.getElementById("self-destruct-btn"); const devPanel = document.getElementById("dev-tools"); @@ -835,7 +837,7 @@ window.startSelfDestruct = function () { }, 1000); }; -function scrollToRandomUser() { +function _scrollToRandomUser() { playSound("click"); surpriseClickCount++; @@ -886,7 +888,7 @@ function scrollToRandomUser() { /** * UTILITY: SCREENSHOT MODE */ -window.toggleScreenshotMode = function () { +window.toggleScreenshotMode = () => { const devPanel = document.getElementById("dev-tools"); const header = document.querySelector("header"); const footer = document.querySelector("footer"); @@ -1002,7 +1004,7 @@ document.addEventListener("keydown", (e) => { async function addExperience(amount) { // 1. Force strict numeric types to prevent "1" + "1" = "11" - let xpToAdd = Number(amount) || 0; + const xpToAdd = Number(amount) || 0; currentXP = Number(currentXP) || 0; currentLevel = Number(currentLevel) || 0; const XP_THRESHOLD = 45; @@ -1062,9 +1064,9 @@ function updateInventoryCounts(lvl) { // We use i <= lvl because currentLevel is the index reached for (let i = 0; i <= lvl; i++) { const levelEntry = LEVELS[i]; - if (levelEntry && levelEntry.rarity) { + if (levelEntry?.rarity) { const r = levelEntry.rarity.toLowerCase(); - if (counts.hasOwnProperty(r)) { + if (Object.hasOwn(counts, r)) { counts[r]++; } } @@ -1184,7 +1186,7 @@ function initProfileTracker() { // 3. UI Update Logic const refreshStats = () => { - const count = parseInt(localStorage.getItem("profile_view_count") || 0); + const count = parseInt(localStorage.getItem("profile_view_count") || 0, 10); statsContainer.innerHTML = ` VIEWS: ${count} `; @@ -1198,9 +1200,10 @@ function initProfileTracker() { const targetLink = e.target.closest("a"); // Only increment if the link text contains "Profile" - if (targetLink && targetLink.textContent.includes("Profile")) { - let currentCount = parseInt( + if (targetLink?.textContent.includes("Profile")) { + const currentCount = parseInt( localStorage.getItem("profile_view_count") || 0, + 10, ); localStorage.setItem("profile_view_count", currentCount + 1); refreshStats(); @@ -1249,11 +1252,11 @@ function addMaintenanceXP() { } } -function jumpToLevel() { +function _jumpToLevel() { const input = document.getElementById("jump-lvl"); if (!input || input.value === "") return; - let targetLvl = parseInt(input.value); + let targetLvl = parseInt(input.value, 10); // Clamp between 0 and NUM_LEVELS targetLvl = Math.max(0, Math.min(NUM_LEVELS, targetLvl)); @@ -1273,7 +1276,7 @@ function jumpToLevel() { showLevelUpNotification(rank); } -function handleFooterDotClick() { +function _handleFooterDotClick() { // 1. Get the current list of unlocked eggs const rawEggs = localStorage.getItem("unlockedEggs") || "[]"; const unlockedEggs = JSON.parse(rawEggs); @@ -1281,7 +1284,7 @@ function handleFooterDotClick() { // 2. Exit if already unlocked if (unlockedEggs.includes("footer_surge")) return; - let clicks = parseInt(localStorage.getItem("footerDotClicks")) || 0; + let clicks = parseInt(localStorage.getItem("footerDotClicks"), 10) || 0; clicks++; const core = document.getElementById("footer-dot-core");