Boucle du Hainaut : application de réalité augmentée (v46)

PWA three.js + LocAR : pylônes et câbles de la ligne 380 kV sur le tracé
projeté, à l'échelle réelle, cachés par le relief (SPW 10 m), les obstacles
LiDAR (1/2/4 m) et les bâtiments OpenStreetMap. Photo avant/après, calage
de la vue, mini-carte, hors-ligne complet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mathieuandClaude Opus 5.5 committed 2026-11-15 22:19:19 +01:00
commit 3662fd4993
3571 files changed
+83668

No files matched your search

+171
View File
@@ -0,0 +1,171 @@
html, body {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
color: #fff;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
-webkit-user-select: none;
user-select: none;
touch-action: none;
}
/* Fond noir UNIQUEMENT sur <html> : la vidéo caméra créée par LocAR a un z-index négatif ;
un fond sur <body> serait peint par-dessus et masquerait la vidéo (écran noir). */
html { background: #000; }
body { background: transparent; }
[hidden] { display: none !important; }
/* Le canvas three.js créé par LocAR a un z-index de 999 : l'interface passe au-dessus. */
.panel, #hud, #bar { z-index: 2000; }
.panel {
position: fixed;
inset: 0;
display: flex;
flex-direction: column;
justify-content: center;
padding: 24px max(16px, env(safe-area-inset-left));
background: #10161c;
overflow-y: auto;
}
.panel h1 { margin: 0 0 4px; font-size: 1.6rem; }
.panel .sub { margin: 0 0 16px; color: #b8c4cf; }
.panel ul { padding-left: 1.2em; line-height: 1.5; color: #dde4ea; }
button {
font: inherit;
border: 0;
border-radius: 10px;
padding: 12px 16px;
background: #2d7ff9;
color: #fff;
cursor: pointer;
}
button:disabled { opacity: .5; }
#start { font-size: 1.2rem; padding: 16px; margin-top: 12px; }
.error { color: #ff8a80; white-space: pre-line; }
.small { font-size: .8rem; color: #9aa7b3; }
#hud {
position: fixed;
top: 0; left: 0; right: 0;
padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
background: rgba(0, 0, 0, .55);
font-size: .85rem;
line-height: 1.45;
cursor: pointer;
}
#hud .k { display: inline-block; width: 5.2em; color: #9aa7b3; }
#hud .hint { font-size: 1.1rem; font-weight: 600; margin-top: 2px; }
.warn { color: #ffd54f; }
.bad { color: #ff8a80; }
#bar {
position: fixed;
left: 0; right: 0; bottom: 0;
padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
background: rgba(0, 0, 0, .55);
display: flex;
flex-wrap: wrap;
gap: 8px;
}
#bar button { flex: 1 1 auto; padding: 10px 12px; font-size: .9rem; }
#settings { flex-basis: 100%; font-size: .85rem; }
#settings summary { cursor: pointer; color: #b8c4cf; }
#settings input { width: 100%; }
#btn-color { background: #44505c; margin: 6px 0; width: 100%; }
#hud { max-height: 45vh; overflow: hidden; }
#hud .ver { display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 6px; margin-right: 6px; border-radius: 6px; background: #44505c; color: #dde4ea; vertical-align: middle; }
#settings select { width: 100%; font: inherit; padding: 8px; margin: 4px 0 6px; border-radius: 8px; background: #2a333c; color: #fff; border: 1px solid #44505c; }
#btn-toggle { background: #c84600; }
#shot { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.92); display: flex; flex-direction: column;
padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); gap: 10px; }
#shot img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
#shot .shot-actions { display: flex; gap: 8px; }
#shot .shot-actions button { flex: 1; }
#shot-close { background: #44505c; }
#minimap { position: fixed; right: 10px; bottom: calc(150px + env(safe-area-inset-bottom)); width: 150px; height: 150px;
z-index: 2000; border-radius: 50%; touch-action: manipulation; }
#settings input[type=checkbox] { width: auto; margin-right: 6px; }
/* Bandeau réduit : seulement la version + « Tourne à… » (toucher pour rouvrir) */
#hud.compact > div:not(.hint):not(#h-err) { display: none; }
#hud.compact { padding-bottom: 6px; }
/* Étiquettes de distance (au-dessus du rendu 3D, sous le bandeau et les boutons) */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 1500; overflow: hidden; }
.plabel { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 12px; font-weight: 600; color: #fff;
background: rgba(0,0,0,.6); border: 1px solid #ff6a00; border-radius: 8px; padding: 1px 6px; }
/* La barre du bas (et Réglages ouvert) passe au-dessus de la mini-carte */
#bar { z-index: 2100; }
#bar:has(#settings[open]) { background: rgba(16, 22, 28, .96); }
#settings label { display: block; margin: 6px 0; }
#off-dl, #off-clear { width: 100%; margin: 6px 0; }
#off-clear { background: #44505c; }
/* Réglages ouverts : le panneau peut défiler (le reste de la page bloque les gestes pour la vue AR),
le titre « Réglages ✕ » reste épinglé en haut pour fermer. */
#bar:has(#settings[open]) { box-sizing: border-box; max-height: calc(100dvh - env(safe-area-inset-top) - 8px); overflow-y: auto;
touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#settings[open] > summary { position: sticky; top: -8px; z-index: 1; margin: -8px -12px 4px; padding: 12px;
background: rgba(16, 22, 28, .98); border-bottom: 1px solid #44505c; font-weight: 600; color: #fff;
list-style: none; display: flex; justify-content: space-between; }
#settings[open] > summary::-webkit-details-marker { display: none; }
#settings[open] > summary::after { content: "✕ Fermer"; font-weight: 400; color: #b8c4cf; }
#settings-close { width: 100%; margin: 10px 0 4px; background: #44505c; }
/* Barre du bas : « Photo » à gauche, « Masquer » et « Caler » l'un sous l'autre à droite */
#bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#bar #btn-shot { grid-row: span 2; }
#bar #settings, #bar #cal-info { grid-column: 1 / -1; }
#btn-occl { background: #2e7d32; }
#btn-occl.off { background: #44505c; color: #c9d3dc; }
#btn-cal { background: #2e7d32; margin: 0 0 6px; width: 100%; }
#btn-cal.on { background: #ffb300; color: #000; font-weight: 600; }
#cal-done { background: #2e7d32 !important; font-weight: 600; }
/* Proposition de téléchargement */
#dl-ask { position: fixed; inset: 0; z-index: 3500; background: rgba(0,0,0,.75); display: flex; align-items: center; justify-content: center; padding: 16px; }
#dl-ask[hidden] { display: none; }
#dl-ask .dl-box { background: #10161c; border: 1px solid #44505c; border-radius: 12px; padding: 14px; max-width: 420px; width: 100%; font-size: .9rem; line-height: 1.35; }
#dl-choices { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
#dl-choices button { padding: 12px; font-size: .95rem; background: #1565c0; }
#dl-choices button[data-src="lidar2"] { background: #2e7d32; }
.dl-size { opacity: .8; font-size: .85rem; }
#dl-close { width: 100%; padding: 10px; background: #44505c; }
#cal-info { order: -1; display: flex; gap: 8px; align-items: center; font-size: .85rem; line-height: 1.3;
background: rgba(255, 179, 0, .15); border: 1px solid #ffb300; border-radius: 8px; padding: 6px 8px; }
#cal-info[hidden] { display: none; }
#cal-info button { flex: 0 0 auto; padding: 6px 10px; background: #44505c; font-size: .8rem; }
/* Réglages ouverts : page de réglages seule (les boutons de la vue sont cachés) */
#bar:has(#settings[open]) > button, #bar:has(#settings[open]) > #cal-info { display: none; }
/* Section « Expert » repliable à l'intérieur des réglages */
#expert { margin: 10px 0 4px; border: 1px solid #44505c; border-radius: 8px; padding: 4px 10px; }
#expert > summary { cursor: pointer; padding: 8px 0; color: #ffb300; font-weight: 600; }
#expert[open] > summary { border-bottom: 1px solid #44505c; margin-bottom: 6px; }
#bar:has(#settings[open]) { top: 0; align-content: start; background: #10161c; }
/* Ligne d'indication : texte à gauche, bouton « Mini-carte » tout à droite (quand elle est cachée) */
#hud .hint-row { display: flex; align-items: center; gap: 8px; }
#hud .hint-row > span { flex: 1; min-width: 0; }
#btn-mini { flex: 0 0 auto; padding: 6px 10px; font-size: .85rem; font-weight: 600; background: #44505c; }
#occl-prec { border: 1px solid #44505c; border-radius: 8px; margin: 4px 0 8px; padding: 2px 10px 6px; }
#occl-prec legend { font-size: .8rem; color: #9aa7b3; padding: 0 4px; }
#settings input[type=radio] { width: auto; margin-right: 6px; }
/* Crédit de l'écran d'accueil */
.credit a { color: #7cc4ff; font-weight: 600; }
/* Écran d'accueil : contenu centré, mentions (tracé, sources, licences) tout en bas */
#intro { justify-content: flex-start; }
#intro .intro-main { margin: auto 0; }
#intro .legal { margin-top: 16px; padding-top: 10px; border-top: 1px solid #2a333c; font-size: .7rem; line-height: 1.4; color: #7f8b96; }
#intro #start { width: 100%; }