diff --git a/main/js/main.js b/main/js/main.js index 60eb656..c99c627 100644 --- a/main/js/main.js +++ b/main/js/main.js @@ -32,21 +32,21 @@ }; -document.getElementById("quick_button").onclick = function() { +document.getElementById("quick_button").onclick = function () { console.log("押したよ") socket.send(JSON.stringify(clientDate)) let gfg = document.getElementById("audio"); function speedButtonReset() { - gfg.speedButtonReset(); + gfg.speedButtonReset(); } - + let intervalId; document.getElementById('quick_button').addEventListener('click', () => { clearInterval(intervalId); intervalId = null; -}); + }); }; @@ -54,25 +54,34 @@ const textInput1 = document.getElementById('name'); const textInput2 = document.getElementById('team'); const toggleButton = document.getElementById('Btn'); - console.log(textInput1.value) + + console.log(textInput1.value == null || textInput1.value == ""); + console.log(!textInput2.value); + if (!textInput1.value) { + textInput1.value = "名無しの権兵衛"; + } + if (!textInput2.value) { + alert("decide team!!"); + } if (textInput1.disabled) { - // 入力フィールドが無効化されている場合、有効化する - textInput1.disabled = false; - toggleButton.textContent = '決定中断'; // ボタンテキストを変更 + // 入力フィールドが無効化されている場合、有効化する + textInput1.disabled = false; + toggleButton.textContent = '決定中断'; // ボタンテキストを変更 } else { - // 入力フィールドが有効な場合、無効化する - textInput1.disabled = true; - toggleButton.textContent = '入力中断'; // ボタンテキストを変更 + // 入力フィールドが有効な場合、無効化する + textInput1.disabled = true; + toggleButton.textContent = '入力中断'; // ボタンテキストを変更 } - if (textInput2.disabled) { - // 入力フィールドが無効化されている場合、有効化する - textInput2.disabled = false; - toggleButton.textContent = '決定中断'; // ボタンテキストを変更 - } else { - // 入力フィールドが有効な場合、無効化する - textInput2.disabled = true; - toggleButton.textContent = '入力中断'; // ボタンテキストを変更 - } - -} \ No newline at end of file + if (textInput2.disabled) { + // 入力フィールドが無効化されている場合、有効化する + textInput2.disabled = false; + toggleButton.textContent = '決定中断'; // ボタンテキストを変更 + } else { + // 入力フィールドが有効な場合、無効化する + textInput2.disabled = true; + toggleButton.textContent = '入力中断'; // ボタンテキストを変更 + } + +} + diff --git a/main/main.html b/main/main.html index 00b0945..88f5610 100644 --- a/main/main.html +++ b/main/main.html @@ -23,7 +23,7 @@ - +