Files
gilles a8f0d6ccba Initial commit — KC868-A2 contrôleur solaire ESP32
Fonctionnalités :
- Lecture RS485 Modbus Epever Tracer 4210N (115200 bps, FC03/FC04/FC16)
- Moteur de règles JSON (LittleFS) — commande automatique des relais
- Interface web mobile-first (dashboard, règles, config, historique, EPEVER, debug)
- WiFi AP+STA simultanés avec reconnexion automatique et portail captif
- mDNS configurable (pv.local par défaut)
- Configuration registres EPEVER depuis l'UI (18 registres holding)
- Historique basse/haute résolution avec graphes canvas
- VPN WireGuard optionnel (désactivé par défaut, config via UI)
- OTA firmware + filesystem via ElegantOTA
- Deep sleep / économie d'énergie

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 19:25:01 +02:00

502 lines
11 KiB
CSS

:root {
--bg: #1a1a2e;
--surface: #16213e;
--carte: #0f3460;
--accent: #e94560;
--vert: #00b894;
--rouge: #d63031;
--texte: #eaeaea;
--muted: #a0aec0;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
background: var(--bg);
color: var(--texte);
font-family: system-ui, -apple-system, sans-serif;
min-height: 100vh;
display: flex;
flex-direction: column;
}
/* --- En-tête --- */
header {
background: var(--surface);
padding: 0.6rem 0.9rem;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid var(--carte);
}
header h1 { font-size: 0.95rem; font-weight: 700; }
.header-title {
min-width: 0;
}
.header-clock {
display: block;
margin-top: 0.1rem;
color: var(--muted);
font-family: "Courier New", monospace;
font-size: 0.68rem;
}
/* --- Badges --- */
.badge {
padding: 0.2rem 0.7rem;
border-radius: 999px;
font-size: 0.7rem;
font-weight: 700;
letter-spacing: 0.03em;
}
.badge-ok { background: var(--vert); color: #000; }
.badge-err { background: var(--rouge); color: #fff; }
/* --- Navigation --- */
nav {
display: flex;
background: var(--surface);
border-bottom: 1px solid var(--carte);
}
.tab {
flex: 1;
padding: 0.55rem 0;
background: none;
border: none;
border-bottom: 2px solid transparent;
color: var(--muted);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
min-width: 0;
transition: color 0.15s, border-color 0.15s;
}
.tab svg {
width: 20px;
height: 20px;
flex-shrink: 0;
pointer-events: none;
}
.tab.active {
color: var(--accent);
border-bottom-color: var(--accent);
}
/* --- Contenu principal --- */
main { flex: 1; padding: 0.65rem; }
.onglet { display: none; }
.onglet.actif { display: block; }
/* --- Dashboard --- */
.grille {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 0.45rem;
}
.grille-3 { grid-template-columns: repeat(3, 1fr); }
.carte {
background: var(--carte);
border-radius: 0.55rem;
padding: 0.45rem 0.35rem;
text-align: center;
border: 2px solid transparent;
transition: border-color 0.2s, transform 0.1s;
}
.carte-on { border-color: var(--vert); }
/* Long press feedback — user-select uniquement sur les cartes relais */
#carte-relay1, #carte-relay2 {
cursor: default;
user-select: none;
-webkit-user-select: none;
}
.press-hold {
border-color: var(--accent) !important;
transform: scale(0.95);
transition: transform 0.1s, border-color 0.1s !important;
}
@keyframes flash-save {
0% { background: var(--accent); }
100% { background: var(--carte); }
}
.press-done { animation: flash-save 0.5s ease-out forwards; }
.etiquette {
font-size: 0.58rem;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.04em;
margin-bottom: 0.18rem;
}
.valeur {
font-size: 1.05rem;
font-weight: 700;
}
.valeur-compacte {
font-size: 0.82rem;
overflow-wrap: anywhere;
}
.val-on { color: var(--vert); }
.val-off { color: var(--muted); }
.dash-section {
font-size: 0.6rem;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--accent);
font-weight: 700;
padding: 0.3rem 0 0.15rem;
}
.dash-hint {
font-weight: 400;
color: var(--muted);
text-transform: none;
letter-spacing: 0;
font-size: 0.56rem;
}
/* --- Commandes --- */
.ligne-commande {
background: var(--surface);
border-radius: 0.65rem;
padding: 0.7rem 0.75rem;
margin-bottom: 0.5rem;
display: flex;
align-items: center;
gap: 0.5rem;
}
.label-cmd {
flex: 1;
font-weight: 500;
font-size: 0.9rem;
min-width: 0;
}
/* --- Boutons --- */
.btn {
padding: 0.55rem 1rem;
border: none;
border-radius: 0.5rem;
font-size: 0.85rem;
font-weight: 600;
cursor: pointer;
background: var(--carte);
color: var(--texte);
white-space: nowrap;
transition: opacity 0.15s, box-shadow 0.15s;
touch-action: manipulation;
}
.btn:active { opacity: 0.75; }
.btn-actif { background: var(--accent); color: #fff; }
.btn-vert { background: var(--vert); color: #000; }
.btn-rouge { background: var(--rouge); color: #fff; }
.btn-dim { opacity: 0.3; }
.btn-glow-vert { box-shadow: 0 0 10px var(--vert); }
.btn-glow-rouge { box-shadow: 0 0 10px var(--rouge); }
/* --- Voyant LED relais --- */
.led {
display: inline-block;
width: 12px; height: 12px;
border-radius: 50%;
vertical-align: middle;
margin-left: 6px;
transition: background 0.2s, box-shadow 0.2s;
}
.led-on { background: var(--vert); box-shadow: 0 0 7px var(--vert); }
.led-off { background: #444; box-shadow: none; }
.btn-primaire {
display: inline-block;
text-decoration: none;
background: var(--accent);
color: #fff;
margin-top: 1.2rem;
padding: 0.6rem 1.5rem;
border-radius: 0.5rem;
font-weight: 600;
}
/* --- Règles --- */
.regle-item {
background: var(--surface);
border-radius: 0.75rem;
padding: 0.75rem 1rem;
margin-bottom: 0.6rem;
display: flex;
align-items: center;
gap: 0.6rem;
}
.regle-desc { flex: 1; font-size: 0.85rem; line-height: 1.5; }
.regle-id { font-size: 0.7rem; color: var(--muted); }
.regle-desactivee { opacity: 0.45; }
.regle-form {
background: var(--surface);
border-radius: 0.75rem;
padding: 1rem;
margin-top: 1rem;
}
.form-titre {
font-weight: 600;
margin-bottom: 0.75rem;
font-size: 0.9rem;
}
.form-ligne {
display: flex;
align-items: center;
margin-bottom: 0.5rem;
gap: 0.5rem;
}
.form-ligne label {
width: 90px;
font-size: 0.8rem;
color: var(--muted);
flex-shrink: 0;
}
.form-ligne select,
.form-ligne input {
flex: 1;
background: var(--carte);
border: none;
border-radius: 0.4rem;
padding: 0.4rem 0.6rem;
color: var(--texte);
font-size: 0.85rem;
}
.btn-plein { display: block; width: 100%; margin-top: 0.75rem; text-align: center; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.75rem; }
.form-section-label {
font-size: 0.65rem;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--accent);
font-weight: 700;
margin: 0.8rem 0 0.35rem;
border-bottom: 1px solid var(--carte);
padding-bottom: 0.25rem;
}
/* --- Toast notification --- */
#toast {
position: fixed;
bottom: 1.5rem;
left: 50%;
transform: translateX(-50%) translateY(1rem);
background: var(--rouge);
color: #fff;
padding: 0.55rem 1.2rem;
border-radius: 2rem;
font-size: 0.85rem;
font-weight: 600;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s, transform 0.2s;
white-space: nowrap;
z-index: 999;
}
#toast.visible {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
/* --- Modales --- */
.modal {
position: fixed;
inset: 0;
z-index: 1000;
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
background: rgba(0, 0, 0, 0.65);
}
.modal.hidden { display: none; }
.modal-box {
width: 100%;
max-width: 420px;
background: var(--surface);
border: 1px solid var(--carte);
border-radius: 0.75rem;
padding: 1rem;
}
.modal-title {
font-weight: 700;
margin-bottom: 0.75rem;
}
.modal-list {
display: grid;
gap: 0.4rem;
}
.modal-row {
display: flex;
justify-content: space-between;
gap: 0.75rem;
background: var(--carte);
border-radius: 0.45rem;
padding: 0.55rem 0.65rem;
font-size: 0.82rem;
}
.modal-row span {
color: var(--muted);
font-family: "Courier New", monospace;
}
.modal-empty {
color: var(--muted);
font-size: 0.85rem;
}
/* --- Lignes relais désactivées en mode Auto --- */
.row-disabled { opacity: 0.4; pointer-events: none; }
/* --- Textes d'aide onglets --- */
.aide {
font-size: 0.78rem;
color: var(--muted);
line-height: 1.55;
background: var(--surface);
border-left: 3px solid var(--accent);
border-radius: 0 0.5rem 0.5rem 0;
padding: 0.55rem 0.75rem;
margin-bottom: 0.75rem;
}
.aide strong { color: var(--texte); }
/* --- Board image --- */
.board-img {
display: block;
width: 100%;
max-width: 700px;
height: auto;
margin: 0.75rem auto 0;
border-radius: 0.75rem;
border: 1px solid var(--carte);
}
.ota-info {
font-size: 0.8rem;
color: var(--muted);
margin-bottom: 0.5rem;
}
/* --- Historique / Graphes --- */
.hist-toggle {
display: flex;
gap: 0.5rem;
margin-bottom: 0.75rem;
}
.hist-toggle .btn { flex: 1; }
.active-mode { background: var(--accent) !important; color: #fff !important; opacity: 1 !important; }
.hist-debug {
color: var(--muted);
background: var(--surface);
border: 1px solid var(--carte);
border-radius: 0.5rem;
padding: 0.45rem 0.6rem;
margin-bottom: 0.75rem;
font-family: "Courier New", monospace;
font-size: 0.68rem;
line-height: 1.35;
}
.graphe-conteneur {
background: var(--surface);
border-radius: 0.75rem;
padding: 0.75rem;
margin-bottom: 0.75rem;
overflow: hidden;
}
.graphe-titre {
font-size: 0.75rem;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.05em;
margin-bottom: 0.5rem;
}
canvas {
display: block;
width: 100%;
height: auto;
border-radius: 0.4rem;
}
/* --- Debug console --- */
.debug-actions {
display: flex;
gap: 0.5rem;
margin-bottom: 0.6rem;
}
.debug-actions .btn {
flex: 1;
margin-top: 0;
}
.debug-meta {
color: var(--muted);
font-size: 0.75rem;
margin-bottom: 0.45rem;
}
.debug-console {
width: 100%;
min-height: 60vh;
max-height: 68vh;
overflow: auto;
background: #070b12;
color: #d7f7df;
border: 1px solid var(--carte);
border-radius: 0.55rem;
padding: 0.75rem;
font-family: "Courier New", monospace;
font-size: 0.72rem;
line-height: 1.45;
white-space: pre-wrap;
word-break: break-word;
}
/* --- WiFi info --- */
.wifi-val { font-family: monospace; font-size: 0.9rem; color: var(--texte); }
/* --- RS485 wiring info --- */
.rs485-schema {
font-family: 'Courier New', monospace;
font-size: 0.7rem;
line-height: 1.4;
color: var(--texte);
background: var(--fond);
border-radius: 0.4rem;
padding: 0.6rem 0.75rem;
overflow-x: auto;
white-space: pre;
margin: 0.5rem 0;
}
.rs485-table {
width: 100%;
border-collapse: collapse;
font-size: 0.8rem;
margin: 0.5rem 0;
}
.rs485-table th, .rs485-table td {
padding: 0.35rem 0.5rem;
border: 1px solid var(--carte);
text-align: left;
}
.rs485-table th { background: var(--fond); color: var(--muted); }
.fil {
display: inline-block;
padding: 0.1rem 0.45rem;
border-radius: 0.3rem;
font-size: 0.75rem;
font-weight: 600;
color: #fff;
}
/* --- Pied de page --- */
footer {
text-align: center;
padding: 0.45rem;
font-size: 0.7rem;
color: var(--muted);
background: var(--surface);
border-top: 1px solid var(--carte);
}