Skip to content

Commit

Permalink
Merge pull request #123 from illionillion/dev
Browse files Browse the repository at this point in the history
fix: 名前の空白部分を表示するよういに修正
  • Loading branch information
illionillion authored Oct 31, 2023
2 parents 50836ca + 97893ad commit 1cb2c14
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions local_build/js/lib/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};

Expand Down Expand Up @@ -47,7 +48,7 @@ export const initKeyboard = (gameState) => {
confirmBtn();
return;
}
if (Count < 6) {
if (Count < maxCount) {
typed(ele);
}
});
Expand All @@ -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);
Expand Down

0 comments on commit 1cb2c14

Please sign in to comment.