Files
kaltaquise-gamification/sys_digger/index.html
2026-04-20 14:44:51 +02:00

239 lines
6.8 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sys Digger</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
background: #0a0a1a;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
font-family: 'Courier New', monospace;
overflow: hidden;
}
canvas { display: block; cursor: crosshair; }
#score {
position: absolute;
top: 20px;
right: 20px;
color: #00ff88;
font-size: 24px;
text-shadow: 0 0 10px #00ff88;
}
#highscore {
position: absolute;
top: 52px;
right: 20px;
color: #ffcc00;
font-size: 16px;
text-shadow: 0 0 8px #ffcc00;
}
#cystinstein-area {
position: absolute;
top: 20px;
left: 20px;
width: 160px;
border: 2px solid #ff4444;
border-radius: 8px;
padding: 10px;
background: rgba(0, 0, 0, 0.75);
}
#cystinstein-label {
color: #ff4444;
font-size: 11px;
text-align: center;
letter-spacing: 2px;
margin-bottom: 6px;
text-shadow: 0 0 8px #ff4444;
}
#cystinstein-canvas { display: block; margin: 0 auto; }
#docks-count {
color: #ff8888;
font-size: 11px;
text-align: center;
margin-top: 6px;
}
/* ── Game-over overlay ── */
#overlay {
display: none;
position: absolute;
top: 0; left: 0;
width: 100%; height: 100%;
background: rgba(0, 0, 0, 0.90);
justify-content: center;
align-items: center;
flex-direction: column;
color: white;
text-align: center;
overflow-y: auto;
padding: 30px 20px;
}
#overlay.active { display: flex; }
#overlay h1 {
font-size: 44px;
color: #ff4444;
margin-bottom: 6px;
text-shadow: 0 0 30px #ff4444;
animation: flicker 1s infinite alternate;
}
@keyframes flicker {
from { opacity: 1; }
to { opacity: 0.75; }
}
#final-score {
font-size: 26px;
color: #00ff88;
text-shadow: 0 0 8px #00ff88;
margin-bottom: 4px;
}
#new-record {
font-size: 18px;
color: #ffcc00;
text-shadow: 0 0 12px #ffcc00;
margin-bottom: 16px;
animation: flicker 0.6s infinite alternate;
display: none;
}
#new-record.visible { display: block; }
/* ── Name form ── */
#name-form {
display: flex;
gap: 8px;
margin-bottom: 24px;
}
#player-name {
padding: 10px 14px;
font-size: 16px;
font-family: 'Courier New', monospace;
background: #111;
color: #fff;
border: 2px solid #00ff88;
border-radius: 6px;
outline: none;
width: 200px;
}
#player-name:focus { border-color: #00ffcc; }
#submit-score-btn {
padding: 10px 20px;
font-size: 16px;
font-family: 'Courier New', monospace;
font-weight: bold;
background: #00ff88;
color: #000;
border: none;
border-radius: 6px;
cursor: pointer;
transition: background 0.2s;
}
#submit-score-btn:hover { background: #00cc66; }
/* ── Leaderboard ── */
#leaderboard {
width: 340px;
margin-bottom: 24px;
}
#leaderboard h2 {
font-size: 13px;
letter-spacing: 3px;
color: #ffcc00;
text-shadow: 0 0 8px #ffcc00;
margin-bottom: 10px;
}
#leaderboard table {
width: 100%;
border-collapse: collapse;
font-size: 15px;
}
#leaderboard th {
color: #888;
font-size: 11px;
letter-spacing: 1px;
padding: 4px 8px;
border-bottom: 1px solid #333;
}
#leaderboard td {
padding: 6px 8px;
color: #ccc;
border-bottom: 1px solid #1a1a2e;
}
#leaderboard tr.rank-1 td { color: #ffd700; }
#leaderboard tr.rank-2 td { color: #c0c0c0; }
#leaderboard tr.rank-3 td { color: #cd7f32; }
#leaderboard tr.highlight td {
color: #00ff88;
text-shadow: 0 0 6px #00ff88;
background: rgba(0, 255, 136, 0.06);
}
.rank-num { width: 32px; text-align: center; color: #555; }
#restart-btn {
padding: 14px 40px;
background: #00ff88;
color: #000;
border: none;
border-radius: 8px;
font-size: 20px;
font-family: 'Courier New', monospace;
font-weight: bold;
cursor: pointer;
transition: background 0.2s;
}
#restart-btn:hover { background: #00cc66; }
</style>
</head>
<body>
<canvas id="gameCanvas"></canvas>
<div id="cystinstein-area">
<div id="cystinstein-label">CYSTINSTEIN</div>
<canvas id="cystinstein-canvas" width="130" height="130"></canvas>
<div id="docks-count">0 / 8 docks</div>
</div>
<div id="score">Score: 0</div>
<div id="highscore">Best: —</div>
<div id="overlay">
<h1>CYSTINSTEIN FORMED!</h1>
<p id="final-score"></p>
<p id="new-record">&#9733; NEW HIGH SCORE &#9733;</p>
<div id="name-form">
<input id="player-name" type="text" maxlength="20" placeholder="Your name" autocomplete="off" />
<button id="submit-score-btn" onclick="submitScore()">Save</button>
</div>
<div id="leaderboard">
<h2>LEADERBOARD</h2>
<table>
<thead>
<tr>
<th class="rank-num">#</th>
<th style="text-align:left">Name</th>
<th style="text-align:right">Score</th>
</tr>
</thead>
<tbody id="leaderboard-rows"></tbody>
</table>
</div>
<button id="restart-btn" onclick="restartGame()">Play Again</button>
</div>
<script src="constants.js"></script>
<script src="atom.js"></script>
<script src="render.js"></script>
<script src="game.js"></script>
</body>
</html>