forked from Rockachopa/Timmy-time-dashboard
polish: extract inline CSS, add connection status, panel macro, favicon, ollama cache, toast system (#164)
Major:
- Extract all inline <style> blocks from 22 Jinja2 templates into
static/css/mission-control.css — single cacheable stylesheet
- Add tox lint check that fails on inline <style> in templates
Minor:
1. Connection status indicator in topbar (green/amber/red dot) reflecting
WebSocket + Ollama reachability, with auto-reconnect
2. Jinja2 {% macro panel(title) %} in macros.html — eliminates repeated
.card.mc-panel markup; index.html converted as example
3. SVG favicon (purple T + orange dot)
4. 30-second TTL cache on _check_ollama() to avoid blocking the event loop
on every health poll (asyncio.to_thread was already in place)
5. Toast notification system (McToast.show) for transient status messages —
wired into connection status for Ollama/WebSocket state changes
Enforcement:
- CLAUDE.md updated with conventions 11-14 (no inline CSS, use panel macro,
use toasts, never block the event loop)
- tox lint + pre-push environments now fail on inline <style> blocks
https://claude.ai/code/session_014FQ785MQdyJQ4BAXrRSo9w
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
07f2c1b41e
commit
622a6a9204
@@ -2,110 +2,7 @@
|
||||
|
||||
{% block title %}{{ page_title }}{% endblock %}
|
||||
|
||||
{% block extra_styles %}
|
||||
<style>
|
||||
.voice-enhanced-page {
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.wave-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
height: 60px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
.wave-bar {
|
||||
width: 4px;
|
||||
background: var(--purple);
|
||||
border-radius: 2px;
|
||||
animation: wave 1s ease-in-out infinite;
|
||||
}
|
||||
.wave-bar:nth-child(1) { animation-delay: 0s; height: 20%; }
|
||||
.wave-bar:nth-child(2) { animation-delay: 0.1s; height: 40%; }
|
||||
.wave-bar:nth-child(3) { animation-delay: 0.2s; height: 60%; }
|
||||
.wave-bar:nth-child(4) { animation-delay: 0.3s; height: 80%; }
|
||||
.wave-bar:nth-child(5) { animation-delay: 0.4s; height: 100%; }
|
||||
.wave-bar:nth-child(6) { animation-delay: 0.3s; height: 80%; }
|
||||
.wave-bar:nth-child(7) { animation-delay: 0.2s; height: 60%; }
|
||||
.wave-bar:nth-child(8) { animation-delay: 0.1s; height: 40%; }
|
||||
.wave-bar:nth-child(9) { animation-delay: 0s; height: 20%; }
|
||||
@keyframes wave {
|
||||
0%, 100% { transform: scaleY(0.5); opacity: 0.5; }
|
||||
50% { transform: scaleY(1); opacity: 1; }
|
||||
}
|
||||
.wave-container:not(.listening) .wave-bar {
|
||||
animation: none;
|
||||
height: 10%;
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.voice-btn-row {
|
||||
text-align: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.voice-btn-row button {
|
||||
padding: 12px 32px;
|
||||
font-size: 1rem;
|
||||
font-family: var(--font);
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
min-height: 48px;
|
||||
border-radius: var(--radius-md);
|
||||
cursor: pointer;
|
||||
touch-action: manipulation;
|
||||
transition: transform 0.1s, box-shadow 0.2s;
|
||||
}
|
||||
.voice-btn-row button:active { transform: scale(0.96); }
|
||||
#start-btn {
|
||||
background: var(--border-glow);
|
||||
border: none;
|
||||
color: var(--text-bright);
|
||||
}
|
||||
#stop-btn {
|
||||
background: var(--red);
|
||||
border: none;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#status-text {
|
||||
text-align: center;
|
||||
color: var(--text-dim);
|
||||
margin-bottom: 16px;
|
||||
font-size: 0.85rem;
|
||||
letter-spacing: 0.06em;
|
||||
}
|
||||
|
||||
.result-box {
|
||||
background: rgba(24, 10, 45, 0.8);
|
||||
border: 1px solid var(--border);
|
||||
padding: 14px;
|
||||
border-radius: var(--radius-md);
|
||||
margin-bottom: 10px;
|
||||
font-size: 0.9rem;
|
||||
color: var(--text);
|
||||
}
|
||||
.result-box.timmy-reply {
|
||||
border-left: 3px solid var(--purple);
|
||||
}
|
||||
.result-box strong {
|
||||
color: var(--text-dim);
|
||||
font-size: 0.75rem;
|
||||
letter-spacing: 0.08em;
|
||||
display: block;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.result-box.timmy-reply strong { color: var(--purple); }
|
||||
|
||||
#audio-player {
|
||||
width: 100%;
|
||||
margin-top: 10px;
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block extra_styles %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="voice-enhanced-page py-3">
|
||||
|
||||
Reference in New Issue
Block a user