From 46f99808c1b5127d3527468ac032cca512867d44 Mon Sep 17 00:00:00 2001 From: "Glitch (tabu)" Date: Mon, 1 Jul 2019 13:43:06 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A9=F0=9F=8E=AE=20Checkpoint=20./views?= =?UTF-8?q?/index.html:1954897/9147=20./public/script.js:1954897/4664?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/script.js | 10 +++++++++- views/index.html | 7 ++++++- 2 files changed, 15 insertions(+), 2 deletions(-) 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 @@