diff --git a/public/script.js b/public/script.js index d263389..f65a4c5 100644 --- a/public/script.js +++ b/public/script.js @@ -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() + }); }()); \ No newline at end of file diff --git a/views/index.html b/views/index.html index f67fd40..7b1a224 100644 --- a/views/index.html +++ b/views/index.html @@ -88,7 +88,12 @@