Added some style logic

This commit is contained in:
2021-12-27 15:04:07 -03:00
parent 70e6ddcedb
commit 0102f9b106
14 changed files with 200 additions and 14 deletions

View File

@@ -0,0 +1,27 @@
export default function disableEnterInputs() {
const player1 = document.getElementsByClassName('player player-1')[0]
const player2 = document.getElementsByClassName('player player-2')[0]
const inputsPlayer1 = [player1.children[0], player1.children[1].children[1]]
const inputsPlayer2 = [player2.children[0], player2.children[1].children[0]]
const inputsPlayers = [inputsPlayer1, inputsPlayer2]
inputsPlayers.forEach(inputsArray => {
inputsArray.forEach(input => {
input.addEventListener('keypress', e => {
if (e.keyCode === 13 || e.which === 13) {
e.preventDefault()
return false
}
})
})
})
}