From 74a93877b9e17b22b16d8ae76f94a912696e1303 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Sat, 4 Apr 2026 19:39:08 +1100 Subject: [PATCH] fix: Cleanup mobile --- templates/assets/css/index.css | 112 ++++++++++++++++++- templates/index.html | 189 +++++++++++++++++++-------------- 2 files changed, 221 insertions(+), 80 deletions(-) diff --git a/templates/assets/css/index.css b/templates/assets/css/index.css index 163177f..d391104 100644 --- a/templates/assets/css/index.css +++ b/templates/assets/css/index.css @@ -161,6 +161,20 @@ h1 { font-size: 13px; } + +.mobile-accordion summary { + display: none; +} + +.mobile-accordion .accordion-content { + margin-top: 0; +} + + +.stats-accordion .stats-grid { + margin-bottom: 0; +} + .search-row { display: flex; gap: 8px; @@ -288,6 +302,14 @@ th { } @media (max-width: 720px) { + .layout { + padding: 14px 10px 24px; + } + + .hero { + margin-bottom: 12px; + } + .search-row { flex-direction: column; } @@ -299,12 +321,94 @@ th { .stats-grid, .stats-grid.compact { grid-template-columns: 1fr 1fr; + gap: 8px; + margin-bottom: 10px; + } + + .stat-card { + padding: 8px 9px; + } + + .stat-card strong { + font-size: 17px; + } + + .panel { + margin-bottom: 10px; + padding: 9px; + } + + .mobile-accordion { + padding: 0; + overflow: hidden; + } + + .mobile-accordion summary { + display: flex; + justify-content: space-between; + align-items: center; + cursor: pointer; + list-style: none; + padding: 10px 12px; + font-weight: 700; + color: var(--accent); + border-bottom: 1px solid rgba(255, 107, 53, 0.2); + background: rgba(0, 0, 0, 0.14); + } + + .mobile-accordion summary::marker, + .mobile-accordion summary::-webkit-details-marker { + display: none; + } + + .mobile-accordion summary::after { + content: "+"; + font-size: 18px; + line-height: 1; + } + + .mobile-accordion[open] summary::after { + content: "-"; + } + + .mobile-accordion .accordion-content { + padding: 9px; + } + + .mobile-accordion .panel-head { + display: none; + } + + .stats-accordion .accordion-content { + padding: 7px; + } + + .stats-accordion .stats-grid { + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 6px; + } + + .stats-accordion .stat-card { + padding: 6px 7px; + border-radius: 10px; + } + + .stats-accordion .stat-card span { + font-size: 10px; + } + + .stats-accordion .stat-card strong { + font-size: 13px; } } @media (max-width: 620px) { h1 { - font-size: clamp(26px, 8vw, 36px); + font-size: clamp(24px, 8vw, 32px); + } + + .subtitle { + font-size: 13px; } .stats-grid, @@ -312,8 +416,12 @@ th { grid-template-columns: 1fr; } + .stats-accordion .stats-grid { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + .panel { - padding: 10px; + padding: 8px; } .table-wrap { diff --git a/templates/index.html b/templates/index.html index 627157c..6085f69 100644 --- a/templates/index.html +++ b/templates/index.html @@ -37,7 +37,16 @@ -
+
+ Pool Stats +
+
+

Pool Stats

+

Live network and reward snapshot

+
+
+
+
@@ -52,89 +61,101 @@
-
-
-

Workers

-

Pool workers

+
+ Workers +
+
+

Workers

+

Pool workers

+
+
+ + + + + + + + + + + + + +
UsernameHashrateAcceptedRejectedStaleBlocksEst. Daily (FBC)
+
-
- - - - - - - - - - - - - -
UsernameHashrateAcceptedRejectedStaleBlocksEst. Daily (FBC)
-
-
+ -
-
-

Blocks

-

Recent block history

+
+ Blocks +
+
+

Blocks

+

Recent block history

+
+
+ + + + + + + + + + + + +
HeightStatusReward (FBC)Found ByConfirmationsTime
+
-
- - - - - - - - - - - - -
HeightStatusReward (FBC)Found ByConfirmationsTime
-
-
+ -
-
-

Balances

+
+ Balances +
+
+

Balances

+
+
+ + + + + + + + + + +
AddressBalance (FBC)Total Earned (FBC)Total Paid (FBC)
+
-
- - - - - - - - - - -
AddressBalance (FBC)Total Earned (FBC)Total Paid (FBC)
-
-
+ -
-
-

Payouts

+
+ Payouts +
+
+

Payouts

+
+
+ + + + + + + + + + + +
AddressAmount (FBC)StatusTXIDTime
+
-
- - - - - - - - - - - -
AddressAmount (FBC)StatusTXIDTime
-
-
+
@@ -144,7 +165,7 @@ Open Miner Setup Guide
@@ -211,6 +232,17 @@ stamp.textContent = `Last update: ${new Date().toLocaleString()}`; } + + function initMobileAccordions() { + const accordions = document.querySelectorAll('.mobile-accordion'); + if (!accordions.length) return; + + const isCompact = window.matchMedia('(max-width: 720px)').matches; + accordions.forEach((accordion, idx) => { + accordion.open = !isCompact || idx === 0; + }); + } + async function loadOverview() { const res = await fetch("/api/v1/pool/overview"); if (!res.ok) { @@ -424,6 +456,7 @@ } }); + initMobileAccordions(); refreshAll(); setInterval(refreshAll, refreshMs);