mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-10-18 14:51:26 +02:00
On phones the dungeon canvas was letterboxed: the game grid row was 1fr and got squeezed by the status bar + chat, so the 800x608 canvas scaled to that short height and rendered narrow with black side bars. Drive the game area by width instead — full-width box with the canvas's own aspect ratio (auto height) — and hand the leftover vertical space to chat (now 1fr, max-height cap removed) so it's roomier too.
417 lines
9.7 KiB
CSS
417 lines
9.7 KiB
CSS
/* Font declarations */
|
|
@font-face {
|
|
font-family: 'PixelOperator';
|
|
src: url('fonts/pixel-operator/PixelOperator.ttf') format('truetype');
|
|
font-weight: normal;
|
|
font-style: normal;
|
|
}
|
|
|
|
@font-face {
|
|
font-family: 'PixelOperator';
|
|
src: url('fonts/pixel-operator/PixelOperator-Bold.ttf') format('truetype');
|
|
font-weight: bold;
|
|
font-style: normal;
|
|
}
|
|
|
|
/* Updated layout with 5-row structure */
|
|
.container {
|
|
display: grid;
|
|
grid-template-areas:
|
|
"header header header"
|
|
"status game game"
|
|
"chat game game"
|
|
"input input input"
|
|
"footer footer footer";
|
|
grid-template-columns: 350px 1fr 1fr;
|
|
grid-template-rows: auto auto 1fr auto auto;
|
|
height: 100vh;
|
|
width: 100%;
|
|
max-width: 100vw;
|
|
overflow: hidden;
|
|
gap: 1px;
|
|
background-color: #222;
|
|
}
|
|
|
|
/* Header area */
|
|
.banner {
|
|
grid-area: header;
|
|
background-color: #111;
|
|
padding: 5px;
|
|
color: white;
|
|
text-align: left;
|
|
border-bottom: 1px solid #444;
|
|
font-family: 'PixelOperator', monospace;
|
|
font-weight: bold;
|
|
font-size: 24px;
|
|
letter-spacing: 1px;
|
|
}
|
|
|
|
/* Status area for block height display */
|
|
.status {
|
|
grid-area: status;
|
|
background-color: #222;
|
|
padding: 10px;
|
|
color: #0f0;
|
|
font-family: monospace;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: flex-start;
|
|
border-right: 1px solid #444;
|
|
}
|
|
|
|
/* Make sure rotdis is properly visible across all browsers */
|
|
.rotdis {
|
|
grid-area: game;
|
|
background-color: #000;
|
|
border: 2px solid #444;
|
|
display: flex !important; /* Using flex to center canvas */
|
|
justify-content: center;
|
|
align-items: center;
|
|
/* min-height: 608px; */ /* REMOVED to allow shrinking */
|
|
width: 100%; /* Ensure it takes full width of its grid area */
|
|
height: 100%; /* Ensure it takes full height of its grid area */
|
|
position: relative;
|
|
overflow: hidden; /* Important to clip canvas if it somehow overflows */
|
|
z-index: 5;
|
|
}
|
|
|
|
.rotdis canvas {
|
|
display: block !important;
|
|
image-rendering: pixelated;
|
|
image-rendering: -moz-crisp-edges;
|
|
image-rendering: crisp-edges;
|
|
max-width: 100%; /* ADDED: Scale down to fit container width */
|
|
max-height: 100%; /* ADDED: Scale down to fit container height */
|
|
object-fit: contain; /* ADDED: Maintain aspect ratio when scaling */
|
|
}
|
|
|
|
/* Add debug overlay to see container bounds */
|
|
/* Chat messages area */
|
|
.chat-container {
|
|
grid-area: chat;
|
|
background-color: #222;
|
|
display: flex;
|
|
flex-direction: column;
|
|
border-right: 1px solid #444;
|
|
overflow: hidden; /* Prevents chat from causing scrolling */
|
|
}
|
|
|
|
#messageBox {
|
|
flex-grow: 1;
|
|
overflow-y: auto;
|
|
padding: 10px;
|
|
height: 100%;
|
|
max-height: 100%;
|
|
}
|
|
|
|
#messages {
|
|
list-style-type: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
color: #fff; /* Default text color */;
|
|
}
|
|
|
|
#messages li {
|
|
padding: 3px 5px;
|
|
margin-bottom: 2px;
|
|
word-break: break-word;
|
|
}
|
|
|
|
/* Chat input area, now in its own row */
|
|
.input-container {
|
|
grid-area: input;
|
|
background-color: #333;
|
|
padding: 10px;
|
|
border-top: 1px solid #444;
|
|
border-bottom: 1px solid #444;
|
|
}
|
|
|
|
#chatForm {
|
|
display: flex;
|
|
width: 100%;
|
|
}
|
|
|
|
#chatInput {
|
|
flex-grow: 1;
|
|
padding: 8px;
|
|
border: none;
|
|
background-color: #444;
|
|
color: #fff;
|
|
border-radius: 3px 0 0 3px;
|
|
}
|
|
|
|
#chatForm button {
|
|
padding: 0 20px;
|
|
background-color: #555;
|
|
color: white;
|
|
border: none;
|
|
cursor: pointer;
|
|
border-radius: 0 3px 3px 0;
|
|
}
|
|
|
|
/* Add this to your stylesheet to use the font in other places */
|
|
#staticbanner {
|
|
font-family: 'PixelOperator', monospace;
|
|
font-weight: bold;
|
|
letter-spacing: 1px;
|
|
padding: 10px;
|
|
}
|
|
|
|
.footer {
|
|
grid-area: footer;
|
|
background-color: #111;
|
|
color: #888;
|
|
padding: 5px;
|
|
text-align: center;
|
|
font-size: 0.8em;
|
|
font-family: 'PixelOperator', sans-serif;
|
|
}
|
|
|
|
/* Game messages styling */
|
|
li.game-start {
|
|
color: #0f0;
|
|
font-weight: bold;
|
|
text-align: center;
|
|
margin: 5px 0;
|
|
padding: 2px 0;
|
|
background: rgba(0,255,0,0.1);
|
|
}
|
|
|
|
li.error {
|
|
color: #f00;
|
|
font-weight: bold;
|
|
font-family: monospace;
|
|
padding: 2px 5px;
|
|
background: rgba(255,0,0,0.1);
|
|
border-left: 2px solid #f00;
|
|
}
|
|
|
|
li.debug {
|
|
color: #0ff;
|
|
font-family: monospace;
|
|
font-size: 0.9em;
|
|
padding-left: 10px;
|
|
border-left: 2px solid #0ff;
|
|
}
|
|
|
|
/* Utility */
|
|
.hidden {
|
|
display: none !important;
|
|
}
|
|
|
|
/* Modal styling */
|
|
.modal-overlay {
|
|
position: fixed;
|
|
inset: 0;
|
|
background: rgba(0, 0, 0, 0.85);
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
z-index: 10000;
|
|
padding: 20px;
|
|
}
|
|
|
|
.modal-content {
|
|
background: #0a0a0f;
|
|
border: 2px solid #0ff;
|
|
border-radius: 6px;
|
|
width: min(480px, 90vw);
|
|
padding: 20px;
|
|
color: #0ff;
|
|
font-family: 'PixelOperator', monospace;
|
|
position: relative;
|
|
box-shadow: 0 0 18px rgba(0, 255, 255, 0.2);
|
|
}
|
|
|
|
.modal-content h2 {
|
|
margin-top: 0;
|
|
margin-bottom: 8px;
|
|
font-size: 20px;
|
|
}
|
|
|
|
.modal-description {
|
|
margin-top: 0;
|
|
margin-bottom: 16px;
|
|
font-size: 12px;
|
|
color: #9cf;
|
|
}
|
|
|
|
.modal-label {
|
|
display: block;
|
|
margin-bottom: 6px;
|
|
font-size: 12px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
}
|
|
|
|
#addressModalInput {
|
|
width: 100%;
|
|
background: #020205;
|
|
border: 1px solid #0ff;
|
|
border-radius: 4px;
|
|
color: #0ff;
|
|
padding: 10px;
|
|
font-family: monospace;
|
|
resize: vertical;
|
|
min-height: 100px;
|
|
box-shadow: inset 0 0 6px rgba(0, 255, 255, 0.15);
|
|
}
|
|
|
|
.modal-actions {
|
|
margin-top: 16px;
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
gap: 12px;
|
|
}
|
|
|
|
.modal-actions button {
|
|
padding: 8px 16px;
|
|
border-radius: 4px;
|
|
border: 1px solid #0ff;
|
|
background: #031c28;
|
|
color: #0ff;
|
|
cursor: pointer;
|
|
font-family: inherit;
|
|
}
|
|
|
|
.modal-actions button#addressModalSave {
|
|
background: #013d2a;
|
|
border-color: #0f7;
|
|
color: #0f7;
|
|
}
|
|
|
|
.modal-actions button:hover {
|
|
box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
|
|
}
|
|
|
|
.modal-close {
|
|
position: absolute;
|
|
top: 8px;
|
|
right: 10px;
|
|
background: transparent;
|
|
border: none;
|
|
color: #0ff;
|
|
font-size: 18px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.modal-feedback {
|
|
margin-top: 12px;
|
|
font-size: 12px;
|
|
min-height: 16px;
|
|
}
|
|
|
|
.modal-feedback.error {
|
|
color: #ff6b6b;
|
|
}
|
|
|
|
.modal-feedback.success {
|
|
color: #5dff9c;
|
|
}
|
|
|
|
.modal-feedback.info {
|
|
color: #9cf6ff;
|
|
}
|
|
|
|
|
|
/* =========================================================================
|
|
Mobile / touch support
|
|
========================================================================= */
|
|
#touch-dpad { display: none; }
|
|
|
|
@media (max-width: 820px) {
|
|
/* Stack the desktop 3-column grid into a single column.
|
|
Rows: header / status / game / CHAT(flex) / input / footer.
|
|
The game row is `auto` (sized by the canvas's own aspect ratio at full width)
|
|
and the CHAT row takes the leftover space (1fr) instead — so the play area fills
|
|
the screen width and chat gets whatever height remains. */
|
|
.container {
|
|
grid-template-areas:
|
|
"header"
|
|
"status"
|
|
"game"
|
|
"chat"
|
|
"input"
|
|
"footer";
|
|
grid-template-columns: 1fr;
|
|
grid-template-rows: auto auto auto 1fr auto auto;
|
|
height: 100vh;
|
|
height: 100dvh; /* exclude mobile browser chrome where supported */
|
|
}
|
|
|
|
/* Game area: full width, height follows the 800x608 (25x19 tile) canvas ratio.
|
|
This makes the dungeon fill the screen width instead of being letterboxed by a
|
|
short, height-constrained grid row. The canvas fills the box exactly. */
|
|
.rotdis {
|
|
grid-area: game;
|
|
width: 100%;
|
|
aspect-ratio: 800 / 608;
|
|
height: auto;
|
|
min-height: 0;
|
|
box-sizing: border-box;
|
|
border-width: 1px;
|
|
}
|
|
.rotdis canvas {
|
|
width: 100% !important;
|
|
height: 100% !important;
|
|
}
|
|
|
|
.banner { font-size: 16px; padding: 4px 6px; }
|
|
#staticbanner { font-size: 15px !important; }
|
|
.status {
|
|
border-right: none;
|
|
border-bottom: 1px solid #444;
|
|
flex-direction: row;
|
|
flex-wrap: wrap;
|
|
gap: 4px 14px;
|
|
padding: 6px 8px;
|
|
font-size: 12px;
|
|
}
|
|
/* Chat fills the leftover vertical space and scrolls internally. */
|
|
.chat-container { min-height: 0; }
|
|
#messageBox { max-height: none; height: 100%; }
|
|
.footer { font-size: 9px; padding: 2px 4px; line-height: 1.3; }
|
|
|
|
/* Fixed-width modals would overflow tiny screens — make them fit */
|
|
#payment-ui, #history-panel, #leaderboard-panel {
|
|
min-width: 0 !important;
|
|
width: 94vw !important;
|
|
max-width: 94vw !important;
|
|
max-height: 88vh !important;
|
|
overflow-y: auto !important;
|
|
padding: 14px !important;
|
|
}
|
|
|
|
}
|
|
|
|
/* On-screen D-pad — styling defined unconditionally; shown on small screens (media query
|
|
above) OR any touch device (body.touch set by touchControls.js for landscape/tablets). */
|
|
@media (max-width: 820px) { #touch-dpad { display: grid; } }
|
|
body.touch #touch-dpad { display: grid; }
|
|
#touch-dpad {
|
|
grid-template-areas: ". up ." "left . right" ". down .";
|
|
gap: 8px;
|
|
position: fixed;
|
|
right: 12px;
|
|
bottom: 70px;
|
|
z-index: 1500;
|
|
opacity: 0.55;
|
|
touch-action: none;
|
|
}
|
|
#touch-dpad button {
|
|
width: 54px; height: 54px;
|
|
font-size: 22px;
|
|
background: rgba(0,40,0,0.85);
|
|
color: #0f0;
|
|
border: 2px solid #0f0;
|
|
border-radius: 10px;
|
|
padding: 0;
|
|
-webkit-user-select: none; user-select: none;
|
|
touch-action: manipulation;
|
|
}
|
|
#touch-dpad button:active { background: #0f0; color: #000; }
|
|
#dpad-up { grid-area: up; }
|
|
#dpad-down { grid-area: down; }
|
|
#dpad-left { grid-area: left; }
|
|
#dpad-right { grid-area: right; }
|