forked from FroSteel/Planification
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8bc26c326f | |||
| d2afbf0dca |
+7
-14
@@ -1,11 +1,10 @@
|
|||||||
// background.js — Service worker (Manifest V3)
|
// background.js — Service worker (Manifest V3)
|
||||||
//
|
//
|
||||||
// Quand l'utilisateur clique sur l'icône de l'extension :
|
// Au clic sur l'icône :
|
||||||
// 1. On vérifie qu'il est bien sur itsma.vd.ch
|
// 1. Vérifier qu'on est bien sur itsma.vd.ch (sinon message d'erreur)
|
||||||
// 2. On injecte un script dans l'onglet qui récupère le HTML complet
|
// 2. Injecter un script dans la page qui récupère le HTML complet
|
||||||
// de la page + tous les liens vers les fiches d'intervention
|
// 3. Stocker dans chrome.storage.local (persistant, sert de "dernière capture")
|
||||||
// 3. On stocke ça dans chrome.storage.local
|
// 4. Ouvrir viewer.html
|
||||||
// 4. On ouvre un nouvel onglet avec viewer.html
|
|
||||||
|
|
||||||
chrome.action.onClicked.addListener(async (tab) => {
|
chrome.action.onClicked.addListener(async (tab) => {
|
||||||
try {
|
try {
|
||||||
@@ -19,7 +18,6 @@ chrome.action.onClicked.addListener(async (tab) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Injecter un script dans l'onglet pour extraire le HTML
|
|
||||||
const results = await chrome.scripting.executeScript({
|
const results = await chrome.scripting.executeScript({
|
||||||
target: { tabId: tab.id },
|
target: { tabId: tab.id },
|
||||||
func: extractPlanningFromPage
|
func: extractPlanningFromPage
|
||||||
@@ -30,13 +28,12 @@ chrome.action.onClicked.addListener(async (tab) => {
|
|||||||
await chrome.storage.local.set({
|
await chrome.storage.local.set({
|
||||||
planningError:
|
planningError:
|
||||||
"Impossible de lire le contenu de la page. " +
|
"Impossible de lire le contenu de la page. " +
|
||||||
"Assure-toi d'être bien sur la page du planning des techniciens."
|
"Assure-toi d'être sur la page du planning des techniciens."
|
||||||
});
|
});
|
||||||
await openViewer();
|
await openViewer();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stocker le HTML capturé + l'URL de base pour les requêtes futures
|
|
||||||
await chrome.storage.local.set({
|
await chrome.storage.local.set({
|
||||||
planningHtml: data.html,
|
planningHtml: data.html,
|
||||||
planningUrl: tab.url,
|
planningUrl: tab.url,
|
||||||
@@ -54,12 +51,8 @@ chrome.action.onClicked.addListener(async (tab) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Fonction injectée dans la page du planning
|
|
||||||
// (elle s'exécute dans le contexte de itsma.vd.ch, pas dans le service worker)
|
|
||||||
function extractPlanningFromPage() {
|
function extractPlanningFromPage() {
|
||||||
// Récupérer tout le HTML de la page
|
return { html: document.documentElement.outerHTML };
|
||||||
const html = document.documentElement.outerHTML;
|
|
||||||
return { html: html };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function openViewer() {
|
async function openViewer() {
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "Planning Techniciens — Vue claire",
|
"name": "Planning Techniciens — Vue claire",
|
||||||
"version": "1.0.0",
|
"version": "2.0.1",
|
||||||
"description": "Réaffiche le planning du jour (itsma.vd.ch) avec pompier, absents et détails d'interventions à la demande.",
|
"description": "Réaffiche le planning du jour (itsma.vd.ch) avec pompier, absents, tooltips enrichis et thème clair/sombre.",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"activeTab",
|
"activeTab",
|
||||||
"scripting",
|
"scripting",
|
||||||
|
|||||||
+528
-248
@@ -1,360 +1,640 @@
|
|||||||
/* viewer.css — Style de la vue claire du planning */
|
/* ==========================================================================
|
||||||
|
Thème clair (défaut)
|
||||||
|
========================================================================== */
|
||||||
|
:root {
|
||||||
|
--bg: #f4f5f7;
|
||||||
|
--bg-elevated: #ffffff;
|
||||||
|
--bg-muted: #f0f1f3;
|
||||||
|
--bg-hover: #f7f8fa;
|
||||||
|
--border: #e2e4e8;
|
||||||
|
--border-strong: #cfd3da;
|
||||||
|
--text: #1a1f2b;
|
||||||
|
--text-muted: #5b6573;
|
||||||
|
--text-faint: #8892a0;
|
||||||
|
--accent: #0f4f8b;
|
||||||
|
--accent-soft: #e1ecf7;
|
||||||
|
--danger: #b03030;
|
||||||
|
--danger-soft: #fbe6e6;
|
||||||
|
--warn: #b87a00;
|
||||||
|
--warn-soft: #fff2d6;
|
||||||
|
--ok: #2e7b4a;
|
||||||
|
--ok-soft: #dff0e4;
|
||||||
|
|
||||||
* {
|
/* Palette par type d'intervention (clair & lisible) */
|
||||||
box-sizing: border-box;
|
--c-livraison: #2563eb; /* bleu */
|
||||||
|
--c-livraison-soft: #dbeafe;
|
||||||
|
--c-recup: #16a34a; /* vert */
|
||||||
|
--c-recup-soft: #dcfce7;
|
||||||
|
--c-remplacement: #ea580c; /* orange */
|
||||||
|
--c-remplacement-soft: #fed7aa;
|
||||||
|
--c-autre: #6b7280; /* gris */
|
||||||
|
--c-autre-soft: #e5e7eb;
|
||||||
|
|
||||||
|
--shadow: 0 1px 3px rgba(20, 30, 50, 0.06), 0 1px 2px rgba(20, 30, 50, 0.04);
|
||||||
|
--shadow-hover: 0 2px 8px rgba(20, 30, 50, 0.08);
|
||||||
|
--radius: 8px;
|
||||||
|
--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
||||||
|
--mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-theme="dark"] {
|
||||||
|
--bg: #16181d;
|
||||||
|
--bg-elevated: #21242b;
|
||||||
|
--bg-muted: #1c1f25;
|
||||||
|
--bg-hover: #2a2e36;
|
||||||
|
--border: #2e333c;
|
||||||
|
--border-strong: #414754;
|
||||||
|
--text: #e6e8ec;
|
||||||
|
--text-muted: #9ba2ad;
|
||||||
|
--text-faint: #6a727e;
|
||||||
|
--accent: #5ea8e8;
|
||||||
|
--accent-soft: #223348;
|
||||||
|
--danger: #e87878;
|
||||||
|
--danger-soft: #3b2626;
|
||||||
|
--warn: #d9a753;
|
||||||
|
--warn-soft: #3a2e1a;
|
||||||
|
--ok: #78c59a;
|
||||||
|
--ok-soft: #1f3a2b;
|
||||||
|
|
||||||
|
/* Palette sombre — tons plus doux mais toujours distincts */
|
||||||
|
--c-livraison: #60a5fa;
|
||||||
|
--c-livraison-soft: #1e3a5f;
|
||||||
|
--c-recup: #4ade80;
|
||||||
|
--c-recup-soft: #14432a;
|
||||||
|
--c-remplacement: #fb923c;
|
||||||
|
--c-remplacement-soft: #4a2512;
|
||||||
|
--c-autre: #9ca3af;
|
||||||
|
--c-autre-soft: #2a2e36;
|
||||||
|
|
||||||
|
--shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
|
||||||
|
--shadow-hover: 0 2px 10px rgba(0, 0, 0, 0.4);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Base
|
||||||
|
========================================================================== */
|
||||||
|
* { box-sizing: border-box; }
|
||||||
|
html, body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
background: var(--bg);
|
||||||
|
color: var(--text);
|
||||||
body {
|
font-family: var(--font);
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
font-size: 14px;
|
||||||
background: #f5f7fa;
|
|
||||||
color: #1f2937;
|
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
min-height: 100vh;
|
|
||||||
padding-bottom: 40px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.hidden {
|
.hidden { display: none !important; }
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* === Top bar === */
|
/* ==========================================================================
|
||||||
|
Topbar
|
||||||
|
========================================================================== */
|
||||||
.topbar {
|
.topbar {
|
||||||
background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
|
position: sticky;
|
||||||
color: white;
|
top: 0;
|
||||||
padding: 20px 32px;
|
z-index: 10;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
padding: 10px 20px;
|
||||||
flex-wrap: wrap;
|
background: var(--bg-elevated);
|
||||||
gap: 16px;
|
border-bottom: 1px solid var(--border);
|
||||||
|
box-shadow: var(--shadow);
|
||||||
|
}
|
||||||
|
|
||||||
|
.topbar-left {
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
gap: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.topbar h1 {
|
.topbar h1 {
|
||||||
font-size: 24px;
|
margin: 0;
|
||||||
|
font-size: 18px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
color: var(--text);
|
||||||
}
|
}
|
||||||
|
|
||||||
.subtitle {
|
.capture-info {
|
||||||
font-size: 13px;
|
font-size: 12px;
|
||||||
opacity: 0.85;
|
color: var(--text-muted);
|
||||||
margin-top: 4px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.topbar-right {
|
.topbar-right {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 12px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.topbar button {
|
.btn {
|
||||||
background: rgba(255,255,255,0.15);
|
display: inline-flex;
|
||||||
color: white;
|
align-items: center;
|
||||||
border: 1px solid rgba(255,255,255,0.3);
|
gap: 6px;
|
||||||
padding: 8px 16px;
|
padding: 6px 12px;
|
||||||
|
background: var(--bg-muted);
|
||||||
|
color: var(--text);
|
||||||
|
border: 1px solid var(--border);
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
|
font-size: 13px;
|
||||||
|
font-family: inherit;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 14px;
|
transition: background 0.1s, border-color 0.1s;
|
||||||
font-weight: 500;
|
|
||||||
transition: background 0.2s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.topbar button:hover {
|
.btn:hover {
|
||||||
background: rgba(255,255,255,0.25);
|
background: var(--bg-hover);
|
||||||
|
border-color: var(--border-strong);
|
||||||
}
|
}
|
||||||
|
|
||||||
.topbar button:disabled {
|
.btn:active {
|
||||||
opacity: 0.5;
|
transform: translateY(1px);
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* === Error zone === */
|
.btn-icon {
|
||||||
.error-zone {
|
padding: 6px 10px;
|
||||||
margin: 24px 32px;
|
font-size: 15px;
|
||||||
padding: 16px 20px;
|
|
||||||
background: #fef2f2;
|
|
||||||
border: 1px solid #fca5a5;
|
|
||||||
color: #991b1b;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* === Summary cards (pompier, absents, stats) === */
|
/* ==========================================================================
|
||||||
.summary {
|
État initial
|
||||||
display: grid;
|
========================================================================== */
|
||||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
.loading {
|
||||||
gap: 16px;
|
padding: 40px 20px;
|
||||||
margin: 24px 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.summary-card {
|
|
||||||
background: white;
|
|
||||||
padding: 18px 22px;
|
|
||||||
border-radius: 10px;
|
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
|
|
||||||
border-left: 4px solid #e5e7eb;
|
|
||||||
}
|
|
||||||
|
|
||||||
.summary-card.summary-pompier {
|
|
||||||
border-left-color: #dc2626;
|
|
||||||
}
|
|
||||||
|
|
||||||
.summary-card.summary-absents {
|
|
||||||
border-left-color: #f59e0b;
|
|
||||||
}
|
|
||||||
|
|
||||||
.summary-card.summary-stats {
|
|
||||||
border-left-color: #10b981;
|
|
||||||
}
|
|
||||||
|
|
||||||
.summary-label {
|
|
||||||
font-size: 12px;
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.05em;
|
|
||||||
color: #6b7280;
|
|
||||||
font-weight: 600;
|
|
||||||
margin-bottom: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.summary-value {
|
|
||||||
font-size: 20px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #111827;
|
|
||||||
}
|
|
||||||
|
|
||||||
.summary-value .muted {
|
|
||||||
font-weight: 400;
|
|
||||||
color: #6b7280;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* === Main content : cartes techniciens === */
|
|
||||||
#main-content {
|
|
||||||
margin: 0 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.placeholder {
|
|
||||||
background: white;
|
|
||||||
padding: 48px 32px;
|
|
||||||
border-radius: 10px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #9ca3af;
|
color: var(--text-muted);
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-box {
|
||||||
|
margin: 20px;
|
||||||
|
padding: 14px 18px;
|
||||||
|
background: var(--danger-soft);
|
||||||
|
color: var(--danger);
|
||||||
|
border: 1px solid var(--danger);
|
||||||
|
border-radius: var(--radius);
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.55;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stats {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: baseline;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 12px 20px 4px 20px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
.global-stat b {
|
||||||
|
color: var(--text);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
.global-stat-main b {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
.global-stat-sub {
|
||||||
.tech-grid {
|
color: var(--text-faint);
|
||||||
display: grid;
|
font-size: 12px;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
|
}
|
||||||
gap: 20px;
|
.global-stat-sep {
|
||||||
|
color: var(--text-faint);
|
||||||
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tech-card {
|
/* ==========================================================================
|
||||||
background: white;
|
Grille de cartes
|
||||||
border-radius: 10px;
|
========================================================================== */
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
|
.cards {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
|
||||||
|
gap: 14px;
|
||||||
|
padding: 14px 20px 40px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
background: var(--bg-elevated);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: var(--radius);
|
||||||
|
box-shadow: var(--shadow);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tech-card.tech-absent {
|
.card-header {
|
||||||
opacity: 0.7;
|
padding: 10px 14px;
|
||||||
background: #fafafa;
|
border-bottom: 1px solid var(--border);
|
||||||
}
|
background: var(--bg-muted);
|
||||||
|
|
||||||
.tech-card.tech-pompier {
|
|
||||||
box-shadow: 0 0 0 2px #dc2626, 0 2px 6px rgba(220,38,38,0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.tech-header {
|
|
||||||
padding: 14px 18px;
|
|
||||||
background: #f9fafb;
|
|
||||||
border-bottom: 1px solid #e5e7eb;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tech-card.tech-pompier .tech-header {
|
.card-tech-name {
|
||||||
background: #fef2f2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tech-card.tech-absent .tech-header {
|
|
||||||
background: #fef3c7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tech-name {
|
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 16px;
|
font-size: 14px;
|
||||||
color: #111827;
|
color: var(--text);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tech-badge {
|
.card-tech-badge {
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
padding: 3px 8px;
|
padding: 2px 8px;
|
||||||
border-radius: 12px;
|
border-radius: 10px;
|
||||||
font-weight: 600;
|
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.04em;
|
||||||
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tech-badge.badge-pompier {
|
.badge-pompier {
|
||||||
background: #dc2626;
|
background: var(--danger-soft);
|
||||||
color: white;
|
color: var(--danger);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tech-badge.badge-absent {
|
.badge-absent {
|
||||||
background: #f59e0b;
|
background: var(--bg-muted);
|
||||||
color: white;
|
color: var(--text-faint);
|
||||||
|
border: 1px solid var(--border);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tech-badge.badge-count {
|
.badge-count {
|
||||||
background: #e5e7eb;
|
background: var(--accent-soft);
|
||||||
color: #4b5563;
|
color: var(--accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tech-interventions {
|
.card-body {
|
||||||
padding: 8px 0;
|
padding: 8px 0;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tech-empty {
|
.card-empty {
|
||||||
padding: 24px;
|
padding: 14px;
|
||||||
text-align: center;
|
color: var(--text-faint);
|
||||||
color: #9ca3af;
|
font-size: 13px;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-size: 14px;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* === Intervention items === */
|
/* Cartes pompier : liseré rouge discret */
|
||||||
.intervention {
|
.card.is-pompier {
|
||||||
padding: 10px 18px;
|
border-left: 3px solid var(--danger);
|
||||||
border-bottom: 1px solid #f3f4f6;
|
}
|
||||||
cursor: pointer;
|
|
||||||
transition: background 0.15s;
|
/* Cartes absent : teinte neutre */
|
||||||
|
.card.is-absent {
|
||||||
|
opacity: 0.85;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card.is-absent .card-header {
|
||||||
|
background: var(--bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Frise de temps
|
||||||
|
========================================================================== */
|
||||||
|
.timeline {
|
||||||
|
padding: 12px 14px 6px 14px;
|
||||||
|
background: var(--bg-muted);
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.intervention:last-child {
|
/* Fond rouge discret quand la carte est "pompier" */
|
||||||
border-bottom: none;
|
.timeline-pompier {
|
||||||
|
background: var(--danger-soft);
|
||||||
}
|
}
|
||||||
|
|
||||||
.intervention:hover {
|
.timeline-bar {
|
||||||
background: #eff6ff;
|
position: relative;
|
||||||
|
height: 20px;
|
||||||
|
background: var(--bg-elevated);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 3px;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.interv-header {
|
/* Trous (zones libres) : fond diagonal discret + vert léger au survol */
|
||||||
display: flex;
|
.timeline-hole {
|
||||||
justify-content: space-between;
|
position: absolute;
|
||||||
align-items: baseline;
|
top: 0;
|
||||||
gap: 8px;
|
bottom: 0;
|
||||||
|
background: repeating-linear-gradient(
|
||||||
|
45deg,
|
||||||
|
transparent 0 4px,
|
||||||
|
rgba(0, 0, 0, 0.035) 4px 8px
|
||||||
|
);
|
||||||
|
cursor: help;
|
||||||
|
transition: background 0.1s;
|
||||||
|
}
|
||||||
|
[data-theme="dark"] .timeline-hole {
|
||||||
|
background: repeating-linear-gradient(
|
||||||
|
45deg,
|
||||||
|
transparent 0 4px,
|
||||||
|
rgba(255, 255, 255, 0.04) 4px 8px
|
||||||
|
);
|
||||||
|
}
|
||||||
|
.timeline-hole:hover {
|
||||||
|
background: var(--ok-soft);
|
||||||
}
|
}
|
||||||
|
|
||||||
.interv-time {
|
/* Blocs occupés : couleurs selon type */
|
||||||
font-weight: 600;
|
.timeline-slot {
|
||||||
color: #1e40af;
|
position: absolute;
|
||||||
font-size: 14px;
|
top: 0;
|
||||||
font-variant-numeric: tabular-nums;
|
bottom: 0;
|
||||||
white-space: nowrap;
|
cursor: help;
|
||||||
|
transition: filter 0.1s;
|
||||||
|
border-right: 1px solid var(--bg-elevated);
|
||||||
}
|
}
|
||||||
|
|
||||||
.interv-ref {
|
.timeline-slot.color-livraison { background: var(--c-livraison); }
|
||||||
font-size: 12px;
|
.timeline-slot.color-recup { background: var(--c-recup); }
|
||||||
color: #6b7280;
|
.timeline-slot.color-remplacement { background: var(--c-remplacement); }
|
||||||
font-family: ui-monospace, "SF Mono", Consolas, monospace;
|
.timeline-slot.color-autre { background: var(--c-autre); }
|
||||||
|
|
||||||
|
.timeline-slot.kind-absence {
|
||||||
|
background: repeating-linear-gradient(
|
||||||
|
45deg,
|
||||||
|
var(--text-faint) 0 6px,
|
||||||
|
var(--bg-muted) 6px 12px
|
||||||
|
);
|
||||||
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.interv-summary {
|
.timeline-slot:hover,
|
||||||
font-size: 13px;
|
.timeline-slot.highlight {
|
||||||
color: #374151;
|
filter: brightness(1.12);
|
||||||
|
outline: 2px solid var(--text);
|
||||||
|
outline-offset: -2px;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ligne de midi : marqueur vertical discret */
|
||||||
|
.timeline-noon {
|
||||||
|
position: absolute;
|
||||||
|
top: -2px;
|
||||||
|
bottom: -2px;
|
||||||
|
width: 1px;
|
||||||
|
background: var(--border-strong);
|
||||||
|
z-index: 1;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeline-scale {
|
||||||
|
position: relative;
|
||||||
|
height: 14px;
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
line-height: 1.4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.interv-contact {
|
.timeline-tick {
|
||||||
|
position: absolute;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
font-size: 10px;
|
||||||
|
color: var(--text-faint);
|
||||||
|
font-family: var(--mono);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Stats par carte : total en gros, matin/aprem en secondaire */
|
||||||
|
.card-stats {
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 10px 14px;
|
||||||
|
background: var(--bg-muted);
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
.stat-total {
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
.stat-total-num {
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--text);
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
.stat-total-lbl {
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
.stat-split {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-faint);
|
||||||
|
}
|
||||||
|
.stat-split-item b {
|
||||||
|
color: var(--text-muted);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
.stat-split-sep {
|
||||||
|
opacity: 0.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Note de statut pompier/absent en haut de carte */
|
||||||
|
.card-status-note {
|
||||||
|
padding: 8px 14px;
|
||||||
|
font-size: 12px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.card-status-note.pompier {
|
||||||
.interv-location {
|
background: var(--danger-soft);
|
||||||
color: #6b7280;
|
color: var(--danger);
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
}
|
}
|
||||||
|
.card-status-note.absent {
|
||||||
.interv-details {
|
background: var(--bg);
|
||||||
margin-top: 12px;
|
color: var(--text-muted);
|
||||||
padding: 12px;
|
border-bottom: 1px solid var(--border);
|
||||||
background: #f9fafb;
|
|
||||||
border-radius: 6px;
|
|
||||||
font-size: 13px;
|
|
||||||
line-height: 1.6;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
max-height: 400px;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.interv-details.loading {
|
|
||||||
color: #9ca3af;
|
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
.interv-details.error {
|
.card-empty.subtle {
|
||||||
color: #991b1b;
|
|
||||||
background: #fef2f2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.interv-open-link {
|
|
||||||
display: inline-block;
|
|
||||||
margin-top: 8px;
|
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #2563eb;
|
opacity: 0.7;
|
||||||
text-decoration: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.interv-open-link:hover {
|
/* Highlight réciproque */
|
||||||
text-decoration: underline;
|
.intervention.highlight {
|
||||||
|
background: var(--bg-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* === Absence item (affichée dans la carte du tech absent) === */
|
/* ==========================================================================
|
||||||
.absence-info {
|
Interventions (lignes dans la carte)
|
||||||
padding: 12px 18px;
|
========================================================================== */
|
||||||
font-size: 14px;
|
.intervention {
|
||||||
color: #78350f;
|
display: flex;
|
||||||
background: #fef3c7;
|
align-items: center;
|
||||||
border-left: 3px solid #f59e0b;
|
gap: 10px;
|
||||||
|
padding: 8px 14px 8px 10px;
|
||||||
|
border-top: 1px solid var(--border);
|
||||||
|
cursor: default;
|
||||||
|
transition: background 0.08s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pompier-info {
|
.intervention:first-child {
|
||||||
padding: 12px 18px;
|
border-top: none;
|
||||||
font-size: 14px;
|
}
|
||||||
color: #7f1d1d;
|
|
||||||
background: #fee2e2;
|
.intervention:hover {
|
||||||
border-left: 3px solid #dc2626;
|
background: var(--bg-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Pastille colorée à gauche, rappel visuel du type */
|
||||||
|
.intervention-dot {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 4px;
|
||||||
|
align-self: stretch;
|
||||||
|
margin: 2px 4px 2px 0;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
.intervention.color-livraison .intervention-dot { background: var(--c-livraison); }
|
||||||
|
.intervention.color-recup .intervention-dot { background: var(--c-recup); }
|
||||||
|
.intervention.color-remplacement .intervention-dot { background: var(--c-remplacement); }
|
||||||
|
.intervention.color-autre .intervention-dot { background: var(--c-autre); }
|
||||||
|
|
||||||
|
.intervention-time {
|
||||||
|
flex-shrink: 0;
|
||||||
|
font-family: var(--mono);
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
min-width: 86px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.intervention-content {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* La référence S260xxx_xxxxx est mise en avant */
|
||||||
|
.intervention-refhdr {
|
||||||
|
font-family: var(--mono);
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--text);
|
||||||
|
letter-spacing: 0.02em;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.intervention-refhdr.no-ref {
|
||||||
|
font-family: var(--font);
|
||||||
|
font-weight: normal;
|
||||||
|
color: var(--text-faint);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Titre type d'intervention en secondaire */
|
||||||
|
.intervention-title {
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-muted);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* === Tooltip flottant === */
|
.intervention-meta {
|
||||||
|
font-size: 11px;
|
||||||
|
color: var(--text-faint);
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.intervention-copy {
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding: 4px 8px;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text-faint);
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 12px;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.1s, background 0.1s, color 0.1s;
|
||||||
|
font-family: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.intervention:hover .intervention-copy {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.intervention-copy:hover {
|
||||||
|
background: var(--bg-muted);
|
||||||
|
color: var(--text);
|
||||||
|
border-color: var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.intervention-copy.copied {
|
||||||
|
color: var(--ok);
|
||||||
|
background: var(--ok-soft);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Intervention de type pompier */
|
||||||
|
.intervention.is-pompier-line .intervention-time {
|
||||||
|
color: var(--danger);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Tooltip au survol
|
||||||
|
========================================================================== */
|
||||||
.tooltip {
|
.tooltip {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
background: #1f2937;
|
z-index: 100;
|
||||||
color: white;
|
max-width: 420px;
|
||||||
padding: 12px 14px;
|
padding: 12px 14px;
|
||||||
border-radius: 6px;
|
background: var(--bg-elevated);
|
||||||
|
color: var(--text);
|
||||||
|
border: 1px solid var(--border-strong);
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: var(--shadow-hover);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
max-width: 400px;
|
|
||||||
z-index: 1000;
|
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
white-space: pre-wrap;
|
opacity: 0;
|
||||||
box-shadow: 0 4px 12px rgba(0,0,0,0.2);
|
transition: opacity 0.1s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* === Responsive === */
|
.tooltip.visible {
|
||||||
@media (max-width: 768px) {
|
opacity: 1;
|
||||||
.topbar {
|
|
||||||
padding: 16px 20px;
|
|
||||||
}
|
}
|
||||||
.summary, #main-content {
|
|
||||||
margin: 20px 16px;
|
.tooltip dl {
|
||||||
|
margin: 0;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: auto 1fr;
|
||||||
|
column-gap: 10px;
|
||||||
|
row-gap: 4px;
|
||||||
}
|
}
|
||||||
.tech-grid {
|
|
||||||
grid-template-columns: 1fr;
|
.tooltip dt {
|
||||||
|
color: var(--text-muted);
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tooltip dd {
|
||||||
|
margin: 0;
|
||||||
|
color: var(--text);
|
||||||
|
font-size: 13px;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tooltip dd.description {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tooltip hr {
|
||||||
|
border: none;
|
||||||
|
border-top: 1px solid var(--border);
|
||||||
|
margin: 8px 0;
|
||||||
|
grid-column: 1 / -1;
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-30
@@ -1,49 +1,34 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="fr">
|
<html lang="fr">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="utf-8">
|
||||||
<title>Planning Techniciens — Vue claire</title>
|
<title>Planning techniciens</title>
|
||||||
<link rel="stylesheet" href="viewer.css">
|
<link rel="stylesheet" href="viewer.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header class="topbar">
|
<header class="topbar">
|
||||||
<div class="topbar-left">
|
<div class="topbar-left">
|
||||||
<h1>📅 Planning du <span id="display-date">—</span></h1>
|
<h1>Planning techniciens</h1>
|
||||||
<div class="subtitle" id="subtitle">Chargement…</div>
|
<span id="capture-info" class="capture-info"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="topbar-right">
|
<div class="topbar-right">
|
||||||
<button id="btn-refresh" title="Recharger depuis la page EasyVista">
|
<button id="refresh-btn" class="btn" title="Revenir sur EasyVista pour recapturer le planning">
|
||||||
🔄 Actualiser
|
↻ Rafraîchir
|
||||||
</button>
|
</button>
|
||||||
<button id="btn-preload" title="Pré-charger tous les détails d'interventions (22 requêtes)">
|
<button id="theme-toggle" class="btn btn-icon" title="Changer de thème" aria-label="Changer de thème">
|
||||||
📥 Charger tous les détails
|
<span id="theme-icon">🌙</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div id="error-zone" class="error-zone hidden"></div>
|
<main id="main">
|
||||||
|
<div id="error-box" class="error-box hidden"></div>
|
||||||
<section id="summary" class="summary hidden">
|
<div id="loading" class="loading">Chargement…</div>
|
||||||
<div class="summary-card summary-pompier">
|
<div id="stats" class="stats hidden"></div>
|
||||||
<div class="summary-label">🚒 Pompier du jour</div>
|
<div id="cards" class="cards"></div>
|
||||||
<div class="summary-value" id="pompier-name">—</div>
|
|
||||||
</div>
|
|
||||||
<div class="summary-card summary-absents">
|
|
||||||
<div class="summary-label">❌ Absents</div>
|
|
||||||
<div class="summary-value" id="absents-list">—</div>
|
|
||||||
</div>
|
|
||||||
<div class="summary-card summary-stats">
|
|
||||||
<div class="summary-label">🔧 Interventions</div>
|
|
||||||
<div class="summary-value" id="stats-interv">—</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<main id="main-content">
|
|
||||||
<div class="placeholder">Le planning va s'afficher ici.</div>
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<!-- Tooltip pour le survol -->
|
<div id="tooltip" class="tooltip hidden" role="tooltip"></div>
|
||||||
<div id="tooltip" class="tooltip hidden"></div>
|
|
||||||
|
|
||||||
<script src="viewer.js"></script>
|
<script src="viewer.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user