GOWREESH M G commited on
Commit
8925012
·
verified ·
1 Parent(s): 9db5a02

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +26 -20
templates/index.html CHANGED
@@ -107,7 +107,8 @@
107
  html.dark .logo-shimmer { background-image: linear-gradient(90deg, #c084fc, #e879f9, #c084fc); }
108
  @keyframes shimmer { to { background-position: 200% center; } }
109
 
110
- .view-section { display: none; width: 100%; max-width: 28rem; flex-direction: column; align-items: center; opacity: 0; transform: translateY(10px); transition: opacity 0.5s, transform 0.5s; }
 
111
  .view-section.active { display: flex; opacity: 1; transform: translateY(0); }
112
 
113
  #scanning-section { display: none; margin-top: 1.5rem; opacity: 0; transform: scale(0.95); transition: all 0.5s; }
@@ -116,7 +117,8 @@
116
  html.dark .progress-track { background: rgba(255,255,255,0.15); }
117
  .progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #7c3aed, #d946ef); transition: width 0.4s; }
118
 
119
- .result-image-frame { position: relative; width: 160px; height: 160px; border-radius: 2rem; border: 4px solid var(--glass-border); margin-bottom: -40px; z-index: 20; box-shadow: 0 15px 40px rgba(0,0,0,0.25); background: #111; cursor: pointer; transition: transform 0.2s; }
 
120
  .result-image-frame:hover { transform: scale(1.05); }
121
  .result-image-frame img { border-radius: inherit; }
122
 
@@ -221,7 +223,8 @@
221
  <i data-lucide="arrow-left" class="w-4 h-4 text-blue-800 dark:text-blue-300"></i>
222
  </button>
223
 
224
- <main class="relative z-10 w-full min-h-screen flex flex-col items-center pt-20 pb-12 px-6">
 
225
 
226
  <!-- VIEW 1: HOME -->
227
  <div id="view-home" class="view-section active">
@@ -305,7 +308,7 @@
305
  </div>
306
 
307
  <!-- Image included in print layout, hover overlay is print-hide -->
308
- <div class="result-image-frame group relative" onclick="openImageModal()">
309
  <div class="absolute inset-0 bg-black/40 flex flex-col items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity z-10 rounded-[1.6rem] print-hide">
310
  <i data-lucide="maximize-2" class="w-8 h-8 text-white"></i>
311
  <span class="text-white text-xs font-bold mt-2 uppercase tracking-widest drop-shadow-md">View Full Screen</span>
@@ -313,14 +316,15 @@
313
  <img id="result-photo" src="" class="w-full h-full object-cover transition-opacity duration-300" />
314
  </div>
315
 
316
- <div class="glass-island p-8 pt-10 w-full flex flex-col items-center">
317
- <div id="result-icon-bg" class="w-16 h-16 rounded-[1.5rem] flex items-center justify-center mb-4 shadow-xl transition-colors duration-500">
318
- <i id="result-icon" data-lucide="activity" class="w-8 h-8 text-white"></i>
 
319
  </div>
320
 
321
- <h2 id="result-diagnosis" class="text-3xl font-bold mb-1 text-center tracking-tight w-full">--</h2>
322
- <p id="result-severity" class="sub-label text-purple-600 dark:text-purple-400 mb-4 font-black text-xs text-center w-full">ANALYSIS COMPLETE</p>
323
- <p id="result-desc" class="text-sm opacity-70 mb-6 font-medium text-center leading-relaxed max-w-[260px] w-full">--</p>
324
 
325
  <div class="w-full bg-black/5 dark:bg-white/5 p-4 rounded-2xl border border-black/10 dark:border-white/10 text-center mb-4 shadow-inner print-hide">
326
  <p class="sub-label mb-1 opacity-50">AI Confidence Score</p>
@@ -351,7 +355,7 @@
351
  <button onclick="toggleHeatmap()" id="btn-main-heatmap" class="flex-[1] py-3.5 rounded-2xl bg-purple-500/10 hover:bg-purple-500/20 text-purple-700 dark:text-purple-300 font-bold text-sm border border-purple-500/20 transition-all hidden">
352
  <i data-lucide="eye" class="w-4 h-4 inline-block -mt-0.5 mr-1"></i> Heatmap
353
  </button>
354
- <!-- TIMEOUT REMOVED to prevent block print warning -->
355
  <button onclick="window.print()" class="flex-[1] py-3.5 rounded-2xl bg-blue-500/10 hover:bg-blue-500/20 text-blue-700 dark:text-blue-300 font-bold text-sm border border-blue-500/20 transition-all">
356
  <i data-lucide="printer" class="w-4 h-4 inline-block -mt-0.5 mr-1"></i> Print Report
357
  </button>
@@ -458,15 +462,16 @@
458
  <p><strong>Date of Analysis:</strong> <span id="calc-print-date">---</span></p>
459
  </div>
460
 
461
- <div class="glass-island p-8 pt-10 w-full max-w-[420px] flex flex-col items-center">
462
- <div id="calc-icon-bg" class="w-20 h-20 rounded-full flex items-center justify-center mb-6 shadow-xl transition-colors duration-500">
463
- <i id="calc-icon" data-lucide="activity" class="w-10 h-10 text-white"></i>
 
464
  </div>
465
 
466
- <!-- ALLIGNED CENTERED DIAGNOSIS TEXTS -->
467
- <h2 id="calc-diagnosis" class="text-3xl font-bold mb-2 text-center tracking-tight w-full">--</h2>
468
- <p id="calc-severity" class="sub-label text-blue-600 dark:text-blue-400 mb-6 font-black text-xs text-center w-full">--</p>
469
- <p id="calc-desc" class="text-sm opacity-80 mb-8 font-medium text-center leading-relaxed w-full">--</p>
470
 
471
  <!-- DIABETES DETAILED PRINT SECTION -->
472
  <div class="print-details w-full" id="calc-print-medical-details">
@@ -485,12 +490,13 @@
485
 
486
  <!-- ADDED PRINT OPTION BUTTONS -->
487
  <div class="flex gap-3 w-full mb-3 print-hide">
488
- <!-- TIMEOUT REMOVED to prevent block print warning -->
489
  <button onclick="window.print()" class="flex-[1] py-3.5 rounded-2xl bg-blue-500/10 hover:bg-blue-500/20 text-blue-700 dark:text-blue-300 font-bold text-sm border border-blue-500/20 transition-all">
490
  <i data-lucide="printer" class="w-4 h-4 inline-block -mt-0.5 mr-1"></i> Print Report
491
  </button>
492
  </div>
493
 
 
494
  <button onclick="resetCalculator()" class="w-full py-4 rounded-2xl bg-blue-600 hover:bg-blue-700 text-white font-bold text-base shadow-xl active:scale-95 transition-all print-hide">
495
  Done
496
  </button>
@@ -788,7 +794,7 @@
788
 
789
  function showResult(data) {
790
  const colors = { 'emerald': 'bg-emerald-500', 'yellow': 'bg-yellow-500', 'orange': 'bg-orange-500', 'rose': 'bg-rose-500', 'purple': 'bg-purple-600' };
791
- document.getElementById('result-icon-bg').className = `w-16 h-16 rounded-[1.5rem] flex items-center justify-center mb-4 shadow-xl ${colors[data.color] || 'bg-purple-600'}`;
792
  document.getElementById('result-icon').setAttribute('data-lucide', data.icon);
793
  document.getElementById('result-diagnosis').textContent = data.diagnosis;
794
  document.getElementById('result-severity').textContent = data.severity;
 
107
  html.dark .logo-shimmer { background-image: linear-gradient(90deg, #c084fc, #e879f9, #c084fc); }
108
  @keyframes shimmer { to { background-position: 200% center; } }
109
 
110
+ /* Adjusted view-section to perfectly center vertically and horizontally */
111
+ .view-section { display: none; width: 100%; max-width: 28rem; flex-direction: column; align-items: center; justify-content: center; margin: auto; opacity: 0; transform: translateY(10px); transition: opacity 0.5s, transform 0.5s; }
112
  .view-section.active { display: flex; opacity: 1; transform: translateY(0); }
113
 
114
  #scanning-section { display: none; margin-top: 1.5rem; opacity: 0; transform: scale(0.95); transition: all 0.5s; }
 
117
  html.dark .progress-track { background: rgba(255,255,255,0.15); }
118
  .progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #7c3aed, #d946ef); transition: width 0.4s; }
119
 
120
+ /* Scaled down image frame to prevent scrolling on small screens */
121
+ .result-image-frame { position: relative; width: 130px; height: 130px; border-radius: 2rem; border: 4px solid var(--glass-border); margin-bottom: -30px; z-index: 20; box-shadow: 0 15px 40px rgba(0,0,0,0.25); background: #111; cursor: pointer; transition: transform 0.2s; }
122
  .result-image-frame:hover { transform: scale(1.05); }
123
  .result-image-frame img { border-radius: inherit; }
124
 
 
223
  <i data-lucide="arrow-left" class="w-4 h-4 text-blue-800 dark:text-blue-300"></i>
224
  </button>
225
 
226
+ <!-- Removed heavy top/bottom padding to allow flexbox to vertically center the active view beautifully -->
227
+ <main class="relative z-10 w-full min-h-[100dvh] flex flex-col justify-center items-center py-6 px-4">
228
 
229
  <!-- VIEW 1: HOME -->
230
  <div id="view-home" class="view-section active">
 
308
  </div>
309
 
310
  <!-- Image included in print layout, hover overlay is print-hide -->
311
+ <div class="result-image-frame group relative mx-auto" onclick="openImageModal()">
312
  <div class="absolute inset-0 bg-black/40 flex flex-col items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity z-10 rounded-[1.6rem] print-hide">
313
  <i data-lucide="maximize-2" class="w-8 h-8 text-white"></i>
314
  <span class="text-white text-xs font-bold mt-2 uppercase tracking-widest drop-shadow-md">View Full Screen</span>
 
316
  <img id="result-photo" src="" class="w-full h-full object-cover transition-opacity duration-300" />
317
  </div>
318
 
319
+ <!-- Reduced top padding slightly to ensure it doesn't cause scrolling on small screens -->
320
+ <div class="glass-island p-6 pt-10 w-full flex flex-col items-center">
321
+ <div id="result-icon-bg" class="w-14 h-14 rounded-[1.5rem] flex items-center justify-center mb-3 shadow-xl transition-colors duration-500">
322
+ <i id="result-icon" data-lucide="activity" class="w-7 h-7 text-white"></i>
323
  </div>
324
 
325
+ <h2 id="result-diagnosis" class="text-3xl font-bold mb-1 text-center tracking-tight w-full block mx-auto">--</h2>
326
+ <p id="result-severity" class="sub-label text-purple-600 dark:text-purple-400 mb-4 font-black text-xs text-center w-full block mx-auto">ANALYSIS COMPLETE</p>
327
+ <p id="result-desc" class="text-sm opacity-70 mb-6 font-medium text-center leading-relaxed max-w-[260px] w-full block mx-auto">--</p>
328
 
329
  <div class="w-full bg-black/5 dark:bg-white/5 p-4 rounded-2xl border border-black/10 dark:border-white/10 text-center mb-4 shadow-inner print-hide">
330
  <p class="sub-label mb-1 opacity-50">AI Confidence Score</p>
 
355
  <button onclick="toggleHeatmap()" id="btn-main-heatmap" class="flex-[1] py-3.5 rounded-2xl bg-purple-500/10 hover:bg-purple-500/20 text-purple-700 dark:text-purple-300 font-bold text-sm border border-purple-500/20 transition-all hidden">
356
  <i data-lucide="eye" class="w-4 h-4 inline-block -mt-0.5 mr-1"></i> Heatmap
357
  </button>
358
+ <!-- TIMEOUT ENTIRELY REMOVED to prevent "automatic printing" blocks -->
359
  <button onclick="window.print()" class="flex-[1] py-3.5 rounded-2xl bg-blue-500/10 hover:bg-blue-500/20 text-blue-700 dark:text-blue-300 font-bold text-sm border border-blue-500/20 transition-all">
360
  <i data-lucide="printer" class="w-4 h-4 inline-block -mt-0.5 mr-1"></i> Print Report
361
  </button>
 
462
  <p><strong>Date of Analysis:</strong> <span id="calc-print-date">---</span></p>
463
  </div>
464
 
465
+ <!-- Adjusted internal padding so the entire box stays neatly contained on screen -->
466
+ <div class="glass-island p-6 pt-8 w-full max-w-[420px] flex flex-col items-center">
467
+ <div id="calc-icon-bg" class="w-16 h-16 rounded-full flex items-center justify-center mb-4 shadow-xl transition-colors duration-500">
468
+ <i id="calc-icon" data-lucide="activity" class="w-8 h-8 text-white"></i>
469
  </div>
470
 
471
+ <!-- ALLIGNED CENTERED DIAGNOSIS TEXTS (w-full block mx-auto forces strict text centering) -->
472
+ <h2 id="calc-diagnosis" class="text-3xl font-bold mb-2 text-center tracking-tight w-full block mx-auto">--</h2>
473
+ <p id="calc-severity" class="sub-label text-blue-600 dark:text-blue-400 mb-4 font-black text-xs text-center w-full block mx-auto">--</p>
474
+ <p id="calc-desc" class="text-sm opacity-80 mb-6 font-medium text-center leading-relaxed w-full block mx-auto">--</p>
475
 
476
  <!-- DIABETES DETAILED PRINT SECTION -->
477
  <div class="print-details w-full" id="calc-print-medical-details">
 
490
 
491
  <!-- ADDED PRINT OPTION BUTTONS -->
492
  <div class="flex gap-3 w-full mb-3 print-hide">
493
+ <!-- TIMEOUT ENTIRELY REMOVED to prevent "automatic printing" blocks -->
494
  <button onclick="window.print()" class="flex-[1] py-3.5 rounded-2xl bg-blue-500/10 hover:bg-blue-500/20 text-blue-700 dark:text-blue-300 font-bold text-sm border border-blue-500/20 transition-all">
495
  <i data-lucide="printer" class="w-4 h-4 inline-block -mt-0.5 mr-1"></i> Print Report
496
  </button>
497
  </div>
498
 
499
+ <!-- NEW: Hooks into resetCalculator to clear the form on close -->
500
  <button onclick="resetCalculator()" class="w-full py-4 rounded-2xl bg-blue-600 hover:bg-blue-700 text-white font-bold text-base shadow-xl active:scale-95 transition-all print-hide">
501
  Done
502
  </button>
 
794
 
795
  function showResult(data) {
796
  const colors = { 'emerald': 'bg-emerald-500', 'yellow': 'bg-yellow-500', 'orange': 'bg-orange-500', 'rose': 'bg-rose-500', 'purple': 'bg-purple-600' };
797
+ document.getElementById('result-icon-bg').className = `w-14 h-14 rounded-[1.5rem] flex items-center justify-center mb-3 shadow-xl ${colors[data.color] || 'bg-purple-600'}`;
798
  document.getElementById('result-icon').setAttribute('data-lucide', data.icon);
799
  document.getElementById('result-diagnosis').textContent = data.diagnosis;
800
  document.getElementById('result-severity').textContent = data.severity;