|
| 1 | +# Ping Display Location |
| 2 | + |
| 3 | +## Screen Layout |
| 4 | + |
| 5 | +``` |
| 6 | +┌─────────────────────────────────────────────────────────────────────────────┐ |
| 7 | +│ ┌─ TOP BAR ──────────────────────────────────────────────────────────────┐ │ |
| 8 | +│ │ ❤️ 100 🎯 0 💀 0 📶 45 ms [POWERUP] [🎤] [⚙️] │ │ |
| 9 | +│ │ └──┬──┘ └─┬─┘ └─┬─┘ └──┬───┘ │ │ |
| 10 | +│ │ Health Kills Deaths PING ← NEW! │ │ |
| 11 | +│ └────────────────────────────────────────────────────────────────────────┘ │ |
| 12 | +│ │ |
| 13 | +│ ┌─ LEADERBOARD ──┐ ┌─ KILL FEED ──────┐ │ |
| 14 | +│ │ 🏆 LEADERBOARD │ │ Player1 💀 You │ │ |
| 15 | +│ │ #1 Tank123: 5│ └──────────────────┘ │ |
| 16 | +│ │ #2 You: 3 │ │ |
| 17 | +│ │ #3 Pro99: 2 │ │ |
| 18 | +│ └───────────────┘ │ |
| 19 | +│ │ |
| 20 | +│ GAME CANVAS AREA │ |
| 21 | +│ (Tanks, Bullets, PowerUps) │ |
| 22 | +│ │ |
| 23 | +│ │ |
| 24 | +│ ┌─ HEAT BAR ──┐ ┌─ MINIMAP ──┐ ┌─ CHAT ────────────┐ │ |
| 25 | +│ │ H │ │ │ ┌─────────┐ │ │ 💬 TEAM CHAT │ │ |
| 26 | +│ │ E │ 100% │ │ │ ● ■ │ │ │ Player: Hi! │ │ |
| 27 | +│ │ A │█████████│ │ │ ● │ │ │ Tank99: GG │ │ |
| 28 | +│ │ T │█████████│ │ │ ■ │ │ │ [Type message...] │ │ |
| 29 | +│ └───┴─────────┘ └─┴─────────┴─┘ └───────────────────┘ │ |
| 30 | +└─────────────────────────────────────────────────────────────────────────────┘ |
| 31 | +``` |
| 32 | + |
| 33 | +## Ping Indicator Details |
| 34 | + |
| 35 | +### Position |
| 36 | + |
| 37 | +- **Location**: Top-left section of screen |
| 38 | +- **Container**: `#top-bar > .hud-section > #player-stats` |
| 39 | +- **Order**: 4th item (after Health, Kills, Deaths) |
| 40 | + |
| 41 | +### Visual Appearance |
| 42 | + |
| 43 | +``` |
| 44 | +┌─────────────┐ |
| 45 | +│ 📶 45 ms │ ← Green (Good: <50ms) |
| 46 | +└─────────────┘ |
| 47 | +
|
| 48 | +┌─────────────┐ |
| 49 | +│ 📶 75 ms │ ← Orange (Medium: 50-100ms) |
| 50 | +└─────────────┘ |
| 51 | +
|
| 52 | +┌─────────────┐ |
| 53 | +│ 📶 150 ms │ ← Red (Bad: >100ms) |
| 54 | +└─────────────┘ |
| 55 | +``` |
| 56 | + |
| 57 | +### Color Coding System |
| 58 | + |
| 59 | +| Ping Range | Color | Icon Color | Text Color | Connection Quality | |
| 60 | +| ---------- | ------ | ---------- | ---------- | ------------------ | |
| 61 | +| 0-49ms | Green | #00ff88 | #00ff88 | Excellent ⚡ | |
| 62 | +| 50-99ms | Orange | #ffaa00 | #ffaa00 | Good ✓ | |
| 63 | +| 100ms+ | Red | #ff4444 | #ff4444 | Poor ⚠️ | |
| 64 | + |
| 65 | +### Responsive Behavior |
| 66 | + |
| 67 | +#### Desktop (>1250px) |
| 68 | + |
| 69 | +- Full visibility with icon + value + unit |
| 70 | +- Font size: 1.1rem |
| 71 | +- Padding: 8px 15px |
| 72 | + |
| 73 | +#### Tablet (768px - 1250px) |
| 74 | + |
| 75 | +- Slightly reduced padding: 6px 10px |
| 76 | +- Font size: 0.9rem |
| 77 | +- Still fully visible |
| 78 | + |
| 79 | +#### Mobile (<768px) |
| 80 | + |
| 81 | +- Condensed padding: 5px 8px |
| 82 | +- Font size: 0.8rem |
| 83 | +- Icon + value only (unit may wrap) |
| 84 | + |
| 85 | +## Accessibility Features |
| 86 | + |
| 87 | +- ARIA label: "Ping: X milliseconds" |
| 88 | +- Tooltip: "Network Latency" |
| 89 | +- High contrast colors for all connection states |
| 90 | +- Updates every 2 seconds (non-intrusive) |
| 91 | +- No animation (reduces motion sickness) |
| 92 | + |
| 93 | +## Technical Integration |
| 94 | + |
| 95 | +The ping display integrates seamlessly with existing UI: |
| 96 | + |
| 97 | +- Uses same styling as other stats (`.stat-item`) |
| 98 | +- Updates via `UIManager.updateHUD()` |
| 99 | +- Data source: `NetworkManager.getPing()` |
| 100 | +- No layout shifts (fixed space allocation) |
0 commit comments