From 5d6fb747d811e20f690c951f88ed303915fe69ee Mon Sep 17 00:00:00 2001 From: Florrie Date: Thu, 17 Jan 2019 11:53:56 -0400 Subject: Only show "Play" once resources are loaded --- index.html | 2 +- main.js | 2 ++ style.css | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index bd0759c..7d5322a 100644 --- a/index.html +++ b/index.html @@ -27,7 +27,7 @@

is a game in which you GUESS THE CHARACTER based on the sound of their speech.

Loading (0%)...

-

Play

+

Play

diff --git a/main.js b/main.js index 97966f5..dc5d398 100644 --- a/main.js +++ b/main.js @@ -287,6 +287,8 @@ async function mainLol() { await loadResources(); + document.body.classList.add('resources-loaded'); + document.body.addEventListener('keydown', evt => { const choiceContainer = document.getElementById('choice-container'); if (!choiceContainer.classList.contains('hide')) { diff --git a/style.css b/style.css index 1c2a35d..c515db3 100644 --- a/style.css +++ b/style.css @@ -42,6 +42,10 @@ body.game #intro { display: none; } +body:not(.resources-loaded) #play-paragraph { + display: none; +} + #crash-trace { text-align: start; border: 1pt dotted white; -- cgit 1.3.0-6-gf8a5