Finally fix display of long hints
This commit is contained in:
parent
a7310cf59b
commit
04940ff42c
@ -172,7 +172,9 @@
|
|||||||
<p class="-bottom"></p>
|
<p class="-bottom"></p>
|
||||||
<p class="-keyhint"></p>
|
<p class="-keyhint"></p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="player-hint-wrapper">
|
||||||
<div class="player-hint"></div>
|
<div class="player-hint"></div>
|
||||||
|
</div>
|
||||||
<div class="chips">
|
<div class="chips">
|
||||||
<h3>Hearts</h3>
|
<h3>Hearts</h3>
|
||||||
<output></output>
|
<output></output>
|
||||||
|
|||||||
@ -1365,6 +1365,7 @@ class Player extends PrimaryView {
|
|||||||
if (hint_tile !== this.previous_hint_tile) {
|
if (hint_tile !== this.previous_hint_tile) {
|
||||||
this.previous_hint_tile = hint_tile;
|
this.previous_hint_tile = hint_tile;
|
||||||
this.hint_el.textContent = '';
|
this.hint_el.textContent = '';
|
||||||
|
this.hint_el.parentNode.classList.toggle('--visible', !! hint_tile);
|
||||||
if (hint_tile) {
|
if (hint_tile) {
|
||||||
// Parse out %X sequences and replace them with <kbd> elements
|
// Parse out %X sequences and replace them with <kbd> elements
|
||||||
let hint_text = hint_tile.hint_text ?? this.level.stored_level.hint;
|
let hint_text = hint_tile.hint_text ?? this.level.stored_level.hint;
|
||||||
|
|||||||
21
style.css
21
style.css
@ -1101,10 +1101,13 @@ dl.score-chart .-sum {
|
|||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
#player-game-area > .player-hint {
|
/* This has a wrapper because scrollables don't work too well as the direct child of a grid or flex
|
||||||
|
* parent; they really want to expand to their natural size, and I do not want that */
|
||||||
|
#player-game-area > .player-hint-wrapper {
|
||||||
grid-area: hint;
|
grid-area: hint;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
|
|
||||||
|
display: none;
|
||||||
font-size: calc(var(--tile-height) * var(--scale) / 3);
|
font-size: calc(var(--tile-height) * var(--scale) / 3);
|
||||||
padding: 0.25em 0.5em;
|
padding: 0.25em 0.5em;
|
||||||
font-family: serif;
|
font-family: serif;
|
||||||
@ -1112,12 +1115,16 @@ dl.score-chart .-sum {
|
|||||||
color: hsl(45, 100%, 60%);
|
color: hsl(45, 100%, 60%);
|
||||||
background: #080808;
|
background: #080808;
|
||||||
border: 1px inset #202020;
|
border: 1px inset #202020;
|
||||||
|
|
||||||
/* FIXME find a way to enforce that the hint never makes the grid get bigger */
|
|
||||||
overflow: auto;
|
|
||||||
}
|
}
|
||||||
#player-game-area > .player-hint:empty {
|
#player-game-area > .player-hint-wrapper > .player-hint {
|
||||||
display: none;
|
overflow: auto;
|
||||||
|
/* Set our inherent height or whatever to zero, but then force us to expand to whatever size our
|
||||||
|
* parent happens to be. Magic! */
|
||||||
|
height: 0;
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
|
#player-game-area > .player-hint-wrapper.--visible {
|
||||||
|
display: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
#player .inventory {
|
#player .inventory {
|
||||||
@ -1424,7 +1431,7 @@ body.--debug #player-debug {
|
|||||||
/* stick me in the center right */
|
/* stick me in the center right */
|
||||||
place-self: center end;
|
place-self: center end;
|
||||||
}
|
}
|
||||||
#player > .player-hint {
|
#player-game-area > .player-hint-wrapper {
|
||||||
/* Overlay hints on the inventory area */
|
/* Overlay hints on the inventory area */
|
||||||
grid-row: chips / bonus;
|
grid-row: chips / bonus;
|
||||||
grid-column: level;
|
grid-column: level;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user