Fix critical JavaScript syntax error
Fixed } else if syntax error that was breaking all games on Vercel deployment
This commit is contained in:
56
index.html
56
index.html
@@ -164,8 +164,10 @@
|
||||
<h3 id="overlayTitle">GAME OVER</h3>
|
||||
<div class="input-group">
|
||||
<input type="text" id="playerName" placeholder="Enter your name" maxlength="15">
|
||||
<input type="text" id="playerSecretCode" placeholder="Your secret code (optional)" maxlength="6" style="width: 120px; text-transform: uppercase;">
|
||||
<button id="submitScoreBtn" class="btn-primary">Save Score</button>
|
||||
</div>
|
||||
<p class="code-hint" id="codeHint">New players get a secret code automatically</p>
|
||||
</div>
|
||||
<button id="startGameBtn" class="btn-primary">Start Mission</button>
|
||||
</div>
|
||||
@@ -175,7 +177,17 @@
|
||||
<canvas id="gameCanvas"></canvas>
|
||||
</div>
|
||||
<div class="leaderboard glass">
|
||||
<h3>Leaderboard</h3>
|
||||
<div class="leaderboard-header">
|
||||
<h3>Global Leaderboard</h3>
|
||||
<button class="tab-btn active" data-tab="total">Total</button>
|
||||
<button class="tab-btn" data-tab="gift">Gift Catcher</button>
|
||||
<button class="tab-btn" data-tab="traoom">Traoom</button>
|
||||
<button class="tab-btn" data-tab="neonpuzzle">Neon Puzzle</button>
|
||||
<button class="tab-btn" data-tab="rhythm">Rhythm Beat</button>
|
||||
<button class="tab-btn" data-tab="arena">Cosmic Arena</button>
|
||||
<button class="tab-btn" data-tab="tetris">Crystal Tetris</button>
|
||||
<button class="tab-btn" data-tab="platformer">Aurora Jumper</button>
|
||||
</div>
|
||||
<div id="leaderboardList"></div>
|
||||
<div class="export-buttons">
|
||||
<button class="export-btn" onclick="exportLeaderboard()">Download Scores</button>
|
||||
@@ -202,7 +214,12 @@
|
||||
<h3 id="traoomOverlayTitle">GAME OVER</h3>
|
||||
<p id="traoomOverlayScore">Bugs Fixed: <span id="finalKills">0</span></p>
|
||||
<p id="traoomOverlayTime">Time Survived: <span id="finalTime">0:00</span></p>
|
||||
<button id="restartTraoomBtn" class="btn-primary">Play Again</button>
|
||||
<div class="input-group">
|
||||
<input type="text" id="traoomPlayerName" placeholder="Enter your name" maxlength="15">
|
||||
<input type="text" id="traoomSecretCode" placeholder="Secret code (optional)" maxlength="6" style="width: 120px; text-transform: uppercase;">
|
||||
<button id="submitTraoomBtn" class="btn-primary">Save Score</button>
|
||||
</div>
|
||||
<p class="code-hint" id="traoomCodeHint">New players get a secret code</p>
|
||||
</div>
|
||||
<button id="startTraoomBtn" class="btn-primary">Start Bug Hunt</button>
|
||||
</div>
|
||||
@@ -228,7 +245,12 @@
|
||||
<div id="neonpuzzleOverlay" class="game-overlay hidden">
|
||||
<h3 id="puzzleOverlayTitle">LEVEL COMPLETE</h3>
|
||||
<p id="puzzleOverlayScore">Moves: <span id="finalMoves">0</span></p>
|
||||
<button id="nextPuzzleBtn" class="btn-primary">Next Level</button>
|
||||
<div class="input-group">
|
||||
<input type="text" id="puzzlePlayerName" placeholder="Enter your name" maxlength="15">
|
||||
<input type="text" id="puzzleSecretCode" placeholder="Secret code (optional)" maxlength="6" style="width: 120px; text-transform: uppercase;">
|
||||
<button id="submitPuzzleBtn" class="btn-primary">Save Score</button>
|
||||
</div>
|
||||
<p class="code-hint" id="puzzleCodeHint">New players get a secret code</p>
|
||||
</div>
|
||||
<button id="startPuzzleBtn" class="btn-primary">Start Puzzle</button>
|
||||
</div>
|
||||
@@ -255,7 +277,12 @@
|
||||
<div id="rhythmOverlay" class="game-overlay hidden">
|
||||
<h3 id="rhythmOverlayTitle">BEAT OVER</h3>
|
||||
<p id="rhythmOverlayScore">Final Score: <span id="finalRhythmScore">0</span></p>
|
||||
<button id="restartRhythmBtn" class="btn-primary">Play Again</button>
|
||||
<div class="input-group">
|
||||
<input type="text" id="rhythmPlayerName" placeholder="Enter your name" maxlength="15">
|
||||
<input type="text" id="rhythmSecretCode" placeholder="Secret code (optional)" maxlength="6" style="width: 120px; text-transform: uppercase;">
|
||||
<button id="submitRhythmBtn" class="btn-primary">Save Score</button>
|
||||
</div>
|
||||
<p class="code-hint" id="rhythmCodeHint">New players get a secret code</p>
|
||||
</div>
|
||||
<button id="startRhythmBtn" class="btn-primary">Start Rhythm</button>
|
||||
</div>
|
||||
@@ -282,7 +309,12 @@
|
||||
<div id="arenaOverlay" class="game-overlay hidden">
|
||||
<h3 id="arenaOverlayTitle">GAME OVER</h3>
|
||||
<p id="arenaOverlayScore">Enemies Defeated: <span id="finalArenaKills">0</span></p>
|
||||
<button id="restartArenaBtn" class="btn-primary">Play Again</button>
|
||||
<div class="input-group">
|
||||
<input type="text" id="arenaPlayerName" placeholder="Enter your name" maxlength="15">
|
||||
<input type="text" id="arenaSecretCode" placeholder="Secret code (optional)" maxlength="6" style="width: 120px; text-transform: uppercase;">
|
||||
<button id="submitArenaBtn" class="btn-primary">Save Score</button>
|
||||
</div>
|
||||
<p class="code-hint" id="arenaCodeHint">New players get a secret code</p>
|
||||
</div>
|
||||
<button id="startArenaBtn" class="btn-primary">Enter Arena</button>
|
||||
</div>
|
||||
@@ -309,7 +341,12 @@
|
||||
<div id="tetrisOverlay" class="game-overlay hidden">
|
||||
<h3 id="tetrisOverlayTitle">GAME OVER</h3>
|
||||
<p id="tetrisOverlayScore">Final Score: <span id="finalTetrisScore">0</span></p>
|
||||
<button id="restartTetrisBtn" class="btn-primary">Play Again</button>
|
||||
<div class="input-group">
|
||||
<input type="text" id="tetrisPlayerName" placeholder="Enter your name" maxlength="15">
|
||||
<input type="text" id="tetrisSecretCode" placeholder="Secret code (optional)" maxlength="6" style="width: 120px; text-transform: uppercase;">
|
||||
<button id="submitTetrisBtn" class="btn-primary">Save Score</button>
|
||||
</div>
|
||||
<p class="code-hint" id="tetrisCodeHint">New players get a secret code</p>
|
||||
</div>
|
||||
<button id="startTetrisBtn" class="btn-primary">Start Game</button>
|
||||
</div>
|
||||
@@ -336,7 +373,12 @@
|
||||
<h3 id="platformerOverlayTitle">LEVEL COMPLETE</h3>
|
||||
<p id="platformerOverlayScore">Coins: <span id="finalCoins">0</span></p>
|
||||
<p id="platformerOverlayTime">Time: <span id="finalPlatformerTime">0:00</span></p>
|
||||
<button id="restartPlatformerBtn" class="btn-primary">Play Again</button>
|
||||
<div class="input-group">
|
||||
<input type="text" id="platformerPlayerName" placeholder="Enter your name" maxlength="15">
|
||||
<input type="text" id="platformerSecretCode" placeholder="Secret code (optional)" maxlength="6" style="width: 120px; text-transform: uppercase;">
|
||||
<button id="submitPlatformerBtn" class="btn-primary">Save Score</button>
|
||||
</div>
|
||||
<p class="code-hint" id="platformerCodeHint">New players get a secret code</p>
|
||||
</div>
|
||||
<button id="startPlatformerBtn" class="btn-primary">Start Game</button>
|
||||
</div>
|
||||
|
||||
261
style.css
261
style.css
@@ -35,7 +35,7 @@ body {
|
||||
}
|
||||
|
||||
.app-container {
|
||||
max-width: 1200px;
|
||||
max-width: 1400px;
|
||||
margin: 0 auto;
|
||||
padding: 0 20px;
|
||||
width: 100%;
|
||||
@@ -913,30 +913,147 @@ body {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.leaderboard h3 {
|
||||
font-family: var(--font-accent);
|
||||
text-align: center;
|
||||
.leaderboard-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 15px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.leaderboard-header h3 {
|
||||
font-family: var(--font-accent);
|
||||
color: var(--aurora-cyan);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.tab-btn {
|
||||
background: var(--glass-bg);
|
||||
border: 1px solid var(--glass-border);
|
||||
color: var(--text-primary);
|
||||
padding: 8px 16px;
|
||||
border-radius: 12px;
|
||||
cursor: pointer;
|
||||
font-family: var(--font-accent);
|
||||
font-size: 0.85rem;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.tab-btn:hover {
|
||||
background: rgba(0, 255, 102, 0.2);
|
||||
border-color: var(--trae-green);
|
||||
}
|
||||
|
||||
.tab-btn.active {
|
||||
background: var(--trae-green);
|
||||
color: var(--bg-dark);
|
||||
border-color: var(--trae-green);
|
||||
}
|
||||
|
||||
.leader-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 10px 20px;
|
||||
padding: 12px 20px;
|
||||
border-bottom: 1px solid var(--glass-border);
|
||||
font-family: var(--font-accent);
|
||||
align-items: center;
|
||||
transition: background 0.3s ease;
|
||||
}
|
||||
|
||||
.leader-item:hover {
|
||||
background: rgba(0, 255, 102, 0.1);
|
||||
}
|
||||
|
||||
.leader-item:last-child {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.leader-rank { color: var(--trae-green); }
|
||||
.leader-name { flex: 1; margin-left: 20px; }
|
||||
.leader-score { color: var(--aurora-cyan); }
|
||||
.leader-duration { color: #ff9900; font-size: 0.85rem; margin-left: 10px; }
|
||||
.leader-date { color: #888; font-size: 0.8rem; margin-left: 10px; }
|
||||
.leader-rank {
|
||||
color: var(--trae-green);
|
||||
font-weight: bold;
|
||||
min-width: 40px;
|
||||
}
|
||||
|
||||
.leader-name {
|
||||
flex: 1;
|
||||
margin-left: 20px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.leader-score {
|
||||
color: var(--aurora-cyan);
|
||||
font-weight: bold;
|
||||
min-width: 80px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.leader-game {
|
||||
color: #ff6600;
|
||||
font-size: 0.8rem;
|
||||
padding: 4px 10px;
|
||||
border-radius: 8px;
|
||||
background: rgba(255, 102, 0, 0.1);
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.leader-code {
|
||||
color: #7000ff;
|
||||
font-size: 0.75rem;
|
||||
margin-left: 10px;
|
||||
padding: 4px 10px;
|
||||
border-radius: 6px;
|
||||
background: rgba(112, 0, 255, 0.1);
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.leader-code:hover {
|
||||
background: rgba(112, 0, 255, 0.2);
|
||||
}
|
||||
|
||||
.leader-duration {
|
||||
color: #ff9900;
|
||||
font-size: 0.85rem;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.leader-date {
|
||||
color: #888;
|
||||
font-size: 0.8rem;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.code-hint {
|
||||
color: #888;
|
||||
font-size: 0.8rem;
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.export-buttons {
|
||||
display: flex;
|
||||
gap: 15px;
|
||||
justify-content: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.export-btn {
|
||||
background: var(--glass-bg);
|
||||
border: 1px solid var(--glass-border);
|
||||
color: var(--text-primary);
|
||||
padding: 10px 20px;
|
||||
border-radius: 12px;
|
||||
cursor: pointer;
|
||||
font-family: var(--font-accent);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.export-btn:hover {
|
||||
background: rgba(0, 255, 102, 0.2);
|
||||
border-color: var(--trae-green);
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; transform: scale(0.9); }
|
||||
@@ -1039,24 +1156,132 @@ footer span, .glm-link, .author-link, .gemini-link {
|
||||
.forge-input-group { flex-direction: column; }
|
||||
.btn-secondary { margin-left: 0; margin-top: 15px; }
|
||||
|
||||
.app-container { padding: 0 10px; }
|
||||
|
||||
.hero h1 { font-size: 2rem; }
|
||||
.app-icons { gap: 15px; }
|
||||
.app-icon-inner { width: 60px; height: 60px; font-size: 30px; }
|
||||
.app-label { font-size: 0.75rem; }
|
||||
|
||||
.game-container {
|
||||
padding: 15px;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.section-card {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.game-container, .traoom-container, .neonpuzzle-container, .rhythm-container, .arena-container, .platformer-container {
|
||||
height: 50vh;
|
||||
min-height: 350px;
|
||||
}
|
||||
|
||||
canvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.game-overlay {
|
||||
padding: 25px 20px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.input-group input {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.btn-primary, .export-btn {
|
||||
padding: 10px 15px;
|
||||
font-size: 0.9rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.leaderboard-header {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.tab-btn {
|
||||
padding: 8px 10px;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
.leader-item {
|
||||
flex-wrap: wrap;
|
||||
padding: 10px;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.leader-game, .leader-code {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.game-timer {
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.game-ui > div {
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.traoom-container {
|
||||
height: 60vh;
|
||||
min-height: 400px;
|
||||
height: 50vh;
|
||||
min-height: 350px;
|
||||
}
|
||||
|
||||
.traoom-stats {
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
left: 10px;
|
||||
top: 10px;
|
||||
gap: 5px;
|
||||
left: 8px;
|
||||
top: 8px;
|
||||
}
|
||||
|
||||
.traoom-stat {
|
||||
padding: 6px 12px;
|
||||
padding: 5px 10px;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
.traoom-controls p, .neonpuzzle-controls p, .rhythm-container p, .arena-container p {
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
footer p {
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.traoom-controls p {
|
||||
font-size: 0.8rem;
|
||||
.export-buttons {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.hero h1 { font-size: 1.5rem; }
|
||||
.app-icons { gap: 10px; }
|
||||
.app-icon-inner { width: 50px; height: 50px; font-size: 24px; }
|
||||
.app-label { font-size: 0.7rem; }
|
||||
|
||||
.game-container, .traoom-container, .neonpuzzle-container, .rhythm-container, .arena-container, .platformer-container {
|
||||
height: 45vh;
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.game-overlay h3 {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.leaderboard-header h3 {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user