-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalyze.html
More file actions
278 lines (243 loc) · 14 KB
/
Copy pathanalyze.html
File metadata and controls
278 lines (243 loc) · 14 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>AuraMirror — Beauty Mirror Dashboard</title>
<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=Poppins:wght@400;500;600;700&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="assets/css/style.css" />
<!-- Third-party libs (UMD globals) -->
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/face_mesh/face_mesh.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/jspdf@2.5.1/dist/jspdf.umd.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js" crossorigin="anonymous"></script>
</head>
<body>
<div class="bg-shapes" aria-hidden="true">
<span></span><span></span><span></span><span></span>
</div>
<div class="container">
<header class="dash-header">
<a class="brand" href="index.html">
<span class="logo">✨</span> AuraMirror
</a>
<div class="header-actions">
<select id="langSelect" class="lang-select" aria-label="Language / भाषा">
<option value="en">English</option>
<option value="hi">हिन्दी</option>
<option value="fr">Français</option>
<option value="es">Español</option>
<option value="ar">العربية</option>
</select>
<a class="btn btn-secondary" href="index.html" data-i18n="nav.home">← Home</a>
</div>
</header>
<!-- Status / loader bar -->
<div class="status-bar glass" id="statusBar"></div>
<div class="dashboard">
<!-- ============ LEFT: Input ============ -->
<aside class="panel glass panel-left">
<h2 data-i18n="panel.photo">📷 Your Photo</h2>
<div class="input-tabs">
<button class="btn-ghost active" id="tabUpload" type="button" data-i18n="tab.upload">Upload</button>
<button class="btn-ghost" id="tabWebcam" type="button" data-i18n="tab.webcam">Webcam</button>
</div>
<!-- Upload mode -->
<div id="uploadMode">
<div class="drop-zone" id="dropZone" tabindex="0" role="button"
aria-label="Upload an image">
<div class="big">⬆️</div>
<p>Drag & drop or <strong>click to browse</strong><br />
<small>jpg · jpeg · png · webp</small></p>
</div>
<input type="file" id="fileInput" accept="image/jpeg,image/png,image/webp" class="hidden" />
</div>
<!-- Webcam mode -->
<div id="webcamMode" class="hidden">
<div class="webcam-wrap">
<video id="video" autoplay playsinline muted></video>
<canvas id="liveCanvas" class="live-overlay hidden"></canvas>
<canvas id="captureCanvas" class="hidden"></canvas>
</div>
<div class="cam-controls">
<button class="btn btn-secondary" id="startCam" type="button" data-i18n="cam.start">Start Camera</button>
<button class="btn btn-primary hidden" id="snap" type="button" data-i18n="cam.capture">📸 Capture</button>
<button class="btn btn-secondary hidden" id="retake" type="button" data-i18n="cam.retake">Retake</button>
<button class="btn btn-secondary hidden" id="liveBtn" type="button" data-i18n="cam.live">🔴 Live Mirror</button>
</div>
<div class="live-badge hidden" id="liveBadge">
<span class="live-dot"></span>
<span id="liveText">Looking for a face…</span>
</div>
</div>
<div class="preview-thumb hidden" id="previewThumb"></div>
<button class="btn btn-primary hidden" id="analyzeBtn" type="button"
style="width:100%;margin-top:1rem;justify-content:center;" data-i18n="btn.analyze">
✨ Analyze Face
</button>
<!-- History / progress -->
<div class="history-block">
<div class="history-head">
<span class="section-title" style="margin:0;" data-i18n="history.title">📁 History</span>
<div class="history-actions">
<button class="btn-ghost" id="compareBtn" type="button" title="Compare two scans" data-i18n="history.compare">Compare</button>
<button class="btn-ghost" id="exportHistory" type="button" title="Export JSON" data-i18n="history.export">Export</button>
<button class="btn-ghost" id="clearHistory" type="button" title="Delete all" data-i18n="history.clear">Clear</button>
</div>
</div>
<p class="history-note" data-i18n="history.note">Saved on this device — scores only, never your photo.</p>
<ul class="history-list" id="historyList"></ul>
<div class="trend-wrap hidden" id="trendWrap">
<span class="section-title" data-i18n="history.trend">📈 Progress trend</span>
<div class="chart-box"><canvas id="trendChart"></canvas></div>
</div>
</div>
</aside>
<!-- ============ CENTER: Stage ============ -->
<section class="panel glass panel-center">
<h2 data-i18n="panel.preview">🔬 Preview & Overlays</h2>
<!-- quality / pose gate banner -->
<div class="quality-banner hidden" id="qualityBanner">
<strong data-i18n="quality.title">⚠️ Photo tips for a more accurate read</strong>
<ul id="qualityList"></ul>
<button class="btn btn-secondary" id="analyzeAnyway" type="button" data-i18n="quality.anyway">Analyze anyway</button>
</div>
<div class="stage" id="stage">
<div class="empty-hint" id="stageHint" data-i18n="stage.hint">
Upload or capture a clear, front-facing photo to begin.
</div>
<img class="base hidden" id="stageImg" alt="Analyzed face" />
<canvas class="overlay hidden" id="overlayCanvas"></canvas>
</div>
<div class="overlay-toggles" id="overlayToggles" hidden>
<button class="btn-ghost active" data-layer="landmarks" type="button" data-i18n="toggle.landmarks">Landmarks</button>
<button class="btn-ghost active" data-layer="ratio" type="button" data-i18n="toggle.ratio">Golden Ratio</button>
<button class="btn-ghost active" data-layer="symmetry" type="button" data-i18n="toggle.symmetry">Symmetry Axis</button>
<button class="btn-ghost" data-layer="mask" type="button" data-i18n="toggle.mask">φ Mask</button>
<button class="btn-ghost" data-layer="heatmap" type="button" data-i18n="toggle.heatmap">🌡️ Heatmap</button>
</div>
<p class="heatmap-legend hidden" id="heatmapLegend">
<span class="sw sw-good"></span> healthy
<span class="sw sw-mid"></span> moderate
<span class="sw sw-bad"></span> needs care
</p>
</section>
<!-- ============ RIGHT: Results ============ -->
<aside class="panel glass panel-right">
<h2 data-i18n="panel.results">📊 Analysis Results</h2>
<div id="resultsEmpty" class="results-empty" data-i18n="results.empty">
Your facial-harmony report will appear here after analysis.
</div>
<div id="results" class="hidden">
<!-- twin headline rings: Beauty + Skin -->
<div class="score-duo">
<div class="score-ring" id="scoreRing">
<div><b id="overallScore">0</b><small data-i18n="ring.beauty">Beauty</small></div>
</div>
<div class="score-ring skin" id="skinRing">
<div><b id="skinScore">0</b><small data-i18n="ring.skin">Skin</small></div>
</div>
</div>
<div class="chip-row">
<span class="chip" id="faceShapeChip">Face shape: —</span>
<span class="chip" id="skinTypeChip">Skin type: —</span>
<span class="chip" id="skinAgeChip">Skin age: —</span>
<span class="chip" id="toneChip">Tone: —</span>
<span class="chip" id="acneChip">Acne: —</span>
<span class="chip" id="glogauChip">Aging: —</span>
<span class="chip" id="baumannChip">Baumann: —</span>
</div>
<div class="consistency hidden" id="consistencyBadge"></div>
<div class="section-title" data-i18n="section.harmony">Harmony breakdown</div>
<div id="metrics"></div>
<div class="section-title" data-i18n="section.radar">Radar</div>
<div class="chart-box radar"><canvas id="radarChart"></canvas></div>
<div class="section-title" data-i18n="section.skin">🔬 Skin analysis</div>
<div id="skinMetrics" class="skin-grid"></div>
<div class="section-title" data-i18n="section.clinical">🩺 Clinical scale estimates</div>
<div id="clinicalScales" class="clinical-scales"></div>
<div class="section-title" data-i18n="section.strengths">Strengths</div>
<ul class="list-clean good" id="strengths"></ul>
<div class="section-title" data-i18n="section.improve">Areas to Explore</div>
<ul class="list-clean warn" id="improvements"></ul>
<p class="ratio-note" id="ratioNote" data-i18n="ratio.note">
ⓘ The golden ratio is a classical aesthetic convention, not a scientific
law — treat scores as playful guidance, not fact.
</p>
<div class="section-title" data-i18n="section.recommend">Recommendations</div>
<div id="recommendations"></div>
<div class="section-title" data-i18n="section.routine">✨ Glow-up routine</div>
<div id="skincare"></div>
<div class="section-title" data-i18n="section.ingredients">🧪 Ingredients to look for</div>
<div id="ingredientPlan" class="ingredient-plan"></div>
<div class="scan-tag">
<label for="scanTag" data-i18n="tag.label">🏷️ Label this scan (optional)</label>
<input type="text" id="scanTag" maxlength="60"
placeholder="e.g. eczema flare, post-peel day 3" data-i18n-ph="tag.ph" />
</div>
<div class="result-actions">
<button class="btn btn-primary" id="downloadBtn" type="button" data-i18n="btn.pdf">📄 PDF Report</button>
<button class="btn btn-secondary" id="shareBtn" type="button" data-i18n="btn.share">📤 Share Card</button>
<button class="btn btn-secondary" id="moleBtn" type="button" data-i18n="btn.mole">🔎 Mole Check</button>
</div>
<p class="disclaimer" style="margin:1rem 0 0;padding:0.8rem;" data-i18n="disclaimer.main">
Harmony metrics describe geometry & balance only — not attractiveness.
Skincare tips are general guidance, not medical advice.
</p>
</div>
</aside>
</div>
</div>
<!-- ============ Before / After comparison ============ -->
<div class="modal-overlay hidden" id="compareModal" role="dialog" aria-modal="true" aria-label="Compare scans">
<div class="modal glass">
<div class="modal-head">
<h3 data-i18n="compare.title">📊 Compare Two Scans</h3>
<button class="chat-icon" id="compareClose" type="button" aria-label="Close">✕</button>
</div>
<div class="compare-picks">
<label><span data-i18n="compare.from">Earlier</span><select id="compareA"></select></label>
<label><span data-i18n="compare.to">Later</span><select id="compareB"></select></label>
</div>
<div class="compare-body" id="compareBody"></div>
</div>
</div>
<!-- ============ Mole / spot self-check (ABCDE) ============ -->
<div class="modal-overlay hidden" id="moleModal" role="dialog" aria-modal="true" aria-label="Mole self-check">
<div class="modal glass">
<div class="modal-head">
<h3 data-i18n="mole.title">🔎 Mole / Spot Self-Check</h3>
<button class="chat-icon" id="moleClose" type="button" aria-label="Close">✕</button>
</div>
<p class="mole-intro" data-i18n="mole.intro">Answer about <strong>one</strong> spot you want to check. This teaches the ABCDE warning
signs — it is <strong>not a diagnosis</strong> and not a medical device.</p>
<div class="mole-questions" id="moleQuestions"></div>
<button class="btn btn-primary" id="moleCheckBtn" type="button" style="width:100%;justify-content:center;" data-i18n="mole.check">Check this spot</button>
<div class="mole-result hidden" id="moleResult"></div>
<p class="mole-disc" id="moleDisc"></p>
</div>
</div>
<!-- ============ AI Beauty Assistant (on-device) ============ -->
<button class="chat-fab" id="chatFab" type="button" aria-label="Open beauty assistant">💬</button>
<div class="chat-panel glass hidden" id="chatPanel" role="dialog" aria-label="AI Beauty Assistant">
<div class="chat-head">
<span data-i18n="chat.title">✨ Beauty Assistant</span>
<div class="chat-head-actions">
<button class="chat-icon" id="chatVoiceOut" type="button" title="Speak replies aloud" aria-pressed="false">🔊</button>
<button class="chat-icon" id="chatClose" type="button" aria-label="Close assistant">✕</button>
</div>
</div>
<div class="chat-messages" id="chatMessages"></div>
<div class="chat-quick" id="chatQuick"></div>
<div class="chat-input-row">
<button class="chat-icon" id="chatMic" type="button" title="Voice input" aria-label="Voice input">🎤</button>
<input type="text" id="chatInput" placeholder="Ask about your results…" autocomplete="off" data-i18n-ph="chat.placeholder" />
<button class="btn btn-primary chat-send" id="chatSend" type="button" data-i18n="chat.send">Send</button>
</div>
<p class="chat-note" data-i18n="chat.note">Private & on-device · guidance, not medical advice</p>
</div>
<script type="module" src="assets/js/app.js"></script>
</body>
</html>