feat: add settings and browser input
This commit is contained in:
+3
-1
@@ -1,10 +1,12 @@
|
||||
const input = document.getElementById("channel-input");
|
||||
const copyBtn = document.getElementById("copy-btn");
|
||||
const linkEl = document.getElementById("game-link");
|
||||
const autoRestartEl = document.getElementById("opt-auto-restart");
|
||||
|
||||
function copyLink() {
|
||||
const name = input.value.trim().toLowerCase() || "Ku6ep_XBOCTuK";
|
||||
const url = `${location.origin}${location.pathname.replace(/\/[^/]*$/, "/")}game.html?channel=${encodeURIComponent(name)}`;
|
||||
const autoRestart = autoRestartEl.checked ? "1" : "0";
|
||||
const url = `${location.origin}${location.pathname.replace(/\/[^/]*$/, "/")}game.html?channel=${encodeURIComponent(name)}&autoRestart=${autoRestart}`;
|
||||
navigator.clipboard.writeText(url).then(() => {
|
||||
linkEl.textContent = "СКОПИРОВАНО!";
|
||||
linkEl.className = "copied";
|
||||
|
||||
Reference in New Issue
Block a user