refactor(calc-02): simplify calculator layout structure
Move the display and button panels into a single wrapper and rely on viewport-height sizing with hidden page overflow to keep the calculator contained. Also trim redundant panel-specific layout rules and styling.
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
html, body {
|
html, body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
|
overflow-y: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@@ -52,62 +53,22 @@ body {
|
|||||||
.calculator {
|
.calculator {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 460px;
|
max-width: 460px;
|
||||||
height: 100%;
|
height: 100vh;
|
||||||
max-height: 100%;
|
max-height: 100vh;
|
||||||
display: grid;
|
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
background: var(--panel);
|
background: var(--panel);
|
||||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
|
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
|
||||||
grid-template-columns: 1fr;
|
|
||||||
grid-template-rows: auto auto auto auto auto;
|
|
||||||
gap: 6px;
|
|
||||||
justify-content: stretch;
|
justify-content: stretch;
|
||||||
align-content: start;
|
align-content: start;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
scrollbar-width: thin;
|
||||||
|
scrollbar-color: rgba(46, 105, 135, 1);
|
||||||
.calculator > .display-block {
|
|
||||||
grid-row: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calculator > .display-buttons-panel {
|
|
||||||
grid-row: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calculator > .keypad-panel {
|
|
||||||
grid-row: 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calculator > .functions-panel {
|
|
||||||
grid-row: 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calculator > .trigo-panel {
|
|
||||||
grid-row: 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.display-buttons-panel,
|
|
||||||
.keypad-panel,
|
|
||||||
.functions-panel,
|
|
||||||
.trigo-panel {
|
|
||||||
align-self: start;
|
|
||||||
justify-self: stretch;
|
|
||||||
}
|
|
||||||
|
|
||||||
.keypad-panel,
|
|
||||||
.functions-panel,
|
|
||||||
.trigo-panel {
|
|
||||||
overflow: auto;
|
|
||||||
min-height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calculator > .trigo-panel {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.display-block,
|
.display-block,
|
||||||
.display-panel,
|
.display-panel,
|
||||||
|
.display-buttons-panel,
|
||||||
.keypad-panel,
|
.keypad-panel,
|
||||||
.functions-panel,
|
.functions-panel,
|
||||||
.trigo-panel {
|
.trigo-panel {
|
||||||
@@ -117,13 +78,6 @@ body {
|
|||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.display-buttons-panel {
|
|
||||||
border-radius: 8px;
|
|
||||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
|
||||||
background: rgba(6, 10, 16, 0.16);
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.display-block {
|
.display-block {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 0;
|
gap: 0;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<main class="app-shell">
|
<main class="app-shell">
|
||||||
<section class="calculator" aria-label="HP48GX style RPN calculator">
|
<section class="calculator" aria-label="HP48GX style RPN calculator">
|
||||||
|
<div>
|
||||||
<div class="display-block">
|
<div class="display-block">
|
||||||
<div class="display-panel">
|
<div class="display-panel">
|
||||||
<div class="status-bar" id="statusLine" aria-live="polite"></div>
|
<div class="status-bar" id="statusLine" aria-live="polite"></div>
|
||||||
@@ -35,6 +36,7 @@
|
|||||||
<button id="rightButton" class="display-button"><span class="display-button-symbol arrow-symbol">→</span></button>
|
<button id="rightButton" class="display-button"><span class="display-button-symbol arrow-symbol">→</span></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="keypad-panel">
|
<div class="keypad-panel">
|
||||||
<div class="keypad-grid" id="keypadGrid"></div>
|
<div class="keypad-grid" id="keypadGrid"></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user