Make entire UI mobile-friendly with responsive breakpoints

Add media queries at 480px/768px across all components: single-column
dashboard cards on phones, progressive table column hiding, smaller
typography, reduced padding, full-width toggle buttons, and compact
header. Desktop layout unchanged.
This commit is contained in:
satoshi
2026-05-19 03:40:59 +03:00
parent e341fd7b26
commit 3f700f8982
12 changed files with 180 additions and 0 deletions
+6
View File
@@ -93,6 +93,12 @@
flex-direction: column; flex-direction: column;
gap: 1.25rem; gap: 1.25rem;
} }
@media (max-width: 480px) {
main {
padding: 1rem 0.6rem 3rem;
gap: 1rem;
}
}
main::before { main::before {
content: ''; content: '';
position: fixed; position: fixed;
+28
View File
@@ -98,6 +98,34 @@ code,
grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
} }
/* ── Mobile breakpoints ── */
@media (max-width: 480px) {
:root {
font-size: 13px;
}
.card {
padding: 1rem 1rem;
}
.grid-4 {
grid-template-columns: 1fr 1fr;
}
.grid-2 {
grid-template-columns: 1fr;
}
.stat-value {
font-size: 1.4rem;
}
th, td {
padding: 0.4rem 0.5rem;
font-size: 0.9em;
}
}
@media (max-width: 360px) {
.grid-4 {
grid-template-columns: 1fr;
}
}
.stat-label { .stat-label {
color: var(--fg-dim); color: var(--fg-dim);
font-size: 0.82em; font-size: 0.82em;
+22
View File
@@ -572,4 +572,26 @@
.swatch.have { background: var(--good); } .swatch.have { background: var(--good); }
.swatch.need { background: rgb(245, 196, 71); } .swatch.need { background: rgb(245, 196, 71); }
.swatch.rest { background: var(--fg); } .swatch.rest { background: var(--fg); }
@media (max-width: 480px) {
.toggle-bar {
width: 100%;
}
.toggle-btn {
flex: 1;
text-align: center;
font-size: 0.78rem;
padding: 0.5em 0.5em;
}
.hash-vis {
font-size: 0.75rem;
letter-spacing: 0.01em;
}
.hash-vis.binary {
font-size: 0.6rem;
}
.totals {
grid-template-columns: 1fr;
}
}
</style> </style>
+14
View File
@@ -69,4 +69,18 @@
color: var(--fg-dim); color: var(--fg-dim);
padding: 0.5rem 0; padding: 0.5rem 0;
} }
/* Mobile: hide session best column, truncate worker names */
@media (max-width: 480px) {
table :global(th:nth-child(3)),
table :global(td:nth-child(3)) {
display: none;
}
td.mono {
max-width: 140px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
</style> </style>
+18
View File
@@ -194,4 +194,22 @@
font-weight: 400; font-weight: 400;
margin-left: 0.25em; margin-left: 0.25em;
} }
/* Mobile: hide Chain, Hash, Reward columns */
@media (max-width: 768px) {
table :global(th:nth-child(3)),
table :global(td:nth-child(3)),
table :global(th:nth-child(4)),
table :global(td:nth-child(4)) {
display: none;
}
}
@media (max-width: 480px) {
table :global(th:nth-child(5)),
table :global(td:nth-child(5)),
table :global(th:nth-child(6)),
table :global(td:nth-child(6)) {
display: none;
}
}
</style> </style>
+13
View File
@@ -119,4 +119,17 @@
.ws-label { .ws-label {
text-transform: lowercase; text-transform: lowercase;
} }
@media (max-width: 480px) {
.brand {
font-size: 1.05rem;
gap: 0.4rem;
}
.name {
display: none;
}
.meta {
font-size: 0.8rem;
}
}
</style> </style>
+24
View File
@@ -278,4 +278,28 @@
tr.idle td { tr.idle td {
color: var(--fg-dim); color: var(--fg-dim);
} }
/* Mobile: hide less critical columns */
@media (max-width: 768px) {
table :global(th:nth-child(2)),
table :global(td:nth-child(2)),
table :global(th:nth-child(5)),
table :global(td:nth-child(5)),
table :global(th:nth-child(6)),
table :global(td:nth-child(6)) {
display: none;
}
}
@media (max-width: 480px) {
table :global(th:nth-child(4)),
table :global(td:nth-child(4)),
table :global(th:nth-child(7)),
table :global(td:nth-child(7)) {
display: none;
}
.section-head {
flex-direction: column;
gap: 0.25em;
}
}
</style> </style>
+6
View File
@@ -272,6 +272,12 @@
grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-columns: repeat(2, minmax(0, 1fr));
} }
} }
@media (max-width: 480px) {
.grid-5 {
grid-template-columns: 1fr;
gap: 0.75rem;
}
}
.retarget-bar { .retarget-bar {
height: 4px; height: 4px;
+14
View File
@@ -285,4 +285,18 @@
height: 1px; height: 1px;
} }
} }
@media (max-width: 480px) {
.shares-bar {
padding: 0.8rem 1rem;
}
.accepted, .rejected {
font-size: 1.15rem;
}
.pct {
font-size: 0.88rem;
}
.group {
flex-wrap: wrap;
}
}
</style> </style>
+3
View File
@@ -269,6 +269,9 @@
.totals { grid-template-columns: repeat(2, minmax(0, 1fr)); } .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
} }
@media (max-width: 520px) { @media (max-width: 520px) {
.totals { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 360px) {
.totals { grid-template-columns: 1fr; } .totals { grid-template-columns: 1fr; }
} }
+23
View File
@@ -435,4 +435,27 @@
tr.idle td { tr.idle td {
color: var(--fg-dim); color: var(--fg-dim);
} }
/* Mobile: hide Hardware, Status, Diff, Best(session) columns */
@media (max-width: 768px) {
table :global(th:nth-child(2)),
table :global(td:nth-child(2)),
table :global(th:nth-child(3)),
table :global(td:nth-child(3)),
table :global(th:nth-child(6)),
table :global(td:nth-child(6)) {
display: none;
}
}
@media (max-width: 480px) {
table :global(th:nth-child(5)),
table :global(td:nth-child(5)),
table :global(th:nth-child(7)),
table :global(td:nth-child(7)) {
display: none;
}
.addr {
font-size: 1rem;
}
}
</style> </style>
+9
View File
@@ -351,4 +351,13 @@
font-size: 0.85rem; font-size: 0.85rem;
word-break: break-all; word-break: break-all;
} }
@media (max-width: 480px) {
.wname {
font-size: 1rem;
}
.detail-grid {
grid-template-columns: 1fr 1fr;
}
}
</style> </style>