Fix visibility of the help overlay

This commit is contained in:
Sergey Stepanov 2022-04-18 19:13:26 +03:00
parent 9b2e41ff86
commit ed60ccf41e
No known key found for this signature in database
GPG key ID: A56B4929BAA8556B
5 changed files with 8 additions and 9 deletions

View file

@ -49,7 +49,6 @@ body {
#help-overlay {
width: 100%;
height: 100%;
display: none;
position: absolute;
top: 0;
}
@ -66,7 +65,6 @@ body {
#help-overlay-detail {
width: 100%;
height: 100%;
display: block;
position: absolute;
background-image: url('/static/img/help_overlay.png');

View file

@ -1,6 +1,6 @@
.hidden {
display: none;
visibility: hidden;
}
.modal-window {

View file

@ -84,9 +84,9 @@
<div id="noti-box" class="unselectable">Oh my god</div>
<div id="help-overlay">
<div id="help-overlay-background"></div>
<div id="help-overlay-detail"></div>
<div id="help-overlay" class="hidden">
<div id="help-overlay-background" class="hidden"></div>
<div id="help-overlay-detail" class="hidden"></div>
</div>
<div id="btn-help" class="btn unselectable" value="help"></div>
{{if .Recording.Enabled}}

View file

@ -97,7 +97,8 @@
gui.toggle(keyButtons[KEY.SAVE], show || isGameScreen);
gui.toggle(keyButtons[KEY.LOAD], show || isGameScreen);
gui.toggle(helpOverlay, show);
gui.toggle(helpOverlay, show)
Array.from(helpOverlay.children).forEach((node) => gui.toggle(node, show))
this.shown = show;

View file

@ -141,11 +141,11 @@ const gui = (() => {
}
const show = (el) => {
el.style.removeProperty('visibility');
el.classList.remove('hidden');
}
const hide = (el) => {
el.style.visibility = 'hidden';
el.classList.add('hidden');
}
const toggle = (el, what) => {