Files
shooting-word/index.html
T

44 lines
1.6 KiB
HTML

<!doctype html>
<html lang="ru">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Shooting word</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div id="game-container">
<div id="channel-form">
<div class="screen-title">SHOOTING WORD</div>
<div class="screen-subtitle">Введите имя канала для игры</div>
<input type="text" id="channel-input" placeholder="ku6ep_xboctuk" autofocus />
<button id="copy-btn">СКОПИРОВАТЬ ССЫЛКУ</button>
<div id="game-link"></div>
<div class="obs-note">
Вставь ссылку в OBS как источник браузера<br />
(500×950, прокрутка выкл.)
</div>
</div>
</div>
<script>
const input = document.getElementById("channel-input");
const copyBtn = document.getElementById("copy-btn");
const linkEl = document.getElementById("game-link");
function copyLink() {
const name = input.value.trim().toLowerCase() || "ku6ep_xboctuk";
const url = `${location.origin}${location.pathname.replace(/\/[^/]*$/, "/")}game.html?channel=${encodeURIComponent(name)}`;
navigator.clipboard.writeText(url).then(() => {
linkEl.textContent = "СКОПИРОВАНО!";
linkEl.className = "copied";
});
}
copyBtn.addEventListener("click", copyLink);
input.addEventListener("keydown", (e) => {
if (e.key === "Enter") copyLink();
});
</script>
</body>
</html>