amirabbox commited on
Commit
4ddf986
·
verified ·
1 Parent(s): 21cc8f7

make the rescan animations smoother. when you click rescan the camera feed box is a bit buggy. i want the buttons to become fade when you click re scan. then the camera feed area becomes full size of the screen, when the scan is done the buttons re fade and become visible again all in very very smooth animation. also the dark mode colors are orange and black, i want the light mode colors to be white and mint green. when you click the dark mode light mode button the colors change to white and mint green and when you click dark mode the colors become what it is now.

Browse files
Files changed (2) hide show
  1. README.md +9 -5
  2. index.html +930 -19
README.md CHANGED
@@ -1,10 +1,14 @@
1
  ---
2
- title: Undefined
3
- emoji: 🌍
4
- colorFrom: pink
5
- colorTo: green
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
1
  ---
2
+ title: undefined
3
+ colorFrom: blue
4
+ colorTo: gray
5
+ emoji: 🐳
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite-v3
10
  ---
11
 
12
+ # Welcome to your new DeepSite project!
13
+ This project was created with [DeepSite](https://deepsite.hf.co).
14
+
index.html CHANGED
@@ -1,19 +1,930 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>SnapCal AI - Real-time Food Analysis</title>
7
+ <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <script src="https://unpkg.com/feather-icons"></script>
11
+ <style>
12
+ @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;700&family=Noto+Sans+Devanagari:wght@400;700&family=Noto+Sans+Hebrew:wght@400;700&family=Noto+Sans+JP:wght@400;700&family=Noto+Sans+KR:wght@400;700&family=Noto+Sans+SC:wght@400;700&family=Noto+Sans+Thai:wght@400;700&family=Noto+Serif:wght@400;700&display=swap');
13
+ body {
14
+ font-family: 'Noto Sans', 'Noto Sans Arabic', 'Noto Sans Devanagari', 'Noto Sans Hebrew', 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans SC', 'Noto Sans Thai', sans-serif;
15
+ background: #1A1A1A;
16
+ color: #D0D0D0;
17
+ margin: 0;
18
+ padding: 0;
19
+ overflow-x: hidden;
20
+ transition: background 0.5s ease, color 0.5s ease;
21
+ text-align: center;
22
+ }
23
+ body.light {
24
+ background: #FFFFFF;
25
+ color: #333;
26
+ --accent-color: #37C2B0; /* Mint green */
27
+ --light-accent: #E0F7F4;
28
+ }
29
+ .neu {
30
+ background: #1A1A1A;
31
+ border-radius: 20px;
32
+ box-shadow: 10px 10px 20px #101010, -10px -10px 20px #242424;
33
+ transition: all 0.5s ease;
34
+ }
35
+ body.light .neu {
36
+ background: #FFFFFF;
37
+ box-shadow: 10px 10px 20px rgba(0,0,0,0.05), -10px -10px 20px #FFFFFF;
38
+ }
39
+ .neu-inset {
40
+ background: #1A1A1A;
41
+ border-radius: 20px;
42
+ box-shadow: inset 10px 10px 20px #101010, inset -10px -10px 20px #242424;
43
+ }
44
+ body.light .neu-inset {
45
+ box-shadow: inset 3px 3px 6px rgba(0,0,0,0.05), inset -3px -3px 6px #FFFFFF;
46
+ background: #FAFAFA;
47
+ }
48
+ .neu-button {
49
+ background: #1A1A1A;
50
+ border: none;
51
+ border-radius: 50px;
52
+ padding: 12px 24px;
53
+ color: #D0D0D0;
54
+ font-weight: bold;
55
+ box-shadow: 5px 5px 10px #101010, -5px -5px 10px #242424;
56
+ transition: all 0.5s ease;
57
+ }
58
+ .neu-button:hover {
59
+ box-shadow: inset 5px 5px 10px #101010, inset -5px -5px 10px #242424;
60
+ transform: translateY(-2px);
61
+ }
62
+ body.light .neu-button {
63
+ background: #FFFFFF;
64
+ color: #333;
65
+ box-shadow: 5px 5px 10px rgba(0,0,0,0.05), -5px -5px 10px #FFFFFF;
66
+ }
67
+ body.light .neu-button:hover {
68
+ box-shadow: inset 3px 3px 6px rgba(0,0,0,0.05), inset -3px -3px 6px #FFFFFF;
69
+ transform: translateY(-2px);
70
+ background: var(--light-accent);
71
+ }
72
+ .accent {
73
+ background: var(--accent-color, linear-gradient(45deg, #FF6B6B, #FFE66D));
74
+ color: #1A1A1A;
75
+ }
76
+ .camera-feed {
77
+ background: #000;
78
+ border: none;
79
+ position: relative;
80
+ overflow: hidden;
81
+ border-radius: 20px;
82
+ transition: height 0.5s ease-in-out;
83
+ }
84
+ .scan-line {
85
+ position: absolute;
86
+ width: 100%;
87
+ height: 3px;
88
+ background: linear-gradient(90deg, transparent, #FFE66D, transparent);
89
+ box-shadow: 0 0 10px #FFE66D;
90
+ animation: scan 2s linear infinite;
91
+ z-index: 10;
92
+ }
93
+ @keyframes scan {
94
+ 0% { top: 0; }
95
+ 100% { top: 100%; }
96
+ }
97
+ .detection-item {
98
+ background: #1A1A1A;
99
+ border-radius: 12px;
100
+ padding: 8px;
101
+ z-index: 20;
102
+ text-align: center;
103
+ box-shadow: 5px 5px 10px #101010, -5px -5px 10px #242424;
104
+ transition: transform 0.3s ease, opacity 0.3s ease;
105
+ }
106
+ body.light .detection-item {
107
+ background: #ECECEC;
108
+ box-shadow: 5px 5px 10px #D4D4D4, -5px -5px 10px #FFFFFF;
109
+ }
110
+ .calorie-badge {
111
+ background: linear-gradient(45deg, #FF6B6B, #FFE66D);
112
+ color: #1A1A1A;
113
+ padding: 2px 8px;
114
+ border-radius: 12px;
115
+ font-size: 12px;
116
+ }
117
+ .progress-bar {
118
+ height: 4px;
119
+ background: #242424;
120
+ border-radius: 2px;
121
+ overflow: hidden;
122
+ }
123
+ body.light .progress-bar {
124
+ background: #D4D4D4;
125
+ }
126
+ .progress-fill {
127
+ height: 100%;
128
+ background: linear-gradient(90deg, #FF6B6B, #FFE66D);
129
+ width: 0%;
130
+ transition: width 0.5s ease-in-out;
131
+ }
132
+ .component-highlight {
133
+ animation: pulse 1.5s infinite ease-in-out;
134
+ border: 2px solid #FFE66D;
135
+ }
136
+ @keyframes pulse {
137
+ 0% { opacity: 0.6; transform: scale(1); }
138
+ 50% { opacity: 1; transform: scale(1.05); }
139
+ 100% { opacity: 0.6; transform: scale(1); }
140
+ }
141
+ .processing-overlay {
142
+ background: rgba(26, 26, 26, 0.9);
143
+ z-index: 30;
144
+ transition: opacity 0.5s ease;
145
+ }
146
+ body.light .processing-overlay {
147
+ background: rgba(236, 236, 236, 0.9);
148
+ }
149
+ .nav-button {
150
+ transition: all 0.6s ease;
151
+ position: relative;
152
+ }
153
+ .fade-in {
154
+ opacity: 0;
155
+ transform: translateY(20px);
156
+ transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
157
+ }
158
+ .fade-in.visible {
159
+ opacity: 1;
160
+ transform: translateY(0);
161
+ }
162
+ #cameraContainer {
163
+ transition: height 0.5s ease-in-out;
164
+ }
165
+ #analysisResults, #navButtons, #footer {
166
+ transition: opacity 0.5s ease-in-out;
167
+ }
168
+ .nav-menu {
169
+ display: none;
170
+ position: absolute;
171
+ bottom: 100%;
172
+ left: 50%;
173
+ transform: translateX(-50%);
174
+ background: #1A1A1A;
175
+ border-radius: 12px;
176
+ padding: 8px;
177
+ min-width: 150px;
178
+ z-index: 40;
179
+ text-align: center;
180
+ box-shadow: 5px 5px 10px #101010, -5px -5px 10px #242424;
181
+ transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
182
+ }
183
+ body.light .nav-menu {
184
+ background: #ECECEC;
185
+ box-shadow: 5px 5px 10px #D4D4D4, -5px -5px 10px #FFFFFF;
186
+ }
187
+ .nav-button:hover .nav-menu {
188
+ display: block;
189
+ opacity: 1;
190
+ transform: translateX(-50%) translateY(-10px);
191
+ }
192
+ .nav-menu li {
193
+ padding: 4px 8px;
194
+ cursor: pointer;
195
+ transition: background 0.3s ease-in-out;
196
+ text-align: center;
197
+ border-radius: 8px;
198
+ }
199
+ .nav-menu li:hover {
200
+ box-shadow: inset 2px 2px 5px #101010, inset -2px -2px 5px #242424;
201
+ }
202
+ body.light .nav-menu li:hover {
203
+ box-shadow: inset 2px 2px 5px #D4D4D4, inset -2px -2px 5px #FFFFFF;
204
+ }
205
+ .modal {
206
+ display: none;
207
+ position: fixed;
208
+ z-index: 50;
209
+ left: 0;
210
+ top: 0;
211
+ width: 100%;
212
+ height: 100%;
213
+ overflow: auto;
214
+ background-color: rgba(0,0,0,0.4);
215
+ animation: fadeIn 0.3s ease-in-out;
216
+ transition: opacity 0.3s ease-in-out;
217
+ }
218
+ .modal.closing {
219
+ opacity: 0;
220
+ }
221
+ @keyframes fadeIn {
222
+ from {opacity: 0;}
223
+ to {opacity: 1;}
224
+ }
225
+ .modal-content {
226
+ background: #1A1A1A;
227
+ margin: 15% auto;
228
+ padding: 20px;
229
+ width: 80%;
230
+ max-width: 600px;
231
+ border-radius: 20px;
232
+ text-align: center;
233
+ animation: slideDown 0.3s ease-in-out;
234
+ transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
235
+ box-shadow: 10px 10px 20px #101010, -10px -10px 20px #242424;
236
+ }
237
+ .modal-content.closing {
238
+ transform: translateY(20px);
239
+ opacity: 0;
240
+ }
241
+ @keyframes slideDown {
242
+ from {transform: translateY(-20px); opacity: 0;}
243
+ to {transform: translateY(0); opacity: 1;}
244
+ }
245
+ body.light .modal-content {
246
+ background: #ECECEC;
247
+ box-shadow: 10px 10px 20px #D4D4D4, -10px -10px 20px #FFFFFF;
248
+ }
249
+ .close {
250
+ color: #aaa;
251
+ float: right;
252
+ font-size: 28px;
253
+ font-weight: bold;
254
+ transition: color 0.3s ease-in-out;
255
+ }
256
+ .close:hover,
257
+ .close:focus {
258
+ color: #FF6B6B;
259
+ text-decoration: none;
260
+ cursor: pointer;
261
+ }
262
+ .theme-toggle {
263
+ cursor: pointer;
264
+ transition: transform 0.3s ease-in-out;
265
+ }
266
+ .theme-toggle:hover {
267
+ transform: scale(1.1);
268
+ }
269
+ .border-black {
270
+ border-color: #000;
271
+ }
272
+ body.light .border-black {
273
+ border-color: #333;
274
+ }
275
+ .bg-white {
276
+ background: #1A1A1A;
277
+ }
278
+ body.light .bg-white {
279
+ background: #ECECEC;
280
+ }
281
+ .text-gray-600 {
282
+ color: #A0A0A0;
283
+ }
284
+ body.light .text-gray-600 {
285
+ color: #666;
286
+ }
287
+ .text-gray-500 {
288
+ color: #808080;
289
+ }
290
+ body.light .text-gray-500 {
291
+ color: #999;
292
+ }
293
+ .hover\:bg-gray-100:hover {
294
+ background: #242424;
295
+ }
296
+ body.light .hover\:bg-gray-100:hover {
297
+ background: #D4D4D4;
298
+ }
299
+ .bg-black {
300
+ background: #242424;
301
+ }
302
+ body.light .bg-black {
303
+ background: #D4D4D4;
304
+ }
305
+ .text-white {
306
+ color: #D0D0D0;
307
+ }
308
+ body.light .text-white {
309
+ color: #333;
310
+ }
311
+ .text-black {
312
+ color: #D0D0D0;
313
+ }
314
+ body.light .text-black {
315
+ color: #333;
316
+ }
317
+ .upgrade-progress {
318
+ height: 10px;
319
+ background: #242424;
320
+ border-radius: 5px;
321
+ overflow: hidden;
322
+ margin-top: 10px;
323
+ }
324
+ .upgrade-progress-fill {
325
+ height: 100%;
326
+ background: linear-gradient(90deg, #FF6B6B, #FFE66D);
327
+ width: 0%;
328
+ transition: width 1s ease-in-out;
329
+ }
330
+ .btn-primary {
331
+ background: #1A1A1A;
332
+ color: #D0D0D0;
333
+ padding: 10px 20px;
334
+ border-radius: 50px;
335
+ cursor: pointer;
336
+ transition: all 0.3s ease-in-out;
337
+ box-shadow: 5px 5px 10px #101010, -5px -5px 10px #242424;
338
+ }
339
+ .btn-primary:hover {
340
+ box-shadow: inset 5px 5px 10px #101010, inset -5px -5px 10px #242424;
341
+ }
342
+ body.light .btn-primary {
343
+ background: #ECECEC;
344
+ color: #333;
345
+ box-shadow: 5px 5px 10px #D4D4D4, -5px -5px 10px #FFFFFF;
346
+ }
347
+ body.light .btn-primary:hover {
348
+ box-shadow: inset 5px 5px 10px #D4D4D4, inset -5px -5px 10px #FFFFFF;
349
+ }
350
+ .success-message {
351
+ color: #FFE66D;
352
+ margin-top: 10px;
353
+ animation: fadeInMessage 0.5s ease-in-out;
354
+ }
355
+ @keyframes fadeInMessage {
356
+ from {opacity: 0; transform: translateY(10px);}
357
+ to {opacity: 1; transform: translateY(0);}
358
+ }
359
+ </style>
360
+ </head>
361
+ <body class="min-h-screen">
362
+ <!-- Header -->
363
+ <header id="header" class="p-4 flex justify-between items-center neu hidden">
364
+ <div class="flex items-center space-x-2">
365
+ <i data-feather="camera" class="text-white"></i>
366
+ <h1 class="text-xl font-bold text-white">SnapCal AI</h1>
367
+ </div>
368
+ <div class="flex space-x-4 items-center">
369
+ <select id="languageSelect" class="p-2 rounded neu-inset bg-transparent text-white">
370
+ <option value="en">English</option>
371
+ <option value="fa">فارسی</option>
372
+ <option value="fr">Français</option>
373
+ <option value="it">Italiano</option>
374
+ <option value="de">Deutsch</option>
375
+ </select>
376
+ <div id="themeToggle" class="p-2 rounded-full neu flex items-center justify-center theme-toggle">
377
+ <i data-feather="sun" class="text-white" id="themeIcon"></i>
378
+ </div>
379
+ <button class="p-2 rounded-full neu">
380
+ <i data-feather="user" class="text-white"></i>
381
+ </button>
382
+ </div>
383
+ </header>
384
+ <main class="container mx-auto px-4 py-8">
385
+ <div class="neu rounded-2xl overflow-hidden">
386
+ <!-- Camera Feed Container -->
387
+ <div id="cameraContainer" class="relative w-full h-screen camera-feed flex items-center justify-center">
388
+ <!-- Live Camera Feed -->
389
+ <div class="absolute inset-0 flex items-center justify-center">
390
+ <div class="text-center z-10">
391
+ <i data-feather="camera" class="w-16 h-16 mx-auto mb-4 text-white"></i>
392
+ <p class="text-lg text-white" data-lang-en="Live Camera Feed" data-lang-fa="فید دوربین زنده" data-lang-fr="Flux de caméra en direct" data-lang-it="Feed della telecamera dal vivo" data-lang-de="Live-Kamera-Feed">Live Camera Feed</p>
393
+ <p class="text-sm text-gray-300" data-lang-en="Point at your food to begin analysis" data-lang-fa="دوربین را به سمت غذای خود بگیرید تا تحلیل آغاز شود" data-lang-fr="Pointez la caméra vers votre nourriture pour commencer l'analyse" data-lang-it="Punta la fotocamera verso il cibo per iniziare l'analisi" data-lang-de="Richten Sie die Kamera auf Ihr Essen, um die Analyse zu starten">Point at your food to begin analysis</p>
394
+ </div>
395
+ </div>
396
+ <!-- Scan Line Effect -->
397
+ <div class="scan-line"></div>
398
+ <!-- Processing Overlay -->
399
+ <div id="processingOverlay" class="processing-overlay absolute inset-0 hidden flex-col items-center justify-center">
400
+ <div class="text-center mb-6 z-20">
401
+ <div class="w-16 h-16 border-4 border-white border-t-transparent rounded-full animate-spin mx-auto mb-4"></div>
402
+ <h3 class="text-xl font-bold" data-lang-en="Analyzing Food..." data-lang-fa="در حال تحلیل غذا..." data-lang-fr="Analyse de la nourriture..." data-lang-it="Analisi del cibo in corso..." data-lang-de="Lebensmittel werden analysiert...">Analyzing Food...</h3>
403
+ <p class="text-gray-600" data-lang-en="Processing image to detect components" data-lang-fa="پردازش تصویر برای تشخیص اجزا" data-lang-fr="Traitement de l'image pour détecter les composants" data-lang-it="Elaborazione dell'immagine per rilevare i componenti" data-lang-de="Verarbeitung des Bildes zur Erkennung der Bestandteile">Processing image to detect components</p>
404
+ </div>
405
+ <div class="w-64 progress-bar">
406
+ <div id="progressFill" class="progress-fill"></div>
407
+ </div>
408
+ </div>
409
+ <!-- Detection Results -->
410
+ <div id="detectionResults" class="absolute inset-0 hidden flex items-center justify-center">
411
+ <div class="text-center z-20">
412
+ <div class="absolute top-1/3 left-1/4 w-24 h-24 border-2 border-white rounded-lg component-highlight"></div>
413
+ <div class="absolute bottom-1/3 right-1/3 w-20 h-20 border-2 border-white rounded-lg component-highlight"></div>
414
+ <div class="absolute top-1/3 left-1/4 transform -translate-x-1/2 -translate-y-1/2">
415
+ <div class="detection-item flex items-center space-x-2 neu-inset">
416
+ <span class="font-semibold" data-lang-en="Pancake" data-lang-fa="پنکیک" data-lang-fr="Crêpe" data-lang-it="Pancake" data-lang-de="Pfannkuchen">Pancake</span>
417
+ <span class="calorie-badge">220 cal</span>
418
+ </div>
419
+ </div>
420
+ <div class="absolute bottom-1/3 right-1/3 transform translate-x-1/2 translate-y-1/2">
421
+ <div class="detection-item flex items-center space-x-2 neu-inset">
422
+ <span class="font-semibold" data-lang-en="Maple Syrup" data-lang-fa="شربت افرا" data-lang-fr="Sirop d'érable" data-lang-it="Sciroppo d'acero" data-lang-de="Ahornsirup">Maple Syrup</span>
423
+ <span class="calorie-badge">52 cal</span>
424
+ </div>
425
+ </div>
426
+ </div>
427
+ </div>
428
+ </div>
429
+
430
+ <!-- Analysis Results -->
431
+ <div id="analysisResults" class="p-6 hidden">
432
+ <div class="flex justify-between items-center mb-6">
433
+ <h2 class="text-2xl font-bold" data-lang-en="Food Analysis" data-lang-fa="تحلیل غذا" data-lang-fr="Analyse alimentaire" data-lang-it="Analisi del cibo" data-lang-de="Lebensmittelanalyse">Food Analysis</h2>
434
+ <div class="flex items-center space-x-2">
435
+ <span class="px-3 py-1 rounded-full text-sm font-medium neu-inset">Live</span>
436
+ <span class="text-sm text-gray-500" data-lang-en="Updated just now" data-lang-fa="به‌روزرسانی شده همین حالا" data-lang-fr="Mis à jour à l'instant" data-lang-it="Aggiornato proprio ora" data-lang-de="Gerade jetzt aktualisiert">Updated just now</span>
437
+ </div>
438
+ </div>
439
+
440
+ <!-- Total Calories -->
441
+ <div class="neu rounded-2xl p-6 mb-6">
442
+ <div class="flex justify-between items-center">
443
+ <div>
444
+ <p class="text-lg text-gray-600" data-lang-en="Total Calories" data-lang-fa="کالری کل" data-lang-fr="Calories totales" data-lang-it="Calorie totali" data-lang-de="Gesamtkalorien">Total Calories</p>
445
+ <p class="text-4xl font-bold">272 kcal</p>
446
+ </div>
447
+ <div class="text-right">
448
+ <p class="text-lg text-gray-600" data-lang-en="Components" data-lang-fa="اجزا" data-lang-fr="Composants" data-lang-it="Componenti" data-lang-de="Komponenten">Components</p>
449
+ <p class="text-4xl font-bold">2</p>
450
+ </div>
451
+ </div>
452
+ </div>
453
+
454
+ <!-- Detected Components -->
455
+ <div class="space-y-4">
456
+ <h3 class="text-lg font-semibold" data-lang-en="Detected Components" data-lang-fa="اجزای تشخیص داده شده" data-lang-fr="Composants détectés" data-lang-it="Componenti rilevati" data-lang-de="Erkannte Komponenten">Detected Components</h3>
457
+
458
+ <div class="flex items-center justify-between p-4 rounded-xl neu">
459
+ <div class="flex items-center space-x-4">
460
+ <div class="w-12 h-12 rounded-lg flex items-center justify-center neu-inset">
461
+ <i data-feather="circle" class="text-white"></i>
462
+ </div>
463
+ <div>
464
+ <h4 class="font-medium" data-lang-en="Pancake" data-lang-fa="پنکیک" data-lang-fr="Crêpe" data-lang-it="Pancake" data-lang-de="Pfannkuchen">Pancake</h4>
465
+ <p class="text-sm text-gray-600" data-lang-en="Flour, egg, milk, butter" data-lang-fa="آرد، تخم‌مرغ، شیر، کره" data-lang-fr="Farine, œuf, lait, beurre" data-lang-it="Farina, uovo, latte, burro" data-lang-de="Mehl, Ei, Milch, Butter">Flour, egg, milk, butter</p>
466
+ </div>
467
+ </div>
468
+ <div class="text-right">
469
+ <p class="font-semibold">220 kcal</p>
470
+ <p class="text-sm text-gray-600" data-lang-en="1 serving" data-lang-fa="1 وعده" data-lang-fr="1 portion" data-lang-it="1 porzione" data-lang-de="1 Portion">1 serving</p>
471
+ </div>
472
+ </div>
473
+
474
+ <div class="flex items-center justify-between p-4 rounded-xl neu">
475
+ <div class="flex items-center space-x-4">
476
+ <div class="w-12 h-12 rounded-lg flex items-center justify-center neu-inset">
477
+ <i data-feather="droplet" class="text-white"></i>
478
+ </div>
479
+ <div>
480
+ <h4 class="font-medium" data-lang-en="Maple Syrup" data-lang-fa="شربت افرا" data-lang-fr="Sirop d'érable" data-lang-it="Sciroppo d'acero" data-lang-de="Ahornsirup">Maple Syrup</h4>
481
+ <p class="text-sm text-gray-600" data-lang-en="Natural sweetener" data-lang-fa="شیرین‌کننده طبیعی" data-lang-fr="Édulcorant naturel" data-lang-it="Edulcorante naturale" data-lang-de="Natürlicher Süßstoff">Natural sweetener</p>
482
+ </div>
483
+ </div>
484
+ <div class="text-right">
485
+ <p class="font-semibold">52 kcal</p>
486
+ <p class="text-sm text-gray-600" data-lang-en="1 tbsp" data-lang-fa="1 قاشق غذاخوری" data-lang-fr="1 cuillère à soupe" data-lang-it="1 cucchiaio" data-lang-de="1 Esslöffel">1 tbsp</p>
487
+ </div>
488
+ </div>
489
+ </div>
490
+
491
+ <!-- Action Buttons -->
492
+ <div class="mt-8 flex flex-col sm:flex-row space-y-4 sm:space-y-0 sm:space-x-4">
493
+ <button id="saveMeal" class="flex-1 neu-button accent flex items-center justify-center space-x-2">
494
+ <i data-feather="save"></i>
495
+ <span data-lang-en="Save Meal" data-lang-fa="ذخیره وعده غذایی" data-lang-fr="Enregistrer le repas" data-lang-it="Salva pasto" data-lang-de="Mahlzeit speichern">Save Meal</span>
496
+ </button>
497
+ <button id="rescan" class="flex-1 neu-button flex items-center justify-center space-x-2">
498
+ <i data-feather="refresh-ccw"></i>
499
+ <span data-lang-en="Rescan" data-lang-fa="اسکن مجدد" data-lang-fr="Rescanner" data-lang-it="Riscansiona" data-lang-de="Erneut scannen">Rescan</span>
500
+ </button>
501
+ </div>
502
+ </div>
503
+ </div>
504
+ </main>
505
+
506
+ <!-- Navigation Buttons -->
507
+ <div id="navButtons" class="fixed bottom-0 left-0 right-0 p-4 hidden neu">
508
+ <div class="flex justify-around">
509
+ <button class="nav-button flex flex-col items-center space-y-1 fade-in neu-button">
510
+ <i data-feather="home" class="w-6 h-6"></i>
511
+ <span class="text-xs" data-lang-en="Home" data-lang-fa="خانه" data-lang-fr="Accueil" data-lang-it="Home" data-lang-de="Startseite">Home</span>
512
+ </button>
513
+ <div class="nav-button flex flex-col items-center space-y-1 fade-in relative neu-button">
514
+ <i data-feather="book" class="w-6 h-6"></i>
515
+ <span class="text-xs" data-lang-en="Dishes" data-lang-fa="غذاها" data-lang-fr="Plats" data-lang-it="Piatti" data-lang-de="Gerichte">Dishes</span>
516
+ <ul class="nav-menu">
517
+ <li data-lang-en="Soup" data-lang-fa="سوپ" data-lang-fr="Soupe" data-lang-it="Zuppa" data-lang-de="Suppe">Soup</li>
518
+ <li data-lang-en="Sandwich" data-lang-fa="ساندویچ" data-lang-fr="Sandwich" data-lang-it="Panino" data-lang-de="Sandwich">Sandwich</li>
519
+ <li data-lang-en="Khoresht" data-lang-fa="خورش" data-lang-fr="Khoresht" data-lang-it="Khoresht" data-lang-de="Khoresht">Khoresht</li>
520
+ <li data-lang-en="Polo" data-lang-fa="پلو" data-lang-fr="Polo" data-lang-it="Polo" data-lang-de="Polo">Polo</li>
521
+ <li data-lang-en="Salad" data-lang-fa="سالاد" data-lang-fr="Salade" data-lang-it="Insalata" data-lang-de="Salat">Salad</li>
522
+ <li data-lang-en="Dessert" data-lang-fa="دسر" data-lang-fr="Dessert" data-lang-it="Dessert" data-lang-de="Dessert">Dessert</li>
523
+ </ul>
524
+ </div>
525
+ <div class="nav-button flex flex-col items-center space-y-1 fade-in relative neu-button">
526
+ <i data-feather="user" class="w-6 h-6"></i>
527
+ <span class="text-xs" data-lang-en="Account" data-lang-fa="حساب کاربری" data-lang-fr="Compte" data-lang-it="Account" data-lang-de="Konto">Account</span>
528
+ <ul class="nav-menu">
529
+ <li onclick="openModal('profileModal')" data-lang-en="Profile" data-lang-fa="پروفایل" data-lang-fr="Profil" data-lang-it="Profilo" data-lang-de="Profil">Profile</li>
530
+ <li onclick="openModal('premiumModal')" data-lang-en="Upgrade to Premium" data-lang-fa="ارتقا به پرمیوم" data-lang-fr="Passer à Premium" data-lang-it="Passa a Premium" data-lang-de="Auf Premium upgraden">Upgrade to Premium</li>
531
+ <li onclick="openModal('historyModal')" data-lang-en="Meal History" data-lang-fa="تاریخچه وعده‌ها" data-lang-fr="Historique des repas" data-lang-it="Cronologia pasti" data-lang-de="Mahlzeitenverlauf">Meal History</li>
532
+ <li onclick="openModal('accountSettingsModal')" data-lang-en="Settings" data-lang-fa="تنظیمات" data-lang-fr="Paramètres" data-lang-it="Impostazioni" data-lang-de="Einstellungen">Settings</li>
533
+ <li onclick="confirmLogout()" data-lang-en="Logout" data-lang-fa="خروج" data-lang-fr="Déconnexion" data-lang-it="Disconnessione" data-lang-de="Abmelden">Logout</li>
534
+ </ul>
535
+ </div>
536
+ <div class="nav-button flex flex-col items-center space-y-1 fade-in relative neu-button">
537
+ <i data-feather="settings" class="w-6 h-6"></i>
538
+ <span class="text-xs" data-lang-en="Settings" data-lang-fa="تنظیمات" data-lang-fr="Paramètres" data-lang-it="Impostazioni" data-lang-de="Einstellungen">Settings</span>
539
+ <ul class="nav-menu">
540
+ <li onclick="openModal('languageModal')" data-lang-en="Language" data-lang-fa="زبان" data-lang-fr="Langue" data-lang-it="Lingua" data-lang-de="Sprache">Language</li>
541
+ <li onclick="openModal('notificationsModal')" data-lang-en="Notifications" data-lang-fa="اعلان‌ها" data-lang-fr="Notifications" data-lang-it="Notifiche" data-lang-de="Benachrichtigungen">Notifications</li>
542
+ <li onclick="openModal('privacyModal')" data-lang-en="Privacy" data-lang-fa="حریم خصوصی" data-lang-fr="Confidentialité" data-lang-it="Privacy" data-lang-de="Datenschutz">Privacy</li>
543
+ <li onclick="openModal('supportModal')" data-lang-en="Help & Support" data-lang-fa="کمک و پشتیبانی" data-lang-fr="Aide & Support" data-lang-it="Aiuto & Supporto" data-lang-de="Hilfe & Support">Help & Support</li>
544
+ <li onclick="openModal('aboutModal')" data-lang-en="About" data-lang-fa="درباره ما" data-lang-fr="À propos" data-lang-it="Informazioni" data-lang-de="Über">About</li>
545
+ </ul>
546
+ </div>
547
+ </div>
548
+ </div>
549
+ <!-- Footer -->
550
+ <footer id="footer" class="py-8 text-center text-gray-600 hidden neu">
551
+ <p data-lang-en="© 2023 SnapCal AI by Team Nora. All rights reserved." data-lang-fa="© ۲۰۲۳ SnapCal AI توسط تیم نورا. همه حقوق محفوظ است." data-lang-fr="© 2023 SnapCal AI par Team Nora. Tous droits réservés." data-lang-it="© 2023 SnapCal AI da Team Nora. Tutti i diritti riservati." data-lang-de="© 2023 SnapCal AI von Team Nora. Alle Rechte vorbehalten.">© 2023 SnapCal AI by Team Nora. All rights reserved.</p>
552
+ <p data-lang-en="Trademark of Team Nora. Rights reserved." data-lang-fa="علامت تجاری تیم نورا. حقوق محفوظ." data-lang-fr="Marque de Team Nora. Droits réservés." data-lang-it="Marchio di Team Nora. Diritti riservati." data-lang-de="Marke von Team Nora. Rechte vorbehalten.">Trademark of Team Nora. Rights reserved.</p>
553
+ </footer>
554
+
555
+ <!-- Modals -->
556
+ <div id="aboutModal" class="modal">
557
+ <div class="modal-content neu">
558
+ <span class="close" onclick="closeModal('aboutModal')">&times;</span>
559
+ <h2 data-lang-en="About Us" data-lang-fa="درباره ما" data-lang-fr="À propos de nous" data-lang-it="Chi siamo" data-lang-de="Über uns">About Us</h2>
560
+ <p data-lang-en="SnapCal AI is developed by Team Nora, a group of passionate developers focused on making healthy eating easier through AI technology." data-lang-fa="SnapCal AI توسط تیم نورا توسعه یافته است، گروهی از توسعه‌دهندگان مشتاق که بر روی آسان کردن خوردن سالم از طریق فناوری هوش مصنوعی تمرکز دارند." data-lang-fr="SnapCal AI est développé par Team Nora, un groupe de développeurs passionnés axés sur la simplification de l'alimentation saine grâce à la technologie IA." data-lang-it="SnapCal AI è sviluppato da Team Nora, un gruppo di sviluppatori appassionati focalizzati sul rendere più facile una dieta sana tramite la tecnologia AI." data-lang-de="SnapCal AI wird von Team Nora entwickelt, einer Gruppe leidenschaftlicher Entwickler, die sich darauf konzentrieren, gesundes Essen durch KI-Technologie zu erleichtern.">SnapCal AI is developed by Team Nora, a group of passionate developers focused on making healthy eating easier through AI technology.</p>
561
+ </div>
562
+ </div>
563
+
564
+ <div id="supportModal" class="modal">
565
+ <div class="modal-content neu">
566
+ <span class="close" onclick="closeModal('supportModal')">&times;</span>
567
+ <h2 data-lang-en="Help & Support" data-lang-fa="کمک و پشتیبانی" data-lang-fr="Aide & Support" data-lang-it="Aiuto & Supporto" data-lang-de="Hilfe & Support">Help & Support</h2>
568
+ <p data-lang-en="Contact us at support@teamnora.com or call +1-123-456-7890 for assistance." data-lang-fa="با ما تماس بگیرید در support@teamnora.com یا شماره +۱-۱۲۳-۴۵۶-۷۸۹۰ برای کمک." data-lang-fr="Contactez-nous à support@teamnora.com ou appelez le +1-123-456-7890 pour de l'aide." data-lang-it="Contattaci a support@teamnora.com o chiama il +1-123-456-7890 per assistenza." data-lang-de="Kontaktiere uns unter support@teamnora.com oder ruf +1-123-456-7890 an für Hilfe.">Contact us at support@teamnora.com or call +1-123-456-7890 for assistance.</p>
569
+ <button class="neu-button mt-4" onclick="sendSupportEmail()">Send Email</button>
570
+ <p id="supportStatus" class="success-message hidden">Email sent successfully!</p>
571
+ </div>
572
+ </div>
573
+
574
+ <div id="privacyModal" class="modal">
575
+ <div class="modal-content neu">
576
+ <span class="close" onclick="closeModal('privacyModal')">&times;</span>
577
+ <h2 data-lang-en="Privacy Policy" data-lang-fa="سیاست حریم خصوصی" data-lang-fr="Politique de confidentialité" data-lang-it="Politica sulla privacy" data-lang-de="Datenschutzrichtlinie">Privacy Policy</h2>
578
+ <p data-lang-en="We value your privacy. Your data is secure and not shared without consent. For more details, read our full policy." data-lang-fa="ما به حریم خصوصی شما اهمیت می‌دهیم. داده‌های شما امن است و بدون رضایت به اشتراک گذاشته نمی‌شود. برای جزئیات بیشتر، سیاست کامل ما را بخوانید." data-lang-fr="Nous valorisons votre vie privée. Vos données sont sécurisées et ne sont pas partagées sans consentement. Pour plus de détails, lisez notre politique complète." data-lang-it="Valorizziamo la tua privacy. I tuoi dati sono sicuri e non vengono condivisi senza consenso. Per maggiori dettagli, leggi la nostra politica completa." data-lang-de="Wir schätzen Ihre Privatsphäre. Ihre Daten sind sicher und werden ohne Zustimmung nicht geteilt. Lesen Sie unsere vollständige Richtlinie für weitere Details.">We value your privacy. Your data is secure and not shared without consent. For more details, read our full policy.</p>
579
+ </div>
580
+ </div>
581
+
582
+ <div id="notificationsModal" class="modal">
583
+ <div class="modal-content neu">
584
+ <span class="close" onclick="closeModal('notificationsModal')">&times;</span>
585
+ <h2 data-lang-en="Notifications Settings" data-lang-fa="تنظیمات اعلان‌ها" data-lang-fr="Paramètres des notifications" data-lang-it="Impostazioni notifiche" data-lang-de="Benachrichtigungseinstellungen">Notifications Settings</h2>
586
+ <label>
587
+ <input type="checkbox" id="silentMode" onchange="updateNotificationSettings()">
588
+ <span data-lang-en="Silent Mode" data-lang-fa="حالت سایلنت" data-lang-fr="Mode silencieux" data-lang-it="Modalità silenziosa" data-lang-de="Stiller Modus">Silent Mode</span>
589
+ </label>
590
+ <br>
591
+ <label>
592
+ <input type="checkbox" id="dailyReminders" onchange="updateNotificationSettings()">
593
+ <span data-lang-en="Daily Reminders" data-lang-fa="یادآوری روزانه" data-lang-fr="Rappels quotidiens" data-lang-it="Promemoria giornalieri" data-lang-de="Tägliche Erinnerungen">Daily Reminders</span>
594
+ </label>
595
+ <p id="notificationStatus" class="text-gray-600 mt-2 success-message"></p>
596
+ </div>
597
+ </div>
598
+
599
+ <div id="profileModal" class="modal">
600
+ <div class="modal-content neu">
601
+ <span class="close" onclick="closeModal('profileModal')">&times;</span>
602
+ <h2 data-lang-en="Profile" data-lang-fa="پروفایل" data-lang-fr="Profil" data-lang-it="Profilo" data-lang-de="Profil">Profile</h2>
603
+ <form id="profileForm" onsubmit="saveProfile(event)">
604
+ <label data-lang-en="Name:" data-lang-fa="نام:" data-lang-fr="Nom:" data-lang-it="Nome:" data-lang-de="Name:">Name:</label>
605
+ <input type="text" id="profileName" class="p-2 mt-2 rounded neu-inset bg-transparent text-white w-full" placeholder="Enter your name">
606
+ <br><br>
607
+ <label data-lang-en="Email:" data-lang-fa="ایمیل:" data-lang-fr="Email:" data-lang-it="Email:" data-lang-de="E-Mail:">Email:</label>
608
+ <input type="email" id="profileEmail" class="p-2 mt-2 rounded neu-inset bg-transparent text-white w-full" placeholder="Enter your email">
609
+ <br><br>
610
+ <button type="submit" class="neu-button mt-4">Save</button>
611
+ </form>
612
+ <p id="profileStatus" class="success-message hidden">Profile saved successfully!</p>
613
+ </div>
614
+ </div>
615
+
616
+ <div id="premiumModal" class="modal">
617
+ <div class="modal-content neu">
618
+ <span class="close" onclick="closeModal('premiumModal')">&times;</span>
619
+ <h2 data-lang-en="Upgrade to Premium" data-lang-fa="ارتقا به پرمیوم" data-lang-fr="Passer à Premium" data-lang-it="Passa a Premium" data-lang-de="Auf Premium upgraden">Upgrade to Premium</h2>
620
+ <p data-lang-en="Get unlimited scans and more features." data-lang-fa="اسکن‌های نامحدود و ویژگی‌های بیشتر دریافت کنید." data-lang-fr="Obtenez des scans illimités et plus de fonctionnalités." data-lang-it="Ottieni scansioni illimitate e più funzionalità." data-lang-de="Erhalte unbegrenzte Scans und mehr Funktionen.">Get unlimited scans and more features.</p>
621
+ <button onclick="upgradeToPremium()" class="neu-button accent mt-4">Upgrade</button>
622
+ <div id="upgradeProgress" class="upgrade-progress mt-2 hidden">
623
+ <div id="upgradeProgressFill" class="upgrade-progress-fill"></div>
624
+ </div>
625
+ <p id="upgradeStatus" class="success-message mt-2"></p>
626
+ </div>
627
+ </div>
628
+
629
+ <div id="historyModal" class="modal">
630
+ <div class="modal-content neu">
631
+ <span class="close" onclick="closeModal('historyModal')">&times;</span>
632
+ <h2 data-lang-en="Meal History" data-lang-fa="تاریخچه وعده‌ها" data-lang-fr="Historique des repas" data-lang-it="Cronologia pasti" data-lang-de="Mahlzeitenverlauf">Meal History</h2>
633
+ <ul id="mealHistoryList" class="text-left mt-4 space-y-2">
634
+ <li class="p-2 neu-inset">2023-10-01: Salad (150 kcal)</li>
635
+ <li class="p-2 neu-inset">2023-10-02: Sandwich (300 kcal)</li>
636
+ </ul>
637
+ <button onclick="clearHistory()" class="neu-button mt-4">Clear History</button>
638
+ <p id="historyStatus" class="success-message hidden">History cleared!</p>
639
+ </div>
640
+ </div>
641
+
642
+ <div id="accountSettingsModal" class="modal">
643
+ <div class="modal-content neu">
644
+ <span class="close" onclick="closeModal('accountSettingsModal')">&times;</span>
645
+ <h2 data-lang-en="Account Settings" data-lang-fa="تنظیمات حساب" data-lang-fr="Paramètres du compte" data-lang-it="Impostazioni account" data-lang-de="Kontoeinstellungen">Account Settings</h2>
646
+ <p data-lang-en="Manage your account settings." data-lang-fa="مدیریت تنظیمات حساب شما." data-lang-fr="Gérez les paramètres de votre compte." data-lang-it="Gestisci le impostazioni del tuo account." data-lang-de="Verwalten Sie Ihre Kontoeinstellungen.">Manage your account settings.</p>
647
+ <button onclick="deleteAccount()" class="neu-button mt-4 accent bg-red-500">Delete Account</button>
648
+ <p id="accountStatus" class="success-message hidden">Account deleted!</p>
649
+ </div>
650
+ </div>
651
+
652
+ <div id="languageModal" class="modal">
653
+ <div class="modal-content neu">
654
+ <span class="close" onclick="closeModal('languageModal')">&times;</span>
655
+ <h2 data-lang-en="Language Settings" data-lang-fa="تنظیمات زبان" data-lang-fr="Paramètres de langue" data-lang-it="Impostazioni lingua" data-lang-de="Spracheinstellungen">Language Settings</h2>
656
+ <select id="modalLanguageSelect" class="p-2 rounded neu-inset bg-transparent text-white">
657
+ <option value="en">English</option>
658
+ <option value="fa">فارسی</option>
659
+ <option value="fr">Français</option>
660
+ <option value="it">Italiano</option>
661
+ <option value="de">Deutsch</option>
662
+ </select>
663
+ <button onclick="changeLanguage(document.getElementById('modalLanguageSelect').value)" class="neu-button mt-4">Apply</button>
664
+ <p id="languageStatus" class="success-message hidden">Language changed!</p>
665
+ </div>
666
+ </div>
667
+
668
+ <script>
669
+ feather.replace();
670
+ // Theme Toggle
671
+ const themeToggle = document.getElementById('themeToggle');
672
+ const themeIcon = document.getElementById('themeIcon');
673
+ themeToggle.addEventListener('click', () => {
674
+ // Smooth transition for theme change
675
+ document.body.style.transition = 'background 0.5s ease, color 0.5s ease';
676
+ document.body.classList.toggle('light');
677
+
678
+ if (document.body.classList.contains('light')) {
679
+ themeIcon.setAttribute('data-feather', 'moon');
680
+ document.documentElement.style.setProperty('--accent-color', '#37C2B0');
681
+ } else {
682
+ themeIcon.setAttribute('data-feather', 'sun');
683
+ document.documentElement.style.setProperty('--accent-color', 'linear-gradient(45deg, #FF6B6B, #FFE66D)');
684
+ }
685
+
686
+ setTimeout(() => {
687
+ feather.replace();
688
+ document.body.style.transition = '';
689
+ }, 50);
690
+ });
691
+ // Language Change
692
+ function changeLanguage(lang) {
693
+ document.querySelectorAll('[data-lang-en]').forEach(el => {
694
+ el.textContent = el.getAttribute(`data-lang-${lang}`);
695
+ });
696
+ }
697
+
698
+ const languageSelect = document.getElementById('languageSelect');
699
+ languageSelect.addEventListener('change', () => {
700
+ changeLanguage(languageSelect.value);
701
+ });
702
+
703
+ // Modals
704
+ function openModal(modalId) {
705
+ const modal = document.getElementById(modalId);
706
+ modal.style.display = 'block';
707
+ modal.focus(); // For accessibility
708
+ }
709
+
710
+ function closeModal(modalId) {
711
+ const modal = document.getElementById(modalId);
712
+ const modalContent = modal.querySelector('.modal-content');
713
+ modal.classList.add('closing');
714
+ modalContent.classList.add('closing');
715
+ setTimeout(() => {
716
+ modal.style.display = 'none';
717
+ modal.classList.remove('closing');
718
+ modalContent.classList.remove('closing');
719
+ }, 300);
720
+ }
721
+
722
+ // Close modals when clicking outside
723
+ window.onclick = function(event) {
724
+ if (event.target.classList.contains('modal')) {
725
+ closeModal(event.target.id);
726
+ }
727
+ }
728
+
729
+ // Close with Escape key
730
+ document.addEventListener('keydown', (e) => {
731
+ if (e.key === 'Escape') {
732
+ document.querySelectorAll('.modal').forEach(modal => {
733
+ if (modal.style.display === 'block') {
734
+ closeModal(modal.id);
735
+ }
736
+ });
737
+ }
738
+ });
739
+
740
+ // Interactive functions
741
+ function confirmLogout() {
742
+ if (confirm("Are you sure you want to logout?")) {
743
+ alert("Logged out successfully!");
744
+ // Actual logout logic here
745
+ }
746
+ }
747
+
748
+ function updateNotificationSettings() {
749
+ const status = document.getElementById('notificationStatus');
750
+ status.textContent = "Settings updated!";
751
+ status.classList.remove('hidden');
752
+ setTimeout(() => {
753
+ status.classList.add('hidden');
754
+ }, 2000);
755
+ }
756
+
757
+ function saveProfile(event) {
758
+ event.preventDefault();
759
+ const status = document.getElementById('profileStatus');
760
+ status.classList.remove('hidden');
761
+ setTimeout(() => {
762
+ status.classList.add('hidden');
763
+ }, 2000);
764
+ // Save logic here
765
+ }
766
+
767
+ function upgradeToPremium() {
768
+ const progress = document.getElementById('upgradeProgress');
769
+ const fill = document.getElementById('upgradeProgressFill');
770
+ const status = document.getElementById('upgradeStatus');
771
+ progress.classList.remove('hidden');
772
+ fill.style.width = '100%';
773
+ setTimeout(() => {
774
+ status.textContent = "Upgrade complete!";
775
+ progress.classList.add('hidden');
776
+ fill.style.width = '0%';
777
+ }, 1000);
778
+ }
779
+
780
+ function clearHistory() {
781
+ const list = document.getElementById('mealHistoryList');
782
+ const status = document.getElementById('historyStatus');
783
+ list.innerHTML = '';
784
+ status.classList.remove('hidden');
785
+ setTimeout(() => {
786
+ status.classList.add('hidden');
787
+ }, 2000);
788
+ }
789
+
790
+ function deleteAccount() {
791
+ if (confirm("Are you sure you want to delete your account? This action cannot be undone.")) {
792
+ const status = document.getElementById('accountStatus');
793
+ status.classList.remove('hidden');
794
+ setTimeout(() => {
795
+ closeModal('accountSettingsModal');
796
+ }, 2000);
797
+ // Delete logic here
798
+ }
799
+ }
800
+
801
+ function sendSupportEmail() {
802
+ const status = document.getElementById('supportStatus');
803
+ status.classList.remove('hidden');
804
+ setTimeout(() => {
805
+ status.classList.add('hidden');
806
+ }, 2000);
807
+ // Email logic here
808
+ }
809
+
810
+ // Save Meal and Rescan functions
811
+ let savedMeals = localStorage.getItem('savedMeals') ? JSON.parse(localStorage.getItem('savedMeals')) : [];
812
+
813
+ document.getElementById('saveMeal').addEventListener('click', () => {
814
+ const meal = {
815
+ name: 'Pancake with Maple Syrup',
816
+ calories: 272,
817
+ components: 2,
818
+ date: new Date().toLocaleString()
819
+ };
820
+ savedMeals.push(meal);
821
+ localStorage.setItem('savedMeals', JSON.stringify(savedMeals));
822
+ alert('Meal saved!');
823
+ });
824
+ document.getElementById('rescan').addEventListener('click', () => {
825
+ // Smooth fade out all elements
826
+ const elementsToFade = [
827
+ document.getElementById('header'),
828
+ document.getElementById('navButtons'),
829
+ document.getElementById('footer'),
830
+ document.getElementById('analysisResults'),
831
+ document.getElementById('detectionResults')
832
+ ];
833
+
834
+ elementsToFade.forEach(el => {
835
+ el.style.transition = 'opacity 0.4s ease-out';
836
+ el.style.opacity = '0';
837
+ });
838
+
839
+ // Expand camera container smoothly
840
+ document.getElementById('cameraContainer').style.transition = 'height 0.6s cubic-bezier(0.4, 0, 0.2, 1)';
841
+ document.getElementById('cameraContainer').style.height = '100vh';
842
+
843
+ setTimeout(() => {
844
+ // Hide elements after fade out
845
+ elementsToFade.forEach(el => {
846
+ el.style.display = 'none';
847
+ });
848
+
849
+ // Show processing overlay with smooth fade in
850
+ const processingOverlay = document.getElementById('processingOverlay');
851
+ processingOverlay.style.display = 'flex';
852
+ processingOverlay.style.opacity = '0';
853
+ setTimeout(() => {
854
+ processingOverlay.style.transition = 'opacity 0.3s ease-in';
855
+ processingOverlay.style.opacity = '1';
856
+ }, 50);
857
+
858
+ // Simulate scan progress
859
+ setTimeout(() => {
860
+ // Hide processing overlay with fade out
861
+ processingOverlay.style.opacity = '0';
862
+ setTimeout(() => {
863
+ processingOverlay.style.display = 'none';
864
+
865
+ // Show detection results and adjust camera height
866
+ document.getElementById('detectionResults').style.display = 'flex';
867
+ document.getElementById('cameraContainer').style.height = '50vh';
868
+
869
+ // Show all elements with smooth fade in
870
+ elementsToFade.forEach(el => {
871
+ el.style.display = '';
872
+ el.style.opacity = '0';
873
+ setTimeout(() => {
874
+ el.style.transition = 'opacity 0.5s ease-out';
875
+ el.style.opacity = '1';
876
+ }, 50);
877
+ });
878
+ }, 300);
879
+ }, 2000);
880
+ }, 400);
881
+ });
882
+ // Simulate detection process
883
+ document.addEventListener('DOMContentLoaded', function() {
884
+ const cameraContainer = document.getElementById('cameraContainer');
885
+ const processingOverlay = document.getElementById('processingOverlay');
886
+ const detectionResults = document.getElementById('detectionResults');
887
+ const progressFill = document.getElementById('progressFill');
888
+ const header = document.getElementById('header');
889
+ const analysisResults = document.getElementById('analysisResults');
890
+ const navButtons = document.getElementById('navButtons');
891
+ const footer = document.getElementById('footer');
892
+ const navItems = document.querySelectorAll('.fade-in');
893
+
894
+ setTimeout(() => {
895
+ processingOverlay.classList.remove('hidden');
896
+ processingOverlay.classList.add('flex');
897
+
898
+ let progress = 0;
899
+ const progressInterval = setInterval(() => {
900
+ progress += Math.random() * 15;
901
+ if (progress >= 100) {
902
+ progress = 100;
903
+ clearInterval(progressInterval);
904
+
905
+ setTimeout(() => {
906
+ processingOverlay.classList.add('hidden');
907
+ processingOverlay.classList.remove('flex');
908
+ detectionResults.classList.remove('hidden');
909
+ cameraContainer.style.height = '50vh';
910
+ header.classList.remove('hidden');
911
+ analysisResults.classList.remove('hidden');
912
+ navButtons.classList.remove('hidden');
913
+ footer.classList.remove('hidden');
914
+
915
+ setTimeout(() => {
916
+ navItems.forEach((item, index) => {
917
+ setTimeout(() => {
918
+ item.classList.add('visible');
919
+ }, index * 200);
920
+ });
921
+ }, 500);
922
+ }, 500);
923
+ }
924
+ progressFill.style.width = progress + '%';
925
+ }, 100);
926
+ }, 3000);
927
+ });
928
+ </script>
929
+ </body>
930
+ </html>