Skip to content

Commit ee17620

Browse files
committed
Checking pre-commit
1 parent 898841d commit ee17620

7 files changed

Lines changed: 25 additions & 22 deletions

File tree

src/_includes/system-override.njk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929
<span>👾 INVADER_WIN</span>
3030
<span class="opacity-50">+{{ XP_SPACE_INVADERS_WIN }}</span>
3131
</button>
32-
<button onclick="addExperience(XP_CODE_BREAKER_WIN); playSound('levelUp');" class="override-btn w-full flex justify-between px-2 py-1 bg-teal-500/5 text-teal-400 text-[8px] border border-teal-500/20 rounded">
32+
<button onclick="addExperience(_XP_CODE_BREAKER_WIN); playSound('levelUp');" class="override-btn w-full flex justify-between px-2 py-1 bg-teal-500/5 text-teal-400 text-[8px] border border-teal-500/20 rounded">
3333
<span>⌨️ BREAKER_WIN</span>
34-
<span class="opacity-50">+{{ XP_CODE_BREAKER_WIN }}</span>
34+
<span class="opacity-50">+{{ _XP_CODE_BREAKER_WIN }}</span>
3535
</button>
36-
<button onclick="addExperience(XP_DEV_DUEL_PLAY); playSound('click');" class="override-btn w-full flex justify-between px-2 py-1 bg-yellow-500/5 text-yellow-400 text-[8px] border border-yellow-500/20 rounded">
36+
<button onclick="addExperience(_XP_DEV_DUEL_PLAY); playSound('click');" class="override-btn w-full flex justify-between px-2 py-1 bg-yellow-500/5 text-yellow-400 text-[8px] border border-yellow-500/20 rounded">
3737
<span>⚔️ DUEL_PLAY</span>
38-
<span class="opacity-50">+{{ XP_DEV_DUEL_PLAY }}</span>
38+
<span class="opacity-50">+{{ _XP_DEV_DUEL_PLAY }}</span>
3939
</button>
4040
<button onclick="addExperience(5); playSound('click');" class="override-btn w-full flex justify-between px-2 py-1 bg-cyan-500/5 text-cyan-400 text-[8px] border border-cyan-500/20 rounded">
4141
<span>💎 SKILL_MINER</span>

src/assets/js/eggs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
const scaleAmount = 1 + heartClickCount * 0.3;
2727
heart.style.transition =
2828
"transform 0.1s cubic-bezier(0.17, 0.67, 0.83, 0.67)";
29-
heart.style.transform = "scale(" + scaleAmount + ")";
29+
heart.style.transform = `scale(${scaleAmount})`;
3030

3131
if (heartClickCount === 5) {
3232
phaserStarted = true;

src/assets/js/games/code-breaker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const CodeBreaker = (() => {
5252
titleBar.style.cssText =
5353
"color:#fff;font-size:0.85rem;font-weight:900;text-transform:uppercase;" +
5454
"letter-spacing:0.15em;margin-bottom:0.5rem;opacity:0.8;";
55-
titleBar.textContent = "⌨️ CODE BREAKER" + (devName ? "" + devName : "");
55+
titleBar.textContent = `⌨️ CODE BREAKER${devName ? `${devName}` : ""}`;
5656
overlay.appendChild(titleBar);
5757

5858
// Canvas container — intentionally has NO id matching "game-canvas-{GAME_ID}"
@@ -332,7 +332,7 @@ const CodeBreaker = (() => {
332332
if (!scene.cb_active) return;
333333
scene.cb_active = false;
334334

335-
GameManager.awardXP(XP_CODE_BREAKER_WIN);
335+
GameManager.awardXP(_XP_CODE_BREAKER_WIN);
336336
const wins = GameManager.incrementStat("code_breaker_wins");
337337
if (wins >= 10) GameManager.grantAchievement("code_wizard");
338338
GameManager.setHighScore(GAME_ID, scene.cb_score);
@@ -343,7 +343,7 @@ const CodeBreaker = (() => {
343343
H,
344344
"⌨️ SKILLS MASTERED!",
345345
"#fbbf24",
346-
"+" + XP_CODE_BREAKER_WIN + " XP",
346+
"+" + _XP_CODE_BREAKER_WIN + " XP",
347347
);
348348
}
349349

src/assets/js/games/dev-duel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ const DevDuel = (() => {
299299
dimGfx.fillRect(0, 0, W, H);
300300

301301
// Award XP for playing (all players earn this) and track stats
302-
GameManager.awardXP(XP_DEV_DUEL_PLAY);
302+
GameManager.awardXP(_XP_DEV_DUEL_PLAY);
303303
const duels = GameManager.incrementStat("dev_duel_plays");
304304
if (duels >= 5) GameManager.grantAchievement("duelist");
305305
GameManager.setHighScore(GAME_ID, Math.max(cPower, oPower));
@@ -332,7 +332,7 @@ const DevDuel = (() => {
332332
.setOrigin(0.5);
333333

334334
scene.add
335-
.text(W / 2, H / 2 + 35, "+" + XP_DEV_DUEL_PLAY + " XP for playing!", {
335+
.text(W / 2, H / 2 + 35, "+" + _XP_DEV_DUEL_PLAY + " XP for playing!", {
336336
fontSize: "18px",
337337
fill: "#10b981",
338338
fontStyle: "bold",

src/assets/js/phaser-init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import Phaser from 'phaser';
1+
const Phaser = require("phaser");
22
window.Phaser = Phaser;

src/assets/js/script.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let resizeStartTop = 0;
1111
let currentLevel = Number(localStorage.getItem("userLevel")) || 0;
1212

1313
// Load saved XP or start at 0
14-
let currentXP = parseInt(localStorage.getItem("userXP")) || 0;
14+
let currentXP = parseInt(localStorage.getItem("userXP"), 10) || 0;
1515

1616
let isSurging = false;
1717

@@ -43,9 +43,9 @@ const XP_KONAMI_SECRET = 500; // Konami code easter egg
4343
const XP_FOOTER_SURGE = 1000; // Footer surge secret
4444
const XP_BADGE_CLICK = 45; // Badge click reward
4545
const XP_SPACE_INVADERS_WIN = 200; // Defeat all Space Invaders
46-
const XP_CODE_BREAKER_WIN = 100; // Win a Code Breaker round
47-
const XP_DEV_DUEL_PLAY = 25; // Play a Developer Duel
48-
const XP_DEV_DUEL_WIN = 50; // Win a Developer Duel
46+
const _XP_CODE_BREAKER_WIN = 100; // Win a Code Breaker round
47+
const _XP_DEV_DUEL_PLAY = 25; // Play a Developer Duel
48+
const _XP_DEV_DUEL_WIN = 50; // Win a Developer Duel
4949

5050
const NUM_LEVELS = LEVELS.length;
5151

@@ -410,7 +410,9 @@ function applyTheme(theme) {
410410
"--accent",
411411
"--accent-light",
412412
];
413-
props.forEach((p) => html.style.removeProperty(p));
413+
props.forEach((p) => {
414+
html.style.removeProperty(p);
415+
});
414416

415417
if (theme === "dark") {
416418
html.classList.add("dark");
@@ -776,7 +778,7 @@ function initMatrix() {
776778
ctx.fillStyle = "rgba(0, 0, 0, 0.05)";
777779
ctx.fillRect(0, 0, canvas.width, canvas.height);
778780
ctx.fillStyle = "#0F0";
779-
ctx.font = fontSize + "px monospace";
781+
ctx.font = `${fontSize}px monospace`;
780782

781783
for (let i = 0; i < rainDrops.length; i++) {
782784
const text = alphabet.charAt(Math.floor(Math.random() * alphabet.length));
@@ -1268,7 +1270,7 @@ function initProfileTracker() {
12681270

12691271
// 3. UI Update Logic
12701272
const refreshStats = () => {
1271-
const count = parseInt(localStorage.getItem("profile_view_count") || 0);
1273+
const count = parseInt(localStorage.getItem("profile_view_count") || 0, 10);
12721274
statsContainer.innerHTML = `
12731275
<span style="letter-spacing: 1px;">VIEWS: ${count}</span>
12741276
`;
@@ -1285,6 +1287,7 @@ function initProfileTracker() {
12851287
if (targetLink?.textContent?.includes("Profile")) {
12861288
const currentCount = parseInt(
12871289
localStorage.getItem("profile_view_count") || 0,
1290+
10,
12881291
);
12891292
localStorage.setItem("profile_view_count", currentCount + 1);
12901293
refreshStats();
@@ -1337,7 +1340,7 @@ function jumpToLevel() {
13371340
const input = document.getElementById("jump-lvl");
13381341
if (!input || input.value === "") return;
13391342

1340-
let targetLvl = parseInt(input.value);
1343+
let targetLvl = parseInt(input.value, 10);
13411344

13421345
// Clamp between 0 and NUM_LEVELS
13431346
targetLvl = Math.max(0, Math.min(NUM_LEVELS, targetLvl));
@@ -1365,7 +1368,7 @@ function handleFooterDotClick() {
13651368
// 2. Exit if already unlocked
13661369
if (unlockedEggs.includes("footer_surge")) return;
13671370

1368-
let clicks = parseInt(localStorage.getItem("footerDotClicks")) || 0;
1371+
let clicks = parseInt(localStorage.getItem("footerDotClicks"), 10) || 0;
13691372
clicks++;
13701373

13711374
const core = document.getElementById("footer-dot-core");

src/games.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ permalink: /games/
6262
<div class="user-card p-8 rounded-3xl flex flex-col gap-4">
6363
<div class="text-4xl">⌨️</div>
6464
<h3 class="text-xl font-black">Code Breaker</h3>
65-
<p class="text-sm text-[var(--text-muted)] flex-1">Catch falling tech skills before they hit the ground. Uses generic skills here — visit any profile page for that developer's own skill set. Earn <span class="text-accent font-bold">+{{ XP_CODE_BREAKER_WIN or 100 }} XP</span> on win.</p>
65+
<p class="text-sm text-[var(--text-muted)] flex-1">Catch falling tech skills before they hit the ground. Uses generic skills here — visit any profile page for that developer's own skill set. Earn <span class="text-accent font-bold">+{{ _XP_CODE_BREAKER_WIN or 100 }} XP</span> on win.</p>
6666
<button onclick="CodeBreaker.launch(null, 'Arcade Mode')"
6767
class="mt-auto px-5 py-3 rounded-xl bg-accent text-white font-black uppercase tracking-wider text-sm hover:opacity-90 active:scale-95 transition-all shadow-lg shadow-accent/30">
6868
⌨️ Play
@@ -73,7 +73,7 @@ permalink: /games/
7373
<div class="user-card p-8 rounded-3xl flex flex-col gap-4">
7474
<div class="text-4xl">⚔️</div>
7575
<h3 class="text-xl font-black">Developer Duel</h3>
76-
<p class="text-sm text-[var(--text-muted)] flex-1">Pit two random developers against each other in a skill-power battle. Find the Duel button on any card in the <a href="/" class="text-accent hover:underline">Directory</a>. Earn <span class="text-accent font-bold">+{{ XP_DEV_DUEL_PLAY or 25 }} XP</span> just for playing.</p>
76+
<p class="text-sm text-[var(--text-muted)] flex-1">Pit two random developers against each other in a skill-power battle. Find the Duel button on any card in the <a href="/" class="text-accent hover:underline">Directory</a>. Earn <span class="text-accent font-bold">+{{ _XP_DEV_DUEL_PLAY or 25 }} XP</span> just for playing.</p>
7777
<a href="/"
7878
class="mt-auto inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl bg-[var(--bg-footer)] text-[var(--text-main)] font-black uppercase tracking-wider text-sm border border-[var(--border-color)] hover:border-accent transition-all">
7979
← Go to Directory

0 commit comments

Comments
 (0)