diff --git a/src/App.css b/src/App.css index 2946455..47e1678 100644 --- a/src/App.css +++ b/src/App.css @@ -8,8 +8,9 @@ .app { display: flex; flex-direction: column; - align-items: center; + align-items: stretch; min-height: 100vh; + width: 100%; padding-top: 40px; box-sizing: border-box; } @@ -25,6 +26,7 @@ z-index: 10; flex-shrink: 0; margin-bottom: 60px; + align-self: center; } .clock-container { @@ -33,14 +35,12 @@ align-items: center; flex: 1; width: 100%; - padding: 0 20px; box-sizing: border-box; } /* Digital clock style (default) */ .digital-clock { font-family: 'DSEG7', monospace; - font-size: clamp(48px, 15vw, 180px); font-weight: bold; color: #fff; text-shadow: 0 0 20px rgba(255, 255, 255, 0.5); @@ -72,10 +72,6 @@ /* Responsive adjustments */ @media (max-width: 768px) { - .digital-clock { - font-size: 12vw; - } - .style-selector { gap: 8px; } diff --git a/src/App.tsx b/src/App.tsx index 3c1b4be..85e5d6f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -5,9 +5,20 @@ import './App.css' type ClockStyle = 'digital' | 'flip' | 'roll' -function DigitalClock({ time }: { time: string }) { +function DigitalClock({ time, size }: { time: string; size: number }) { + // Match width with flip/roll clocks + // Total flip/roll width ≈ 5.1 * (size / 1.6) because size is now scaled + // Actually size passed in is already the final size + // Flip: 6 * (size * 0.75) + 2 * (size * 0.3) = 4.5 * size + 0.6 * size = 5.1 * size + // Digital: 8 chars, each char ≈ fontSize * 0.6 wide in monospace = 4.8 * fontSize + // To match: 4.8 * fontSize = 5.1 * size => fontSize = size * 1.06 + const fontSize = Math.floor(size * 1.06) + return ( -