Skip to content

Commit

Permalink
Improve layouting
Browse files Browse the repository at this point in the history
* chat / players dont require JS set max heights anymore
* chat messages have more space in non-mobile portrait layout
  • Loading branch information
Bios-Marcel committed Oct 19, 2024
1 parent 06ec42f commit db68899
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
16 changes: 12 additions & 4 deletions internal/frontend/resources/lobby.css
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ kbd {
grid-column: 3;
grid-row-start: 2;
grid-row-end: 3;
height: 0;
min-height: 100%;
}

#message-container {
Expand Down Expand Up @@ -483,6 +485,8 @@ kbd {
grid-column: 1;
grid-row: 2;
overflow-y: auto;
height: 0;
min-height: 100%;
}

.player {
Expand Down Expand Up @@ -654,6 +658,10 @@ kbd {
width: 32px;
height: 32px;
}

#message-container {
max-height: 5rem;
}
}


Expand Down Expand Up @@ -712,15 +720,15 @@ kbd {
#player-container {
grid-column: 1;
grid-row: 4;
height: auto;
min-height: auto;
}

#chat {
grid-column: 2;
grid-row: 4;
}

#message-container {
max-height: 5rem;
height: auto;
min-height: auto;
}
}

Expand Down
12 changes: 0 additions & 12 deletions internal/frontend/templates/lobby.html
Original file line number Diff line number Diff line change
Expand Up @@ -1910,18 +1910,6 @@
drawingBoard.height = drawingBoard.clientHeight;
setLineWidth(localLineWidthUnscaled);

//Ugly workaround to fix https://github.com/scribble-rs/scribble.rs/issues/256
//Sadly I don't know how to do this with CSS.
//I've had the same workaround a while ago, but deleted it thinking it
//wasn't needed anymore, however, without this, the chat container will expand
//it's own parent, causing overflow-y to not take effect, since the parent has
//no height constraint.
//FIXME This isn't optimal for the portrait view. However, the chatview
//already has a custom max-height in that mode anyway. For the player list
//it is a worthwhile trade-off for now.
chat.style.maxHeight = drawingBoard.clientHeight + "px";
playerContainer.style.maxHeight = drawingBoard.clientHeight + "px";

return true;
}

Expand Down

0 comments on commit db68899

Please sign in to comment.