diff --git a/app.py b/app.py index 7e72440..508a4c4 100644 --- a/app.py +++ b/app.py @@ -113,6 +113,14 @@ def handle_animation_speed_update(data): # Broadcast animation speed update to all clients emit('animation_speed_update', data, broadcast=True, include_self=False) +@socketio.on('brightness_update') +def handle_brightness_update(data): + """Handle brightness updates from controller""" + print(f'Brightness update received: {data}') + print(f'Broadcasting brightness update to {len(connected_clients)} clients') + # Broadcast brightness update to all clients + emit('brightness_update', data, broadcast=True, include_self=False) + @socketio.on('join_room') def handle_join_room(data): """Handle client joining a specific room""" diff --git a/templates/mechanical_counter.html b/templates/mechanical_counter.html index 92fa958..b30ef6d 100644 --- a/templates/mechanical_counter.html +++ b/templates/mechanical_counter.html @@ -75,7 +75,7 @@ top: 0; left: 0; width: 100%; - height: 1000px; /* 10 digits * 100px each */ + height: 1200px; /* 10 digits * 120px each (matches default wheel height) */ transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); display: flex; flex-direction: column; @@ -83,7 +83,7 @@ .digit { width: 100%; - height: 100px; + height: 120px; display: flex; justify-content: center; align-items: center; @@ -143,64 +143,13 @@ z-index: 1; } - .mechanical-sound::before { - content: ''; - position: absolute; - top: 50%; - left: 0; - right: 0; - height: 2px; - background: linear-gradient(90deg, transparent, #ffffff, transparent); - opacity: 0; - transition: opacity 0.3s; - } - - .digit-wheel.animating .mechanical-sound::before { - opacity: 1; - } - - /* Glitch effect for mechanical feel */ - .digit-wheel.animating .digit.active { - animation: glitch 0.1s ease-in-out; - } - - @keyframes glitch { - 0%, 100% { transform: translateX(0); } - 25% { transform: translateX(-1px); } - 75% { transform: translateX(1px); } - } - - /* Mechanical click sound simulation */ - .click-indicator { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - width: 4px; - height: 4px; - background: #ffffff; - border-radius: 50%; - opacity: 0; - z-index: 3; - } - - .digit-wheel.animating .click-indicator { - animation: click 0.8s ease-in-out; - } - - @keyframes click { - 0% { opacity: 0; transform: translate(-50%, -50%) scale(0); } - 50% { opacity: 1; transform: translate(-50%, -50%) scale(1); } - 100% { opacity: 0; transform: translate(-50%, -50%) scale(2); } - } + /* Removed visual effects that caused white lines during animation */