diff --git a/scripts/game/Game.js b/scripts/game/Game.js index 3b3c522..148d2e8 100644 --- a/scripts/game/Game.js +++ b/scripts/game/Game.js @@ -322,16 +322,20 @@ Game.WORDS_HEIGHT_BOTTOM = -1; if(updated) return updated = true + let advanceTextPosition = 0 if(Game.FORCE_TEXT_Y != -1){ Game.wordsDOM.style.transform = `translateY(${Game.FORCE_TEXT_Y}px)`; - return + advanceTextPosition = Game.wordsDOM.clientHeight + Game.FORCE_TEXT_Y + 5 + } else { + const wordsHeight = Game.wordsDOM.clientHeight; + let diff = wordsHeight - (Game.WORDS_HEIGHT_BOTTOM - offset) + if(diff < 0) diff = 0 + Game.wordsDOM.style.transform = `translateY(${offset - diff}px)`; + advanceTextPosition = offset - diff + wordsHeight + 5 } - const wordsHeight = Game.wordsDOM.clientHeight; - let diff = wordsHeight - (Game.WORDS_HEIGHT_BOTTOM - offset) - if(diff < 0) diff = 0 - - Game.wordsDOM.style.transform = `translateY(${offset - diff}px)`; + // Also, move click_to_advance DOM + $('#click_to_advance').style.transform = `translateY(${Math.round(advanceTextPosition)}px)`; } if(Game.wordsDOM.children.length != lastCount){ diff --git a/scripts/game/Options.js b/scripts/game/Options.js index 29f7f57..7dff887 100644 --- a/scripts/game/Options.js +++ b/scripts/game/Options.js @@ -111,11 +111,6 @@ Loader.addSounds([ } } - // Also, move click_to_advance DOM - var wordsTop = parseInt($("#game_words").style.top); - var wordsHeight = $("#game_words").getBoundingClientRect().height; - click_to_advance.style.top = Math.round(wordsTop+wordsHeight+5) + "px"; - }; var _timeoutCallbacks = []; diff --git a/styles/game.css b/styles/game.css index dfe9da7..3886614 100644 --- a/styles/game.css +++ b/styles/game.css @@ -564,7 +564,6 @@ OPTIONS position: absolute; text-align: center; width: 100%; - top: 254px; color:#fff; }