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,97 +2,7 @@
|
||||
|
||||
{% block title %}{{ page_title }}{% endblock %}
|
||||
|
||||
{% block extra_styles %}
|
||||
<style>
|
||||
.voice-page {
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.voice-button {
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(135deg, var(--border-glow), var(--purple));
|
||||
border: none;
|
||||
color: white;
|
||||
font-size: 3.5rem;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s, box-shadow 0.3s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 30px auto;
|
||||
box-shadow: 0 0 40px rgba(124, 58, 237, 0.3);
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
.voice-button:hover {
|
||||
transform: scale(1.05);
|
||||
box-shadow: 0 0 60px rgba(124, 58, 237, 0.5);
|
||||
}
|
||||
.voice-button:active, .voice-button.listening {
|
||||
transform: scale(0.95);
|
||||
background: linear-gradient(135deg, var(--red), var(--red-dim));
|
||||
box-shadow: 0 0 60px rgba(255, 68, 85, 0.5);
|
||||
animation: pulse-listen 1s infinite;
|
||||
}
|
||||
@keyframes pulse-listen {
|
||||
0%, 100% { box-shadow: 0 0 40px rgba(255, 68, 85, 0.5); }
|
||||
50% { box-shadow: 0 0 80px rgba(255, 68, 85, 0.8); }
|
||||
}
|
||||
|
||||
.voice-status {
|
||||
font-size: 1rem;
|
||||
color: var(--text-dim);
|
||||
margin-bottom: 16px;
|
||||
letter-spacing: 0.06em;
|
||||
}
|
||||
|
||||
.voice-result {
|
||||
background: rgba(24, 10, 45, 0.8);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-md);
|
||||
padding: 16px;
|
||||
margin-top: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
.voice-transcript {
|
||||
font-size: 0.95rem;
|
||||
margin-bottom: 12px;
|
||||
color: var(--text);
|
||||
}
|
||||
.voice-response {
|
||||
color: var(--purple);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.voice-tips {
|
||||
margin-top: 24px;
|
||||
padding: 16px;
|
||||
background: rgba(24, 10, 45, 0.6);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-md);
|
||||
text-align: left;
|
||||
}
|
||||
.voice-tips h3 {
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-bright);
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.voice-tips ul {
|
||||
color: var(--text-dim);
|
||||
line-height: 2;
|
||||
padding-left: 18px;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.voice-button { width: 140px; height: 140px; font-size: 3rem; }
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block extra_styles %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="voice-page py-3">
|
||||
|
||||
Reference in New Issue
Block a user