From 97893ad1c7818d0fc045b05548a7fe6596083fd9 Mon Sep 17 00:00:00 2001 From: yuto ichinose Date: Tue, 31 Oct 2023 12:31:36 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=90=8D=E5=89=8D=E3=81=AE=E7=A9=BA?= =?UTF-8?q?=E7=99=BD=E9=83=A8=E5=88=86=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=84=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- local_build/js/lib/keyboard.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/local_build/js/lib/keyboard.js b/local_build/js/lib/keyboard.js index ef1c9e5..3dc9929 100644 --- a/local_build/js/lib/keyboard.js +++ b/local_build/js/lib/keyboard.js @@ -9,6 +9,7 @@ let input = document.querySelectorAll('.keyboard-rows > input'); let named = document.getElementById('keyboard-name'); let names = []; let Count = 0; +const maxCount = 6; let initFlag = false; let gameData = {}; @@ -47,7 +48,7 @@ export const initKeyboard = (gameState) => { confirmBtn(); return; } - if (Count < 6) { + if (Count < maxCount) { typed(ele); } }); @@ -65,7 +66,8 @@ export const initKeyboard = (gameState) => { */ function update() { named.innerHTML = ''; - names.forEach(function (name) { + console.log([...names, ...new Array(maxCount - names.length).fill('\u3000')]); + [...names, ...new Array(maxCount - names.length).fill('\u3000')].forEach(function (name) { const spanele = document.createElement('span'); spanele.innerHTML = name; named.appendChild(spanele);