🛩🎮 Checkpoint
./views/index.html:1954897/9147 ./public/script.js:1954897/4664
This commit is contained in:
1 parent
db3967858c
commit
46f99808c1
2 files changed
+15
-2
No files matched your search
+9
-1
@@ -4,7 +4,7 @@
|
||||
, input = document.getElementById('input')
|
||||
, listo = document.getElementById('listo')
|
||||
let prev = null
|
||||
let palabras = fetch('palabras.json').then(x => x.json())
|
||||
let word = null;
|
||||
|
||||
;[].forEach.call(
|
||||
document.querySelectorAll('[data-open]'),
|
||||
@@ -60,10 +60,18 @@
|
||||
screen.orientation.lock('landscape')
|
||||
})
|
||||
})
|
||||
document.addEventListener('view-word', e => {
|
||||
// Display the word in the h1
|
||||
const game = document.getElementById('game')
|
||||
game.querySelector('h1').innerText = word
|
||||
})
|
||||
|
||||
input.addEventListener('input', e => {
|
||||
listo.disabled = !input.value.trim()
|
||||
});
|
||||
listo.addEventListener('click', (e) => {
|
||||
word = input.value.trim()
|
||||
});
|
||||
|
||||
|
||||
}());
|
||||
Reference in new issue
Block a user