80 lines
3.7 KiB
HTML
80 lines
3.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ru">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Биндим Фигняшку</title>
|
|
<style>
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
body {
|
|
background: #0a0a0a;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
min-height: 100vh;
|
|
font-family: monospace;
|
|
color: #ccc;
|
|
overflow: hidden;
|
|
user-select: none;
|
|
}
|
|
/* Сцена = два наложенных холста: WebGL-мир снизу, 2D-HUD сверху.
|
|
width/height: 100% обязательны — иначе canvas (replaced-элемент)
|
|
показывается в размер своего HiDPI-буфера и вылезает за рамки. */
|
|
#stage { position: relative; width: 880px; height: 660px; border: 1px solid #222; }
|
|
#stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
|
|
#hud { pointer-events: none; }
|
|
|
|
/* Стартовое меню — поверх холстов, перекрывает сцену своим фоном. */
|
|
#menu {
|
|
position: absolute; inset: 0; z-index: 10;
|
|
/* фон-картинка с тёмным затемнением для читаемости; фолбэк — тёмный цвет */
|
|
background: linear-gradient(rgba(10,10,15,0.7), rgba(10,10,15,0.82)),
|
|
url(assets/menu-bg.png) center / cover no-repeat, #0a0a0f;
|
|
display: flex; flex-direction: column; align-items: center; justify-content: center;
|
|
gap: 14px; padding: 24px;
|
|
}
|
|
#menu h1 { font-size: 40px; letter-spacing: 4px; color: #c9b27a; margin-bottom: 4px; }
|
|
#menu-logo { display: block; width: min(560px, 80%); height: auto; }
|
|
.menu-sub { color: #888; margin-bottom: 6px; }
|
|
.menu-packs { display: flex; gap: 8px; margin-bottom: 2px; }
|
|
.menu-pack {
|
|
cursor: pointer;
|
|
background: rgba(12,12,18,0.86); color: #aaa;
|
|
border: 1px solid #333; border-radius: 4px;
|
|
padding: 7px 12px; font-family: monospace; font-size: 12px;
|
|
transition: background .12s, border-color .12s, color .12s;
|
|
}
|
|
.menu-pack:hover { background: #1d1d2c; border-color: #5a78c0; color: #ddd; }
|
|
.menu-pack.is-selected { color: #f0d887; border-color: #8f6f25; background: rgba(42,32,12,0.88); }
|
|
#menu-presets { display: flex; flex-direction: column; gap: 10px; width: 360px; max-width: 90%; }
|
|
.menu-preset {
|
|
display: flex; flex-direction: column; gap: 3px;
|
|
text-align: left; cursor: pointer;
|
|
background: #15151f; color: #ddd;
|
|
border: 1px solid #333; border-radius: 4px;
|
|
padding: 12px 14px; font-family: monospace; font-size: 14px;
|
|
transition: background .12s, border-color .12s;
|
|
}
|
|
.menu-preset:hover { background: #1d1d2c; border-color: #5a78c0; }
|
|
.menu-preset-name { font-weight: bold; color: #cdd6f4; }
|
|
.menu-preset-desc { font-size: 11px; color: #888; }
|
|
.menu-hint { color: #555; font-size: 12px; margin-top: 10px; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="stage">
|
|
<canvas id="game" width="880" height="660"></canvas>
|
|
<canvas id="hud" width="880" height="660"></canvas>
|
|
|
|
<!-- Стартовое меню. Кнопки уровней генерирует StartMenu из PRESETS. -->
|
|
<div id="menu">
|
|
<h1><img id="menu-logo" src="assets/logo.png" alt="Биндим Фигняшку" /></h1>
|
|
<p class="menu-sub">Выбери уровень</p>
|
|
<div id="menu-presets"></div>
|
|
<p class="menu-hint">WASD — движение · Стрелки — стрельба · Tab — оружие · Esc — меню</p>
|
|
</div>
|
|
</div>
|
|
<script type="module" src="./main.js"></script>
|
|
</body>
|
|
</html>
|