Skip to content

Commit da9e73b

Browse files
committed
Added clock to Setup, Config, and Settings pages
1 parent cbca268 commit da9e73b

File tree

5 files changed

+46
-9
lines changed

5 files changed

+46
-9
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# 2025-11-21
2+
3+
## **v4.0.16** - Header Clock
4+
5+
### New Features
6+
- **Added clock to main header**
7+
- Clock displayed in upper right corner, aligned with title/logo
8+
- Styled identically to Match Controls clock (border, shadow, monospace font)
9+
- Visible on all pages (Setup, Registration, Tournament, Config)
10+
- Updates every 10 seconds to catch minute changes
11+
- **Files modified**: `tournament.html`, `css/styles.css`, `js/tournament-management.js`
12+
13+
---
14+
115
# 2025-11-19
216

317
## **v4.0.15** - JSDoc Type Definitions & Function Annotations

css/styles.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,17 @@ body {
196196
font-weight: 400;
197197
}
198198

199+
/* Header clock - matches Match Controls clock styling */
200+
.header-clock {
201+
font-family: var(--font-clock);
202+
font-size: 18px;
203+
font-weight: normal;
204+
border: 1px solid #ccc;
205+
padding: 8px 16px;
206+
border-radius: 6px;
207+
box-shadow: 0 2px 4px rgba(0,0,0,0.24);
208+
}
209+
199210
.header-tournament-status {
200211
position: absolute;
201212
right: 0;

js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let matches = [];
77
let currentStatsPlayer = null;
88

99
// Application version
10-
const APP_VERSION = '4.0.15';
10+
const APP_VERSION = '4.0.16';
1111

1212
// Application identity (encoded)
1313
const _0x4e = [78,101,119,84,111,110,32,68,67,32,84,111,117,114];

js/tournament-management.js

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,20 +1550,32 @@ function updateTournamentWatermark() {
15501550
}
15511551
}
15521552

1553-
// Update clock in Status Panel every minute
1553+
// Update clocks in Status Panel and header
15541554
function updateClock() {
1555-
const clockElement = document.getElementById('cad-clock');
1556-
if (clockElement) {
1557-
const now = new Date();
1558-
const hours = String(now.getHours()).padStart(2, '0');
1559-
const minutes = String(now.getMinutes()).padStart(2, '0');
1560-
clockElement.textContent = `${hours}:${minutes}`;
1555+
const now = new Date();
1556+
const hours = String(now.getHours()).padStart(2, '0');
1557+
const minutes = String(now.getMinutes()).padStart(2, '0');
1558+
const timeString = `${hours}:${minutes}`;
1559+
1560+
// Update Status Panel clock (CAD modal)
1561+
const cadClockElement = document.getElementById('cad-clock');
1562+
if (cadClockElement) {
1563+
cadClockElement.textContent = timeString;
1564+
}
1565+
1566+
// Update header clock (visible on all pages)
1567+
const headerClockElement = document.getElementById('headerClock');
1568+
if (headerClockElement) {
1569+
headerClockElement.textContent = timeString;
15611570
}
15621571
}
15631572

15641573
// Start clock update interval (every 10 seconds to catch minute changes quickly)
15651574
setInterval(updateClock, 10000);
15661575

1576+
// Initialize clock immediately when script loads
1577+
updateClock();
1578+
15671579
/**
15681580
* Get storage color class based on percentage thresholds
15691581
* @param {number} percentage - Storage usage percentage

tournament.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ <h1>
5252
</div>
5353
NewTon DC - Tournament Manager
5454
</h1>
55+
<div id="headerClock" class="header-clock"></div>
5556
</div>
5657
<div class="nav">
5758
<button class="nav-btn active" data-page="setup">Tournament Setup</button>
5859
<button class="nav-btn" data-page="registration">Player Registration</button>
5960
<button class="nav-btn" data-page="tournament">Tournament Bracket</button>
6061
<button class="nav-btn" data-page="config">Global Settings</button>
61-
<!-- NEW: Tournament status moved to bottom right of header -->
6262
<div id="headerTournamentStatus" class="header-tournament-status">
6363
Active Tournament: <strong>None</strong>
6464
</div>

0 commit comments

Comments
 (0)