🛩🎮 Checkpoint

./views/index.html:1954897/9147
./public/script.js:1954897/4664
This commit is contained in:
Glitch (tabu) committed 2019-07-01 13:43:06 +00:00
1 parent db3967858c
commit 46f99808c1
2 files changed
+15 -2

No files matched your search

+9 -1
View File
@@ -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()
});
}());
+6 -1
View File
@@ -88,7 +88,12 @@
</div>
<div class="container middle" id="view5" hidden>
<div class="alt">Mi palabra prohibida es...</div>
<h1 class="center" style="font-size: 22px">nerd</h1>
<h1 class="center" style="font-size: 4rem;"></h1>
<div class="alt center"></div>
<button class="btn" data-open="main"
style="position: fixed; right: 1rem; bottom: 1rem;">
¡Se acabó!
</button>
</div>
</body>
<script src="./script.js" charset="utf-8"></script>