vaithi663 commited on
Commit
a1237b9
·
verified ·
1 Parent(s): a90e291

Update templates/result.html

Browse files
Files changed (1) hide show
  1. templates/result.html +108 -182
templates/result.html CHANGED
@@ -1,182 +1,108 @@
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>RetiCheck | AI Analysis Report</title>
7
- <style>
8
- * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
9
- body { background: #0f172a; color: white; padding: 30px; }
10
-
11
- .report-container {
12
- max-width: 1000px;
13
- margin: 0 auto;
14
- background: rgba(255, 255, 255, 0.03);
15
- backdrop-filter: blur(15px);
16
- border: 1px solid rgba(255, 255, 255, 0.1);
17
- border-radius: 30px;
18
- padding: 40px;
19
- }
20
-
21
- .header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #334155; padding-bottom: 20px; }
22
- .logo span { color: #00f2fe; }
23
-
24
- /* AI Visualization Section */
25
- .visualization-area {
26
- display: grid;
27
- grid-template-columns: 1fr 1fr;
28
- gap: 20px;
29
- margin: 30px 0;
30
- }
31
-
32
- .img-card {
33
- background: #1e293b;
34
- padding: 15px;
35
- border-radius: 20px;
36
- text-align: center;
37
- }
38
-
39
- /* FIX: இமேஜ் கட் ஆகாமல் முழுசாக தெரிய 'contain' பயன்படுத்தப்பட்டுள்ளது */
40
- .img-card img {
41
- width: 100%;
42
- height: 250px;
43
- object-fit: contain;
44
- border-radius: 15px;
45
- margin-bottom: 10px;
46
- border: 2px solid #334155;
47
- background: #000;
48
- }
49
-
50
- /* Results Grid */
51
- .result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 20px; }
52
- .res-card { background: rgba(255,255,255,0.05); padding: 20px; border-radius: 15px; text-align: center; border-left: 4px solid #334155; }
53
-
54
- .btn-print {
55
- width: 100%;
56
- padding: 15px;
57
- background: linear-gradient(90deg, #00f2fe, #4facfe);
58
- border: none;
59
- border-radius: 12px;
60
- font-weight: bold;
61
- cursor: pointer;
62
- margin-top: 30px;
63
- }
64
- </style>
65
- </head>
66
- <body>
67
-
68
- <div class="report-container">
69
- <div class="header">
70
- <h2 class="logo">RetiCheck <span>AI Report</span></h2>
71
- <div id="header-status" style="color: #10b981; font-weight:bold;">● System Diagnosis: Loading...</div>
72
- </div>
73
-
74
- <div class="visualization-area">
75
- <div class="img-card">
76
- <img id="display-orig" src="" alt="Original Scan">
77
- <p style="font-size: 13px; color: #94a3b8;">Original Fundus Image</p>
78
- </div>
79
-
80
- <div class="img-card">
81
- <img id="display-heat" src="" alt="Heatmap Scan">
82
- <p style="font-size: 13px; color: #00f2fe;" id="heatmap-caption">AI Heatmap Visualization (XAI)</p>
83
- </div>
84
- </div>
85
-
86
- <h3>Pathology Detection</h3>
87
- <div class="result-grid">
88
- <div class="res-card" id="main-result-card">
89
- <p style="font-size: 12px; color: #94a3b8;" id="pred-title">Analyzing...</p>
90
- <h2 id="pred-score">--%</h2>
91
- <small id="pred-status">Please wait...</small>
92
- </div>
93
- <div class="res-card dummy-card">
94
- <p style="font-size: 12px; color: #94a3b8;">Glaucoma</p>
95
- <h2 style="color: #10b981;">--</h2>
96
- <small>Scanning...</small>
97
- </div>
98
- <div class="res-card dummy-card">
99
- <p style="font-size: 12px; color: #94a3b8;">AMD</p>
100
- <h2 style="color: #10b981;">--</h2>
101
- <small>Scanning...</small>
102
- </div>
103
- </div>
104
-
105
- <div id="verdict-box" style="margin-top: 30px; padding: 20px; border-radius: 15px; border: 1px solid #334155;">
106
- <strong id="verdict-title">AI Clinical Verdict:</strong>
107
- <p id="verdict-text" style="font-size: 14px; margin-top: 5px;">Analyzing clinical correlations...</p>
108
- </div>
109
-
110
- <button class="btn-print" onclick="window.print()">Download Medical Report (PDF)</button>
111
- </div>
112
-
113
- <script>
114
- const aiDataJSON = localStorage.getItem('aiResult');
115
-
116
- if(aiDataJSON) {
117
- const aiData = JSON.parse(aiDataJSON);
118
-
119
- // 1. SET IMAGES (Base64)
120
- if(aiData.orig_img) {
121
- document.getElementById('display-orig').src = "data:image/jpeg;base64," + aiData.orig_img;
122
- }
123
- if(aiData.heat_gen && aiData.heat_img) {
124
- document.getElementById('display-heat').src = "data:image/jpeg;base64," + aiData.heat_img;
125
- } else {
126
- // If normal, just show original image again with a message
127
- document.getElementById('display-heat').src = "data:image/jpeg;base64," + aiData.orig_img;
128
- document.getElementById('heatmap-caption').innerText = "Healthy Retina (No Heatmap Needed)";
129
- document.getElementById('heatmap-caption').style.color = "#10b981";
130
- }
131
-
132
- // 2. SET TEXT DATA
133
- const headerStatus = document.getElementById('header-status');
134
- const mainCard = document.getElementById('main-result-card');
135
- const scoreTitle = document.getElementById('pred-title');
136
- const scoreValue = document.getElementById('pred-score');
137
- const scoreStatus = document.getElementById('pred-status');
138
- const dummyCards = document.querySelectorAll('.dummy-card');
139
-
140
- const verdictBox = document.getElementById('verdict-box');
141
- const verdictTitle = document.getElementById('verdict-title');
142
- const verdictText = document.getElementById('verdict-text');
143
-
144
- headerStatus.innerText = "● System Diagnosis: " + aiData.triage;
145
- scoreTitle.innerText = "AI Prediction: " + aiData.disease;
146
- scoreValue.innerText = aiData.confidence;
147
- scoreStatus.innerText = "Status: " + aiData.status;
148
-
149
- verdictText.innerText = "Action Required: " + aiData.action + " | Doctor Advice: " + aiData.advice;
150
-
151
- // 3. COLOR LOGIC
152
- if(aiData.triage === "SAFE") {
153
- const color = "#10b981";
154
- headerStatus.style.color = color;
155
- scoreValue.style.color = color;
156
- mainCard.style.borderLeftColor = color;
157
- verdictBox.style.background = "rgba(16, 185, 129, 0.1)";
158
- verdictBox.style.borderColor = color;
159
- verdictTitle.style.color = color;
160
- } else if(aiData.triage === "URGENT") {
161
- const color = "#ef4444";
162
- headerStatus.style.color = color;
163
- scoreValue.style.color = color;
164
- mainCard.style.borderLeftColor = color;
165
- verdictBox.style.background = "rgba(239, 68, 68, 0.1)";
166
- verdictBox.style.borderColor = color;
167
- verdictTitle.style.color = color;
168
- } else {
169
- const color = "#f59e0b";
170
- headerStatus.style.color = color;
171
- scoreValue.style.color = color;
172
- mainCard.style.borderLeftColor = color;
173
- verdictBox.style.background = "rgba(245, 158, 11, 0.1)";
174
- verdictBox.style.borderColor = color;
175
- verdictTitle.style.color = color;
176
- }
177
-
178
- dummyCards.forEach(card => card.style.display = "none");
179
- }
180
- </script>
181
- </body>
182
- </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>RetiCheck | AI Analysis Report</title>
7
+
8
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js"></script>
9
+
10
+ <style>
11
+ * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
12
+ body { background: #0f172a; color: white; padding: 30px; }
13
+
14
+ .report-container {
15
+ max-width: 1000px;
16
+ margin: 0 auto;
17
+ background: rgba(255, 255, 255, 0.03);
18
+ backdrop-filter: blur(15px);
19
+ border: 1px solid rgba(255, 255, 255, 0.1);
20
+ border-radius: 30px;
21
+ padding: 40px;
22
+ }
23
+
24
+ .header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #334155; padding-bottom: 20px; }
25
+ .logo span { color: #00f2fe; }
26
+
27
+ /* AI Visualization Section */
28
+ .visualization-area {
29
+ display: grid;
30
+ grid-template-columns: 1fr 1fr;
31
+ gap: 20px;
32
+ margin: 30px 0;
33
+ }
34
+
35
+ .img-card {
36
+ background: #1e293b;
37
+ padding: 15px;
38
+ border-radius: 20px;
39
+ text-align: center;
40
+ }
41
+
42
+ /* FIX: இமேஜ் கட் ஆகாமல் முழுசாக தெரிய 'contain' பயன்படுத்தப்பட்டுள்ளது */
43
+ .img-card img {
44
+ width: 100%;
45
+ height: 250px;
46
+ object-fit: contain;
47
+ border-radius: 15px;
48
+ margin-bottom: 10px;
49
+ border: 2px solid #334155;
50
+ background: #000;
51
+ }
52
+
53
+ /* Results Grid */
54
+ .result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 20px; }
55
+ .res-card { background: rgba(255,255,255,0.05); padding: 20px; border-radius: 15px; text-align: center; border-left: 4px solid #334155; }
56
+
57
+ .btn-print {
58
+ width: 100%;
59
+ padding: 15px;
60
+ background: linear-gradient(90deg, #00f2fe, #4facfe);
61
+ border: none;
62
+ border-radius: 12px;
63
+ font-weight: bold;
64
+ cursor: pointer;
65
+ margin-top: 30px;
66
+ }
67
+ </style>
68
+ </head>
69
+ <body>
70
+
71
+ <div class="report-container" id="pdf-content">
72
+ <div class="header">
73
+ <h2 class="logo">RetiCheck <span>AI Report</span></h2>
74
+ <div id="header-status" style="color: #10b981; font-weight:bold;">● System Diagnosis: Loading...</div>
75
+ </div>
76
+
77
+ <div class="visualization-area">
78
+ <div class="img-card">
79
+ <img id="display-orig" src="" alt="Original Scan">
80
+ <p style="font-size: 13px; color: #94a3b8;">Original Fundus Image</p>
81
+ </div>
82
+
83
+ <div class="img-card">
84
+ <img id="display-heat" src="" alt="Heatmap Scan">
85
+ <p style="font-size: 13px; color: #00f2fe;" id="heatmap-caption">AI Heatmap Visualization (XAI)</p>
86
+ </div>
87
+ </div>
88
+
89
+ <h3>Pathology Detection</h3>
90
+ <div class="result-grid">
91
+ <div class="res-card" id="main-result-card">
92
+ <p style="font-size: 12px; color: #94a3b8;" id="pred-title">Analyzing...</p>
93
+ <h2 id="pred-score">--%</h2>
94
+ <small id="pred-status">Please wait...</small>
95
+ </div>
96
+ <div class="res-card dummy-card">
97
+ <p style="font-size: 12px; color: #94a3b8;">Glaucoma</p>
98
+ <h2 style="color: #10b981;">--</h2>
99
+ <small>Scanning...</small>
100
+ </div>
101
+ <div class="res-card dummy-card">
102
+ <p style="font-size: 12px; color: #94a3b8;">AMD</p>
103
+ <h2 style="color: #10b981;">--</h2>
104
+ <small>Scanning...</small>
105
+ </div>
106
+ </div>
107
+
108
+ <div id="