-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
454 lines (408 loc) · 25.4 KB
/
index.html
File metadata and controls
454 lines (408 loc) · 25.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
<!DOCTYPE html>
<html lang="fr" class="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>AquaMetric | Système d'Audit Hydrique Avancé</title>
<!-- Favicon Premium 2026 (SVG Data URI) - Signature visuelle haute performance -->
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%2300f0ff'/%3E%3Cstop offset='100%25' stop-color='%237000ff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M16 3C16 3 7 13 7 20a9 9 0 1 0 18 0c0-7-9-17-9-17zm0 21a5 5 0 1 1 0-10 5 5 0 0 1 0 10z' fill='url(%23a)'/%3E%3Cpath d='M16 17v4m-2-2h4' stroke='white' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E">
<!-- Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Chart.js (Stable v4.4.1) -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js"></script>
<!-- Google Fonts: Plus Jakarta Sans -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
<!-- Icons FontAwesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<!-- Configuration Tailwind -->
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
fontFamily: { sans: ['"Plus Jakarta Sans"', 'sans-serif'] },
colors: {
glass: {
100: 'rgba(255, 255, 255, 0.05)',
200: 'rgba(255, 255, 255, 0.1)',
300: 'rgba(255, 255, 255, 0.15)',
border: 'rgba(255, 255, 255, 0.08)',
},
neon: { blue: '#00f0ff', purple: '#7000ff' }
},
animation: {
'blob': 'blob 10s infinite',
'shimmer': 'shimmer 2.5s linear infinite',
},
keyframes: {
blob: {
'0%': { transform: 'translate(0px, 0px) scale(1)' },
'33%': { transform: 'translate(30px, -50px) scale(1.1)' },
'66%': { transform: 'translate(-20px, 20px) scale(0.9)' },
'100%': { transform: 'translate(0px, 0px) scale(1)' },
},
shimmer: { 'from': { backgroundPosition: '0 0' }, 'to': { backgroundPosition: '-200% 0' } }
}
}
}
}
</script>
<!-- LOGIQUE APPLICATIVE CORRIGÉE -->
<script>
function app() {
return {
// États des entrées
inputs: {
people: 1,
showers: 1,
duration: 8,
flushes: 4,
laundry: 3,
dishwasher: 2,
handwash: 1
},
// Coefficients de calcul (Litres)
constants: {
SHOWER_MIN: 12,
FLUSH: 9,
LAUNDRY: 50,
DISHWASHER: 12,
HANDWASH: 15,
BASIC: 10
},
// Résultats calculés
results: {
daily: 0,
monthly: 0,
yearly: 0,
breakdown: [0, 0, 0, 0]
},
chartInstance: null,
systemStatus: 'CONNECTÉ',
isUpdating: false,
// Initialisation du système
initApp() {
this.calculate();
this.$nextTick(() => {
this.initChart();
});
},
// Moteur de calcul
calculate() {
const i = this.inputs;
const c = this.constants;
// Détails par catégorie
const valShowers = i.showers * i.duration * c.SHOWER_MIN;
const valFlushes = i.flushes * c.FLUSH;
const valLaundry = (i.laundry / 7) * c.LAUNDRY;
const valDish = (i.dishwasher / 7) * c.DISHWASHER;
const valHand = i.handwash * c.HANDWASH;
const valBasic = i.people * c.BASIC;
// Sommes globales
this.results.daily = valShowers + valFlushes + valLaundry + valDish + valHand + valBasic;
this.results.monthly = this.results.daily * 30.44;
this.results.yearly = this.results.daily * 365.25;
this.results.breakdown = [valShowers, valFlushes, valLaundry + valDish + valHand, valBasic];
// Mise à jour graphique sécurisée (Throttle via requestAnimationFrame)
if (this.chartInstance && !this.isUpdating) {
this.isUpdating = true;
requestAnimationFrame(() => {
try {
if (this.chartInstance) {
this.chartInstance.data.datasets[0].data = [...this.results.breakdown];
// Utilisation du mode 'none' pour court-circuiter les erreurs de layout lors du redimensionnement
this.chartInstance.update('none');
}
} catch (e) {
console.warn("Chart update deferred");
} finally {
this.isUpdating = false;
}
});
}
},
// Initialisation de Chart.js
initChart() {
const canvas = document.getElementById('waterChart');
if (!canvas) return;
const ctx = canvas.getContext('2d');
if (this.chartInstance) this.chartInstance.destroy();
this.chartInstance = new Chart(ctx, {
type: 'doughnut',
data: {
labels: ['Hygiène', 'Sanitaires', 'Entretien', 'Alimentation'],
datasets: [{
data: [...this.results.breakdown],
backgroundColor: ['#0ea5e9', '#8b5cf6', '#10b981', '#64748b'],
borderWidth: 0,
hoverOffset: 10
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
cutout: '78%',
animation: { duration: 400 },
plugins: {
legend: { display: false },
tooltip: {
backgroundColor: 'rgba(15, 23, 42, 0.95)',
titleFont: { size: 13, weight: 'bold' },
padding: 12,
cornerRadius: 8,
borderColor: 'rgba(255,255,255,0.1)',
borderWidth: 1,
callbacks: {
label: (context) => ` ${context.parsed.toFixed(0)} L / jour`
}
}
}
}
});
},
// Getters pour le score écologique
get ecoScore() {
const perPerson = this.results.daily / (this.inputs.people || 1);
// Référence mondiale : 150L/jour = Score 50
let score = 100 - ((perPerson - 50) * 0.5);
return Math.max(0, Math.min(100, Math.floor(score)));
},
get ecoLabel() {
const s = this.ecoScore;
if (s >= 80) return "Optimal";
if (s >= 60) return "Éco-responsable";
if (s >= 40) return "Standard";
return "Critique";
}
}
}
</script>
<!-- Alpine.js -->
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.13.3/dist/cdn.min.js" defer></script>
<style>
body { background-color: #0f172a; color: #e2e8f0; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
/* Fond Aurora Cyberpunk */
.aurora-bg { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1; background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%); overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.45; animation: blob 15s infinite alternate ease-in-out; }
.orb-1 { top: -15%; left: -15%; width: 60vw; height: 60vw; background: #2563eb; }
.orb-2 { bottom: -15%; right: -15%; width: 60vw; height: 60vw; background: #7c3aed; animation-delay: 2s; }
.orb-3 { top: 30%; left: 30%; width: 40vw; height: 40vw; background: #06b6d4; animation-delay: 4s; }
/* Panneau Glassmorphism Avancé */
.glass-panel {
background: rgba(15, 23, 42, 0.55);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid rgba(255, 255, 255, 0.08);
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}
/* Personnalisation des Sliders */
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none; height: 22px; width: 22px; border-radius: 50%;
background: #ffffff; cursor: pointer; margin-top: -9px;
box-shadow: 0 0 15px rgba(56, 189, 248, 0.5); border: 3px solid #38bdf8;
transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.2); }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; }
/* Utilitaires spécifiques */
.text-neon { text-shadow: 0 0 10px rgba(56, 189, 248, 0.4); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }
</style>
</head>
<body x-data="app()" x-init="initApp()" class="antialiased min-h-screen flex flex-col font-sans">
<!-- Couche visuelle de fond -->
<div class="aurora-bg">
<div class="orb orb-1"></div>
<div class="orb orb-2"></div>
<div class="orb orb-3"></div>
</div>
<!-- Navigation Header -->
<nav class="w-full glass-panel sticky top-0 z-50 border-b border-glass-border">
<div class="max-w-7xl mx-auto px-6 lg:px-12">
<div class="flex items-center justify-between h-20">
<div class="flex items-center gap-4">
<div class="relative w-11 h-11 flex items-center justify-center bg-gradient-to-br from-blue-500 to-purple-600 rounded-2xl shadow-xl shadow-blue-500/20">
<i class="fa-solid fa-droplet text-white text-xl animate-pulse"></i>
</div>
<div>
<h1 class="text-2xl font-extrabold tracking-tight text-white leading-tight">Aqua<span class="text-sky-400">Metric</span></h1>
<div class="flex items-center gap-2">
<span class="relative flex h-2 w-2">
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"></span>
<span class="relative inline-flex rounded-full h-2 w-2 bg-sky-500"></span>
</span>
<span class="text-[10px] uppercase tracking-widest text-sky-300/80 font-bold" x-text="systemStatus"></span>
</div>
</div>
</div>
</div>
</div>
</nav>
<!-- Contenu Principal -->
<main class="flex-grow container mx-auto px-4 py-8 lg:py-14 relative z-10 max-w-7xl">
<div class="grid grid-cols-1 lg:grid-cols-12 gap-8 lg:gap-12">
<!-- Colonne Contrôles (Inputs) -->
<div class="lg:col-span-7 space-y-8">
<div class="glass-panel rounded-[2rem] p-1 overflow-hidden shadow-2xl">
<div class="bg-slate-900/40 p-8 sm:p-10 rounded-[1.8rem]">
<h2 class="text-xl font-bold text-white mb-8 flex items-center gap-3">
<span class="w-8 h-8 rounded-lg bg-sky-500/10 flex items-center justify-center">
<i class="fa-solid fa-sliders text-sky-400 text-sm"></i>
</span>
Audit des Paramètres de Consommation
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-x-12 gap-y-10">
<!-- Personnes -->
<div class="space-y-4">
<div class="flex justify-between items-center">
<label class="text-sm font-semibold text-gray-400 tracking-wide uppercase">Taille du foyer</label>
<span class="text-sky-400 font-bold bg-sky-500/10 px-3 py-1 rounded-lg text-sm border border-sky-500/20" x-text="inputs.people + (inputs.people > 1 ? ' pers.' : ' pers.')"></span>
</div>
<input type="range" min="1" max="10" step="1" x-model="inputs.people" @input="calculate()">
</div>
<!-- Douches -->
<div class="space-y-4">
<div class="flex justify-between items-center">
<label class="text-sm font-semibold text-gray-400 tracking-wide uppercase">Douches / jour</label>
<span class="text-sky-400 font-bold bg-sky-500/10 px-3 py-1 rounded-lg text-sm border border-sky-500/20" x-text="inputs.showers"></span>
</div>
<input type="range" min="0" max="10" step="1" x-model="inputs.showers" @input="calculate()">
</div>
<!-- Durée Douche -->
<div class="md:col-span-2 space-y-4">
<div class="flex justify-between items-center">
<label class="text-sm font-semibold text-gray-400 tracking-wide uppercase">Durée moyenne d'une douche</label>
<span class="text-purple-400 font-bold bg-purple-500/10 px-3 py-1 rounded-lg text-sm border border-purple-500/20" x-text="inputs.duration + ' min'"></span>
</div>
<div class="relative w-full h-1.5 bg-gray-800 rounded-full">
<input type="range" min="1" max="30" step="1" x-model="inputs.duration" class="absolute w-full z-20" @input="calculate()">
<div class="absolute top-0 left-0 h-full bg-gradient-to-r from-sky-500 to-purple-500 rounded-full z-10 transition-all duration-300" :style="'width: ' + ((inputs.duration/30)*100) + '%'"></div>
</div>
<div class="flex justify-between text-[10px] text-gray-500 font-bold uppercase tracking-tighter">
<span>Éco-responsable (5m)</span>
<span>Consommation de luxe (30m)</span>
</div>
</div>
<!-- Chasses d'eau -->
<div class="space-y-4">
<div class="flex justify-between items-center">
<label class="text-sm font-semibold text-gray-400 tracking-wide uppercase">Cycle Sanitaires / j</label>
<span class="text-purple-400 font-bold bg-purple-500/10 px-3 py-1 rounded-lg text-sm border border-purple-500/20" x-text="inputs.flushes"></span>
</div>
<input type="range" min="0" max="20" step="1" x-model="inputs.flushes" @input="calculate()">
</div>
<!-- Lave-Linge -->
<div class="space-y-4">
<div class="flex justify-between items-center">
<label class="text-sm font-semibold text-gray-400 tracking-wide uppercase">Cycles Linge / sem.</label>
<span class="text-emerald-400 font-bold bg-emerald-500/10 px-3 py-1 rounded-lg text-sm border border-emerald-500/20" x-text="inputs.laundry"></span>
</div>
<input type="range" min="0" max="15" step="1" x-model="inputs.laundry" @input="calculate()">
</div>
<!-- Lave-Vaisselle -->
<div class="space-y-4">
<div class="flex justify-between items-center">
<label class="text-sm font-semibold text-gray-400 tracking-wide uppercase">Lave-Vaisselle / sem.</label>
<span class="text-emerald-400 font-bold bg-emerald-500/10 px-3 py-1 rounded-lg text-sm border border-emerald-500/20" x-text="inputs.dishwasher"></span>
</div>
<input type="range" min="0" max="15" step="1" x-model="inputs.dishwasher" @input="calculate()">
</div>
<!-- Vaisselle Main -->
<div class="space-y-4">
<div class="flex justify-between items-center">
<label class="text-sm font-semibold text-gray-400 tracking-wide uppercase">Vaisselle Main / j</label>
<span class="text-emerald-400 font-bold bg-emerald-500/10 px-3 py-1 rounded-lg text-sm border border-emerald-500/20" x-text="inputs.handwash"></span>
</div>
<input type="range" min="0" max="5" step="1" x-model="inputs.handwash" @input="calculate()">
</div>
</div>
</div>
</div>
</div>
<!-- Colonne Visualisation & KPIs -->
<div class="lg:col-span-5 space-y-8">
<!-- Carte KPI Principal -->
<div class="glass-panel rounded-[2rem] p-10 text-center relative overflow-hidden shadow-2xl">
<div class="absolute top-0 left-0 w-full h-1.5 bg-gradient-to-r from-sky-400 via-purple-500 to-sky-400 animate-shimmer bg-[length:200%_100%]"></div>
<h3 class="text-gray-400 text-xs font-bold uppercase tracking-[0.2em] mb-4">Consommation Journalière</h3>
<div class="flex items-baseline justify-center gap-3">
<span class="text-7xl md:text-8xl font-black text-transparent bg-clip-text bg-gradient-to-b from-white to-slate-500 tracking-tighter" x-text="results.daily.toFixed(0)"></span>
<span class="text-2xl font-bold text-slate-400 uppercase">L</span>
</div>
<div class="mt-10 flex justify-center h-[240px]">
<div class="relative w-full h-full">
<canvas id="waterChart"></canvas>
<div class="absolute inset-0 flex flex-col items-center justify-center pointer-events-none translate-y-1">
<span class="text-[10px] text-gray-500 font-black uppercase tracking-widest mb-1">Impact Mensuel</span>
<span class="text-xl font-extrabold text-white tracking-tight" x-text="(results.monthly/1000).toFixed(1) + ' m³'"></span>
</div>
</div>
</div>
</div>
<!-- Statistiques Secondaires -->
<div class="grid grid-cols-2 gap-6">
<div class="glass-panel p-6 rounded-3xl text-center group transition-all duration-300 hover:bg-slate-800/60">
<div class="text-[10px] text-gray-500 font-black uppercase tracking-widest mb-2">Budget Annuel Est.</div>
<div class="text-3xl font-black text-emerald-400 tracking-tighter">
<span x-text="(results.yearly/1000 * 4).toFixed(0)"></span> <span class="text-lg">€</span>
</div>
<div class="text-[9px] text-gray-600 font-bold mt-2 italic">Sur base de 4€/m³</div>
</div>
<div class="glass-panel p-6 rounded-3xl text-center group transition-all duration-300 hover:bg-slate-800/60">
<div class="text-[10px] text-gray-500 font-black uppercase tracking-widest mb-2">Volume Piscines</div>
<div class="text-3xl font-black text-sky-400 tracking-tighter">
<span x-text="(results.yearly / 2500).toFixed(2)"></span>
</div>
<div class="text-[9px] text-gray-600 font-bold mt-2 italic">Équiv. Olympique / an</div>
</div>
</div>
<!-- Statut Écologique -->
<div class="glass-panel p-8 rounded-3xl border border-white/5 relative group overflow-hidden">
<div class="flex items-center gap-6 relative z-10">
<div class="h-16 w-16 rounded-2xl flex items-center justify-center bg-slate-800 border border-white/5 shadow-inner transition-transform duration-500 group-hover:rotate-12">
<i class="fa-solid fa-leaf text-2xl transition-colors duration-500"
:class="ecoScore > 75 ? 'text-green-400' : (ecoScore > 45 ? 'text-yellow-400' : 'text-rose-500')"></i>
</div>
<div class="flex-grow">
<div class="text-[10px] text-gray-500 font-black uppercase tracking-widest mb-1">Indice de Durabilité</div>
<div class="text-xl font-extrabold text-white" x-text="ecoLabel"></div>
</div>
<div class="text-3xl font-black tabular-nums"
:class="ecoScore > 75 ? 'text-green-400' : (ecoScore > 45 ? 'text-yellow-400' : 'text-rose-500')"
x-text="ecoScore + '%'">
</div>
</div>
<!-- Jauge de Progression -->
<div class="w-full bg-slate-800/50 rounded-full h-2.5 mt-8 overflow-hidden p-0.5">
<div class="h-full rounded-full transition-all duration-1000 ease-out shadow-[0_0_15px_rgba(34,197,94,0.3)]"
:class="ecoScore > 75 ? 'bg-green-500' : (ecoScore > 45 ? 'bg-yellow-500' : 'bg-rose-600')"
:style="'width: ' + ecoScore + '%'"></div>
</div>
</div>
</div>
</div>
</main>
<!-- Footer -->
<footer class="w-full border-t border-glass-border bg-slate-900/60 backdrop-blur-xl mt-12 py-8 relative z-50">
<div class="container mx-auto px-6 text-center">
<div class="flex flex-col items-center gap-4">
<p class="text-sm text-gray-400 font-bold tracking-tight">
Optimisé pour 2026 par <span class="text-white hover:text-sky-400 transition-colors cursor-default">Samyn-Antoy ABASSE</span>
</p>
<div class="flex gap-4 text-xs font-black uppercase tracking-widest text-gray-600">
<span>Performance v2.3</span>
<span class="text-sky-500/50">•</span>
<span>Stable Engine</span>
<span class="text-sky-500/50">•</span>
<span>Privacy First</span>
</div>
</div>
</div>
</footer>
</body>
</html>