Newer
Older
rpg / v2 / apps / game / index.html
<!doctype html>
<html lang="ru">
<head>
    <meta charset="utf-8" />
    <title>Пепельные луга — v2</title>
    <style>
        html, body { margin: 0; height: 100%; background: #17171d; }
        body { display: grid; place-items: center; }
        /* бэкинг-стор 960×540, канвас растягивается под окно (16:9, pixelated) */
        canvas {
            width: min(100vw, calc(100vh * 16 / 9));
            height: min(100vh, calc(100vw * 9 / 16));
            image-rendering: pixelated;
            image-rendering: crisp-edges;
        }
        /* Подсказка перехода/взаимодействия у точки */
        #hint {
            position: fixed;
            top: 12px;
            left: 50%;
            transform: translateX(-50%);
            padding: 6px 14px;
            background: rgba(23, 23, 29, 0.85);
            color: #d99a32;
            font: 16px/1.4 monospace;
            border: 1px solid #44454e;
            border-radius: 4px;
            white-space: nowrap;
        }
        /* Пелена наката: полупрозрачная пелена низин (alpha из screenFx) */
        #haze {
            position: fixed;
            inset: 0;
            background: #5a6a78;
            opacity: 0;
            pointer-events: none;
        }
        /* Виньетка опасности: края экрана темнеют (накат без полотна) */
        #vignette {
            position: fixed;
            inset: 0;
            background: radial-gradient(ellipse at center, transparent 55%, rgba(10, 10, 14, 0.9) 100%);
            opacity: 0;
            pointer-events: none;
        }
        /* Фейд перехода областей: чёрный слой поверх всего */
        #fade {
            position: fixed;
            inset: 0;
            background: #000;
            opacity: 0;
            pointer-events: none;
        }
        /* Трекер квестов: первая активная стадия, левый верхний угол */
        #quest {
            position: fixed;
            top: 12px;
            left: 12px;
            padding: 8px 12px;
            background: rgba(23, 23, 29, 0.85);
            color: #d99a32;
            font: 15px/1.5 monospace;
            border: 1px solid #44454e;
            border-radius: 4px;
            white-space: pre;
        }
        /* Сумка: под трекером */
        #inv {
            position: fixed;
            top: 56px;
            left: 12px;
            padding: 8px 12px;
            background: rgba(23, 23, 29, 0.85);
            color: #c9c9d2;
            font: 15px/1.5 monospace;
            border: 1px solid #44454e;
            border-radius: 4px;
            white-space: pre;
        }
        #inv .title { color: #626c4c; }
        #inv .item { color: #d99a32; }
        /* Тосты: столбик всплывашек по центру сверху */
        #toasts {
            position: fixed;
            top: 52px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            flex-direction: column;
            gap: 4px;
            align-items: center;
            pointer-events: none;
        }
        #toasts div {
            padding: 5px 12px;
            background: rgba(23, 23, 29, 0.85);
            color: #d99a32;
            font: 15px monospace;
            border: 1px solid #44454e;
            border-radius: 4px;
            white-space: nowrap;
        }
        /* Диалог: панель внизу экрана, реплика + варианты (кнопки) */
        #dialog {
            position: fixed;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%);
            width: 640px;
            max-width: 92vw;
            padding: 12px 16px;
            background: rgba(23, 23, 29, 0.92);
            color: #c9c9d2;
            font: 16px/1.5 monospace;
            border: 1px solid #44454e;
            border-radius: 6px;
        }
        #dialog .speaker { color: #d99a32; font-weight: bold; }
        #dialog .choices { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
        #dialog .choices button {
            text-align: left;
            padding: 4px 10px;
            background: #23232c;
            color: #c9c9d2;
            border: 1px solid #44454e;
            border-radius: 3px;
            font: inherit;
            cursor: pointer;
        }
        #dialog .choices button:hover { border-color: #d99a32; color: #fff; }
        #dialog .continue { margin-top: 8px; color: #626c4c; font-size: 13px; }
        /* Меню: Esc — пауза с автосейвом; старт страницы — выбор входа */
        #menu {
            position: fixed;
            inset: 0;
            display: flex;
            flex-direction: column;
            gap: 10px;
            align-items: center;
            justify-content: center;
            background: rgba(10, 10, 14, 0.72);
            z-index: 10;
        }
        #menu[hidden] { display: none; } /* display:flex перебивает атрибут hidden */
        #menu h1 {
            margin: 0 0 8px;
            color: #d99a32;
            font: bold 26px monospace;
            letter-spacing: 2px;
        }
        #menu button {
            width: 260px;
            padding: 8px 0;
            background: #23232c;
            color: #c9c9d2;
            border: 1px solid #44454e;
            border-radius: 4px;
            font: 16px monospace;
            cursor: pointer;
        }
        #menu button:hover:not(:disabled) { border-color: #d99a32; color: #fff; }
        #menu button:disabled { opacity: 0.4; cursor: default; }
        #menu p { margin-top: 10px; color: #626c4c; font: 13px monospace; }
    </style>
</head>
<body>
    <canvas id="scene"></canvas>
    <div id="haze"></div>
    <div id="vignette"></div>
    <div id="fade"></div>
    <div id="hint" hidden></div>
    <div id="quest" hidden></div>
    <div id="inv" hidden></div>
    <div id="toasts"></div>
    <div id="dialog" hidden></div>
    <div id="menu">
        <h1>ПЕПЕЛЬНЫЕ ЛУГА</h1>
        <button id="menu-continue" disabled>Продолжить</button>
        <button id="menu-new">Войти в мир</button>
        <p>WASD — движение · E — действие · Esc — меню</p>
    </div>
    <script type="module" src="/src/main.ts"></script>
</body>
</html>