refactor(samples/calc-02): simplify layout to portrait-only single column
Remove the responsive two-column desktop arrangement and make the calculator stack vertically with a 4-column display button row that preserves alignment. Also align the display buttons with the shared base button styling.
This commit is contained in:
+10
-79
@@ -51,23 +51,23 @@ body {
|
||||
|
||||
.calculator {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
height: auto;
|
||||
min-height: 100%;
|
||||
display: grid;
|
||||
padding: 8px;
|
||||
border-radius: 8px;
|
||||
background: linear-gradient(180deg, var(--panel2), var(--panel));
|
||||
border: 1px solid var(--edge);
|
||||
box-shadow: 0 26px 70px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
|
||||
grid-template-columns: 1.3fr 0.9fr;
|
||||
grid-template-rows: minmax(0, 0.62fr) min-content minmax(180px, 1fr) minmax(180px, 1fr);
|
||||
align-content: start;
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-rows: auto auto auto auto auto;
|
||||
row-gap: 6px;
|
||||
grid-template-areas:
|
||||
"display functions"
|
||||
"display functions"
|
||||
"keypad functions"
|
||||
"keypad trigo";
|
||||
row-gap: 0;
|
||||
column-gap: clamp(10px, 1.4vw, 18px);
|
||||
"display"
|
||||
"display-buttons"
|
||||
"keypad"
|
||||
"functions"
|
||||
"trigo";
|
||||
}
|
||||
|
||||
.display-block,
|
||||
@@ -113,7 +113,6 @@ body {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
.display-grid {
|
||||
height: 100%;
|
||||
display: grid;
|
||||
@@ -188,7 +187,6 @@ body {
|
||||
border-radius: 8px;
|
||||
background: rgba(18, 24, 33, 0.98);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
|
||||
box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
@@ -368,7 +366,6 @@ button:active {
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
|
||||
.key-default {
|
||||
background: linear-gradient(180deg, var(--btnTop), var(--btnBottom));
|
||||
color: #eef2f7;
|
||||
@@ -403,70 +400,4 @@ button:active {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@media (orientation: portrait), (max-width: 860px) {
|
||||
.calculator {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
min-height: 100%;
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-rows: minmax(0px, auto) auto auto auto;
|
||||
row-gap: 6px;
|
||||
grid-template-areas:
|
||||
"display"
|
||||
"display-buttons"
|
||||
"keypad"
|
||||
"functions"
|
||||
"trigo";
|
||||
}
|
||||
|
||||
.display-buttons-grid {
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.keypad-grid {
|
||||
grid-template-rows: repeat(5, minmax(42px, 1fr));
|
||||
}
|
||||
|
||||
.functions-grid,
|
||||
.trigo-grid {
|
||||
grid-auto-rows: minmax(0, auto);
|
||||
grid-template-rows: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 520px) {
|
||||
.app-shell {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.calculator {
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
border-radius: 8px;
|
||||
padding: 8px;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.display-panel {
|
||||
padding: 8px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
.stack-cell {
|
||||
font-size: clamp(16px, 5.2vw, 22px);
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.stack-copy-button {
|
||||
padding: 4px;
|
||||
min-width: 24px;
|
||||
}
|
||||
|
||||
button {
|
||||
border-radius: 8px;
|
||||
padding: 10px 8px;
|
||||
font-size: 13px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user