|
46 | 46 | .result-display { |
47 | 47 | display: flex; |
48 | 48 | flex-direction: column; |
49 | | - gap: 0.5rem; |
| 49 | + gap: 0.75rem; |
50 | 50 | } |
51 | 51 |
|
52 | 52 | .result-value { |
|
55 | 55 | letter-spacing: 0.01em; |
56 | 56 | } |
57 | 57 |
|
| 58 | + .result-metrics-grid { |
| 59 | + display: grid; |
| 60 | + grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); |
| 61 | + gap: clamp(0.75rem, 2vw, 1.25rem); |
| 62 | + align-items: start; |
| 63 | + } |
| 64 | + |
| 65 | + .result-value--compact { |
| 66 | + font-size: clamp(1.4rem, 3vw, 1.85rem); |
| 67 | + } |
| 68 | + |
| 69 | + .result-group { |
| 70 | + display: flex; |
| 71 | + flex-direction: column; |
| 72 | + gap: 0.25rem; |
| 73 | + } |
| 74 | + |
58 | 75 | .result-with-tooltip { |
59 | 76 | display: inline-flex; |
60 | 77 | align-items: center; |
@@ -197,24 +214,32 @@ <h1>eRepublik Air Damage Calculator</h1> |
197 | 214 | <p class="helper-text">final damage</p> |
198 | 215 | </div> |
199 | 216 | <p class="helper-text" id="breakdown"></p> |
200 | | - <div class="result-with-tooltip" id="influence-wrapper"> |
201 | | - <div class="result-value tooltip-target" id="influence" tabindex="0">0</div> |
202 | | - <span class="tooltip-icon" aria-hidden="true">?</span> |
203 | | - <p class="helper-text">influence</p> |
204 | | - </div> |
205 | | - <p class="helper-text" id="influence-breakdown"></p> |
206 | | - <div class="result-with-tooltip" id="time-wrapper"> |
207 | | - <div class="result-value tooltip-target" id="time-estimate" tabindex="0">≈0s</div> |
208 | | - <span class="tooltip-icon" aria-hidden="true">?</span> |
209 | | - <p class="helper-text">time to deploy</p> |
210 | | - </div> |
211 | | - <p class="helper-text" id="time-breakdown"></p> |
212 | | - <div class="result-with-tooltip" id="rank-wrapper"> |
213 | | - <div class="result-value tooltip-target" id="rank-value" tabindex="0">0</div> |
214 | | - <span class="tooltip-icon" aria-hidden="true">?</span> |
215 | | - <p class="helper-text">rank points</p> |
| 217 | + <div class="result-metrics-grid"> |
| 218 | + <div class="result-group"> |
| 219 | + <div class="result-with-tooltip result-with-tooltip--compact" id="time-wrapper"> |
| 220 | + <div class="result-value result-value--compact tooltip-target" id="time-estimate" tabindex="0">≈0s</div> |
| 221 | + <span class="tooltip-icon" aria-hidden="true">?</span> |
| 222 | + <p class="helper-text">time to deploy</p> |
| 223 | + </div> |
| 224 | + <p class="helper-text" id="time-breakdown"></p> |
| 225 | + </div> |
| 226 | + <div class="result-group"> |
| 227 | + <div class="result-with-tooltip result-with-tooltip--compact" id="rank-wrapper"> |
| 228 | + <div class="result-value result-value--compact tooltip-target" id="rank-value" tabindex="0">0</div> |
| 229 | + <span class="tooltip-icon" aria-hidden="true">?</span> |
| 230 | + <p class="helper-text">rank points</p> |
| 231 | + </div> |
| 232 | + <p class="helper-text" id="rank-breakdown"></p> |
| 233 | + </div> |
| 234 | + <div class="result-group"> |
| 235 | + <div class="result-with-tooltip result-with-tooltip--compact" id="influence-wrapper"> |
| 236 | + <div class="result-value result-value--compact tooltip-target" id="influence" tabindex="0">0</div> |
| 237 | + <span class="tooltip-icon" aria-hidden="true">?</span> |
| 238 | + <p class="helper-text">influence</p> |
| 239 | + </div> |
| 240 | + <p class="helper-text" id="influence-breakdown"></p> |
| 241 | + </div> |
216 | 242 | </div> |
217 | | - <p class="helper-text" id="rank-breakdown"></p> |
218 | 243 | </div> |
219 | 244 | </section> |
220 | 245 |
|
@@ -593,6 +618,17 @@ <h1>eRepublik Air Damage Calculator</h1> |
593 | 618 | return Number.isFinite(value) ? value.toLocaleString(undefined, { maximumFractionDigits: 2 }) : '0'; |
594 | 619 | }; |
595 | 620 |
|
| 621 | + const formatDeployTime = (seconds) => { |
| 622 | + const wholeSeconds = Math.max(0, Math.ceil(seconds)); |
| 623 | + if (wholeSeconds < 60) { |
| 624 | + return `≈${formatNumber(wholeSeconds)}s`; |
| 625 | + } |
| 626 | + |
| 627 | + const minutes = Math.floor(wholeSeconds / 60); |
| 628 | + const remainingSeconds = String(wholeSeconds % 60).padStart(2, '0'); |
| 629 | + return `≈${formatNumber(minutes)}m:${remainingSeconds}s`; |
| 630 | + }; |
| 631 | + |
596 | 632 | const clampNumber = (value, min, max) => { |
597 | 633 | if (Number.isNaN(value)) return min; |
598 | 634 | if (typeof max === 'number') { |
@@ -708,12 +744,12 @@ <h1>eRepublik Air Damage Calculator</h1> |
708 | 744 |
|
709 | 745 | const timeSeconds = hits / actualHitsPerSecond; |
710 | 746 | const timeSecondsRounded = Math.ceil(timeSeconds); |
711 | | - timeEstimate.textContent = `≈${formatNumber(timeSecondsRounded)}s`; |
| 747 | + timeEstimate.textContent = formatDeployTime(timeSecondsRounded); |
712 | 748 | const timeFormula = [ |
713 | 749 | 'Time = ceil(hits ÷ (hits per second × accelerator))', |
714 | 750 | `= ceil(${formatNumber(hits)} ÷ (${formatNumber(baseHitsPerSecond)} × ${formatNumber(damageAcceleratorMultiplier)}))`, |
715 | 751 | `= ceil(${formatNumber(timeSeconds)} seconds)`, |
716 | | - `= ${formatNumber(timeSecondsRounded)} seconds` |
| 752 | + `= ${formatDeployTime(timeSecondsRounded)}` |
717 | 753 | ].join('\n'); |
718 | 754 |
|
719 | 755 | const rankFromDamage = result * 0.1; |
|
0 commit comments