Skip to content

Commit e53a1b3

Browse files
committed
fix: mantis.html backtest section mobile rendering
- SVG donut: add preserveAspectRatio + display:block + width/height:100%!important so it scales cleanly at all container sizes instead of clipping - pnl-table headers: dual th-long/th-short spans — on ≤640px shows "Cons. / Target / Stretch" instead of full text, eliminates need for min-width scroll - pnl-table mobile: remove min-width:0, compact cell padding (8-12px), smaller font - win-rate-wrap at 768px: row layout so donut + stats sit side-by-side - win-rate-wrap at 640px: revert to column, full-width win-stats - ws-item: reduced padding at 640px, ws-val font-size to 17px - donut-pct: 28px at 640px, 24px at 400px for tight containers - cat-bars: tighter gap (14px) at 400px - pnl-table-wrap margin-top: 60px → 40px on mobile
1 parent a250352 commit e53a1b3

1 file changed

Lines changed: 28 additions & 10 deletions

File tree

mantis.html

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@
198198
#backtest{background:var(--bg)}
199199
.backtest-grid{display:grid;grid-template-columns:1fr 2fr;gap:40px;align-items:start}
200200
.win-rate-wrap{display:flex;flex-direction:column;align-items:center;gap:20px}
201-
.win-donut{position:relative;width:220px;height:220px}
202-
.win-donut svg{transform:rotate(-90deg)}
201+
.win-donut{position:relative;width:220px;height:220px;flex-shrink:0}
202+
.win-donut svg{display:block;transform:rotate(-90deg);width:100%!important;height:100%!important}
203203
.donut-track{fill:none;stroke:rgba(255,255,255,.06);stroke-width:16}
204204
.donut-fill{fill:none;stroke:url(#donutGrad);stroke-width:16;stroke-linecap:round;stroke-dasharray:566;stroke-dashoffset:566;transition:stroke-dashoffset 2s cubic-bezier(.4,0,.2,1)}
205205
.donut-center{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}
@@ -221,8 +221,9 @@
221221

222222
/* P&L Table */
223223
.pnl-table-wrap{margin-top:60px}
224+
.th-short{display:none}
224225
.pnl-table{width:100%;border-collapse:collapse}
225-
.pnl-table th{font-family:'JetBrains Mono',monospace;font-size:11px;color:var(--muted);letter-spacing:.12em;text-transform:uppercase;padding:12px 20px;text-align:left;border-bottom:1px solid var(--border)}
226+
.pnl-table th{font-family:'JetBrains Mono',monospace;font-size:11px;color:var(--muted);letter-spacing:.12em;text-transform:uppercase;padding:12px 20px;text-align:left;border-bottom:1px solid var(--border);white-space:nowrap}
226227
.pnl-table td{padding:16px 20px;border-bottom:1px solid var(--border);font-size:14px;color:var(--text2)}
227228
.pnl-table tr:hover td{background:rgba(255,255,255,.02)}
228229
.pnl-table td.month{font-family:'JetBrains Mono',monospace;color:var(--muted);font-size:13px}
@@ -387,7 +388,9 @@
387388
@media(max-width:768px){
388389
.tui-statusbar{gap:12px}
389390
.win-donut{width:180px;height:180px}
390-
.win-donut svg{width:180px!important;height:180px!important}
391+
/* win-rate-wrap: row on ≥480, column on narrow */
392+
.win-rate-wrap{flex-direction:row;align-items:flex-start;flex-wrap:wrap;justify-content:center;gap:24px}
393+
.win-stats{max-width:260px}
391394
}
392395
@media(max-width:640px){
393396
.metrics-grid{grid-template-columns:1fr}
@@ -405,14 +408,24 @@
405408
.tui-stats{grid-template-columns:repeat(3,1fr);gap:6px}
406409
.tui-stat-v{font-size:12px}
407410
.tui-bottombar{flex-direction:column;gap:4px;align-items:flex-start}
411+
/* pnl-table: mobile-friendly headers + compact cells */
408412
.pnl-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
409-
.pnl-table{min-width:480px}
413+
.th-long{display:none}
414+
.th-short{display:inline}
415+
.pnl-table{min-width:0;width:100%}
416+
.pnl-table th{padding:10px 12px;font-size:10px;letter-spacing:.06em}
417+
.pnl-table td{padding:12px 12px;font-size:13px}
410418
h2.section-h2{font-size:clamp(26px,7vw,40px)}
411419
.section-desc{font-size:15px;margin-bottom:40px}
412420
.win-donut{width:160px!important;height:160px!important}
413-
.win-donut svg{width:160px!important;height:160px!important}
421+
.donut-pct{font-size:28px}
422+
.win-rate-wrap{flex-direction:column;align-items:center;gap:20px}
423+
.win-stats{max-width:100%;width:100%}
414424
.hero-badge{font-size:10px;padding:6px 12px}
415425
.btn-primary,.btn-ghost{padding:12px 20px;font-size:13px}
426+
.pnl-table-wrap{margin-top:40px}
427+
.ws-item{padding:12px}
428+
.ws-val{font-size:17px}
416429
}
417430
@media(max-width:400px){
418431
section{padding:48px 14px}
@@ -423,6 +436,11 @@
423436
.tui-stat-b:last-child{grid-column:1/-1}
424437
.hero-metrics{gap:12px}
425438
.hm-val{font-size:22px}
439+
.win-donut{width:140px!important;height:140px!important}
440+
.donut-pct{font-size:24px}
441+
.pnl-table th{padding:8px 8px;font-size:9px}
442+
.pnl-table td{padding:10px 8px;font-size:12px}
443+
.cat-bars{gap:14px}
426444
}
427445

428446
/* ═══════════════════════════════════════════
@@ -848,7 +866,7 @@ <h2 class="section-h2 reveal">Backtest <span class="hl">Results.</span></h2>
848866
<div>
849867
<div class="win-rate-wrap">
850868
<div class="win-donut">
851-
<svg width="220" height="220" viewBox="0 0 220 220">
869+
<svg width="220" height="220" viewBox="0 0 220 220" preserveAspectRatio="xMidYMid meet">
852870
<defs>
853871
<linearGradient id="donutGrad" x1="0" y1="0" x2="1" y2="1">
854872
<stop offset="0%" stop-color="#00ff88"/>
@@ -910,9 +928,9 @@ <h2 class="section-h2 reveal">Backtest <span class="hl">Results.</span></h2>
910928
<thead>
911929
<tr>
912930
<th>Month</th>
913-
<th>Conservative (+10%/mo)</th>
914-
<th>Target (+20%/mo)</th>
915-
<th>Stretch (+30%/mo)</th>
931+
<th><span class="th-long">Conservative (+10%/mo)</span><span class="th-short">Cons.</span></th>
932+
<th><span class="th-long">Target (+20%/mo)</span><span class="th-short">Target</span></th>
933+
<th><span class="th-long">Stretch (+30%/mo)</span><span class="th-short">Stretch</span></th>
916934
</tr>
917935
</thead>
918936
<tbody>

0 commit comments

Comments
 (0)