vaithi663 commited on
Commit
de00503
·
verified ·
1 Parent(s): e7ab4af

Update templates/upload.html

Browse files
Files changed (1) hide show
  1. templates/upload.html +250 -247
templates/upload.html CHANGED
@@ -1,248 +1,251 @@
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 Diagnosis Portal</title>
7
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
8
- <style>
9
- * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
10
-
11
- body {
12
- background: radial-gradient(circle at top left, #1e293b, #0f172a);
13
- min-height: 100vh;
14
- color: white;
15
- display: flex; flex-direction: column; align-items: center; justify-content: center;
16
- padding: 30px;
17
- }
18
-
19
- .header { text-align: center; margin-bottom: 30px; animation: fadeInDown 1s ease; }
20
- .logo { font-size: 36px; font-weight: 800; letter-spacing: 1px; }
21
- .logo span { background: linear-gradient(90deg, #00f2fe, #4facfe); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
22
- .subtitle { color: #94a3b8; font-size: 16px; margin-top: 5px; }
23
-
24
- .glass-card {
25
- background: rgba(255, 255, 255, 0.03);
26
- backdrop-filter: blur(20px);
27
- -webkit-backdrop-filter: blur(20px);
28
- border: 1px solid rgba(255, 255, 255, 0.1);
29
- border-radius: 30px;
30
- padding: 50px 40px;
31
- width: 100%;
32
- max-width: 550px;
33
- text-align: center;
34
- box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
35
- animation: fadeInUp 1s ease;
36
- }
37
-
38
- /* PREMIUM UPLOAD ZONE */
39
- .upload-zone {
40
- width: 100%;
41
- height: 320px;
42
- background: rgba(0,0,0,0.2);
43
- border-radius: 25px;
44
- margin-bottom: 30px;
45
- position: relative;
46
- overflow: hidden;
47
- border: 2px dashed #334155;
48
- display: flex;
49
- justify-content: center;
50
- align-items: center;
51
- cursor: pointer;
52
- transition: all 0.3s ease;
53
- }
54
-
55
- .upload-zone:hover {
56
- border-color: #00f2fe;
57
- background: rgba(0, 242, 254, 0.05);
58
- transform: translateY(-5px);
59
- }
60
-
61
- .upload-placeholder {
62
- text-align: center;
63
- transition: 0.3s;
64
- }
65
-
66
- .upload-icon {
67
- font-size: 60px;
68
- color: #00f2fe;
69
- margin-bottom: 20px;
70
- animation: float 3s ease-in-out infinite;
71
- }
72
-
73
- .upload-text { color: #cbd5e1; font-size: 18px; font-weight: 600; }
74
- .upload-subtext { color: #64748b; font-size: 14px; margin-top: 8px; }
75
-
76
- #preview-img {
77
- width: 100%; height: 100%; object-fit: cover; display: none; border-radius: 25px;
78
- }
79
-
80
- /* Scanning Animation */
81
- .scan-line {
82
- position: absolute; top: 0; width: 100%; height: 4px;
83
- background: #00f2fe; box-shadow: 0 0 30px #00f2fe, 0 0 10px #00f2fe;
84
- display: none; z-index: 5;
85
- }
86
- @keyframes scanning { 0% { top: 0; opacity: 0; } 50% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
87
- @keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
88
- @keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
89
- @keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
90
-
91
-
92
- .analyze-btn {
93
- width: 100%;
94
- padding: 20px;
95
- background: linear-gradient(90deg, #00f2fe, #4facfe);
96
- color: #0f172a;
97
- border: none;
98
- border-radius: 15px;
99
- font-size: 18px;
100
- font-weight: 800;
101
- letter-spacing: 1px;
102
- cursor: pointer;
103
- box-shadow: 0 10px 30px -10px rgba(0, 242, 254, 0.5);
104
- transition: 0.3s;
105
- display: flex; justify-content: center; align-items: center; gap: 10px;
106
- }
107
-
108
- .analyze-btn:hover { transform: translateY(-3px); box-shadow: 0 15px 35px -10px rgba(0, 242, 254, 0.6); }
109
- .analyze-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
110
-
111
- /* Loading Progress */
112
- .loading-container { display: none; margin-top: 30px; }
113
- .progress-bar { background: #1e293b; height: 8px; border-radius: 10px; margin-top: 15px; overflow: hidden; position: relative; }
114
- .progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #00f2fe, #4facfe); transition: width 0.2s ease-in-out; border-radius: 10px; }
115
- .status-text-container { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
116
- </style>
117
- </head>
118
- <body>
119
-
120
- <div class="header">
121
- <div class="logo">RetiCheck <span>AI</span></div>
122
- <p class="subtitle">Advanced Retinal Disease Screening Portal</p>
123
- </div>
124
-
125
- <div class="glass-card">
126
-
127
- <div class="upload-zone" id="dropZone" onclick="document.getElementById('fileInput').click()">
128
- <div id="scan-line" class="scan-line"></div>
129
-
130
- <div class="upload-placeholder" id="placeholderContent">
131
- <i class="fa-solid fa-cloud-arrow-up upload-icon"></i>
132
- <p class="upload-text">Click to Upload Retinal Scan</p>
133
- <p class="upload-subtext">Supports JPG, PNG (Max 10MB)</p>
134
- </div>
135
-
136
- <img id="preview-img">
137
- </div>
138
-
139
- <input type="file" id="fileInput" hidden accept="image/*" onchange="previewFile()">
140
-
141
- <button class="analyze-btn" id="analyzeBtn" onclick="runFullAnalysis()">
142
- <i class="fa-solid fa-microchip"></i> START AI DIAGNOSIS
143
- </button>
144
-
145
- <div class="loading-container" id="loadingArea">
146
- <div class="status-text-container">
147
- <span style="color: #00f2fe;">Processing Image...</span>
148
- <span id="progressPercent" style="color: #94a3b8;">0%</span>
149
- </div>
150
- <div class="progress-bar">
151
- <div class="progress-fill" id="pFill"></div>
152
- </div>
153
- </div>
154
- </div>
155
-
156
- <script>
157
- const previewImg = document.getElementById('preview-img');
158
- const placeholderContent = document.getElementById('placeholderContent');
159
- const dropZone = document.getElementById('dropZone');
160
- const scanLine = document.getElementById('scan-line');
161
- const pFill = document.getElementById('pFill');
162
- const progressPercent = document.getElementById('progressPercent');
163
- const loadingArea = document.getElementById('loadingArea');
164
- const analyzeBtn = document.getElementById('analyzeBtn');
165
- const fileInput = document.getElementById('fileInput');
166
-
167
- // 1. File Preview Logic (Clean & Simple)
168
- function previewFile() {
169
- const file = fileInput.files[0];
170
- if (!file) return;
171
-
172
- const reader = new FileReader();
173
- reader.onloadend = () => {
174
- placeholderContent.style.display = 'none'; // Hide icon
175
- previewImg.style.display = 'block'; // Show image
176
- previewImg.src = reader.result;
177
- // Add a cool border glow when image is loaded
178
- dropZone.style.borderColor = '#00f2fe';
179
- dropZone.style.boxShadow = '0 0 20px rgba(0, 242, 254, 0.2)';
180
- }
181
- reader.readAsDataURL(file);
182
- }
183
-
184
- // 2. The Analysis Logic (Removed Camera parts)
185
- async function runFullAnalysis() {
186
- if (!fileInput.files.length) {
187
- alert("⚠️ Please upload a retinal scan image first.");
188
- // Shake animation for feedback
189
- dropZone.style.animation = 'shake 0.5s';
190
- setTimeout(() => dropZone.style.animation = '', 500);
191
- return;
192
- }
193
-
194
- // Start UI Animations
195
- loadingArea.style.display = 'block';
196
- scanLine.style.display = 'block';
197
- scanLine.style.animation = 'scanning 1.5s infinite ease-in-out';
198
- analyzeBtn.innerHTML = '<i class="fa-solid fa-circle-notch fa-spin"></i> Analyzing...';
199
- analyzeBtn.disabled = true;
200
- dropZone.style.pointerEvents = 'none'; // Prevent double upload during process
201
-
202
- // Fake Progress Animation
203
- let progress = 0;
204
- let progressInterval = setInterval(() => {
205
- if(progress < 95) {
206
- progress += Math.floor(Math.random() * 5) + 1;
207
- if(progress > 95) progress = 95;
208
- pFill.style.width = progress + "%";
209
- progressPercent.innerText = progress + "%";
210
- }
211
- }, 150);
212
-
213
- // Prepare Data
214
- const formData = new FormData();
215
- formData.append('image', fileInput.files[0]);
216
-
217
- try {
218
- // Send to Python Backend
219
- let response = await fetch('/predict', { method: 'POST', body: formData });
220
- let data = await response.json();
221
-
222
- // Save result to memory
223
- localStorage.setItem('aiResult', JSON.stringify(data));
224
-
225
- // Complete Animation
226
- clearInterval(progressInterval);
227
- pFill.style.width = "100%";
228
- progressPercent.innerText = "100% - Complete";
229
-
230
- setTimeout(() => { window.location.href = "/result"; }, 800);
231
-
232
- } catch (error) {
233
- clearInterval(progressInterval);
234
- alert("❌ Error connecting to AI Server! Is Flask running?");
235
- // Reset UI
236
- analyzeBtn.innerHTML = '<i class="fa-solid fa-microchip"></i> START AI DIAGNOSIS';
237
- analyzeBtn.disabled = false;
238
- loadingArea.style.display = 'none';
239
- scanLine.style.display = 'none';
240
- dropZone.style.pointerEvents = 'auto';
241
- }
242
- }
243
- </script>
244
- <style>
245
- @keyframes shake { 0% { transform: translateX(0); } 25% { transform: translateX(-10px); } 50% { transform: translateX(10px); } 75% { transform: translateX(-10px); } 100% { transform: translateX(0); } }
246
- </style>
247
- </body>
 
 
 
248
  </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 Diagnosis Portal</title>
7
+
8
+ <link rel="manifest" href="/static/manifest.json">
9
+ <meta name="theme-color" content="#38bdf8">
10
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
11
+ <style>
12
+ * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
13
+
14
+ body {
15
+ background: radial-gradient(circle at top left, #1e293b, #0f172a);
16
+ min-height: 100vh;
17
+ color: white;
18
+ display: flex; flex-direction: column; align-items: center; justify-content: center;
19
+ padding: 30px;
20
+ }
21
+
22
+ .header { text-align: center; margin-bottom: 30px; animation: fadeInDown 1s ease; }
23
+ .logo { font-size: 36px; font-weight: 800; letter-spacing: 1px; }
24
+ .logo span { background: linear-gradient(90deg, #00f2fe, #4facfe); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
25
+ .subtitle { color: #94a3b8; font-size: 16px; margin-top: 5px; }
26
+
27
+ .glass-card {
28
+ background: rgba(255, 255, 255, 0.03);
29
+ backdrop-filter: blur(20px);
30
+ -webkit-backdrop-filter: blur(20px);
31
+ border: 1px solid rgba(255, 255, 255, 0.1);
32
+ border-radius: 30px;
33
+ padding: 50px 40px;
34
+ width: 100%;
35
+ max-width: 550px;
36
+ text-align: center;
37
+ box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
38
+ animation: fadeInUp 1s ease;
39
+ }
40
+
41
+ /* PREMIUM UPLOAD ZONE */
42
+ .upload-zone {
43
+ width: 100%;
44
+ height: 320px;
45
+ background: rgba(0,0,0,0.2);
46
+ border-radius: 25px;
47
+ margin-bottom: 30px;
48
+ position: relative;
49
+ overflow: hidden;
50
+ border: 2px dashed #334155;
51
+ display: flex;
52
+ justify-content: center;
53
+ align-items: center;
54
+ cursor: pointer;
55
+ transition: all 0.3s ease;
56
+ }
57
+
58
+ .upload-zone:hover {
59
+ border-color: #00f2fe;
60
+ background: rgba(0, 242, 254, 0.05);
61
+ transform: translateY(-5px);
62
+ }
63
+
64
+ .upload-placeholder {
65
+ text-align: center;
66
+ transition: 0.3s;
67
+ }
68
+
69
+ .upload-icon {
70
+ font-size: 60px;
71
+ color: #00f2fe;
72
+ margin-bottom: 20px;
73
+ animation: float 3s ease-in-out infinite;
74
+ }
75
+
76
+ .upload-text { color: #cbd5e1; font-size: 18px; font-weight: 600; }
77
+ .upload-subtext { color: #64748b; font-size: 14px; margin-top: 8px; }
78
+
79
+ #preview-img {
80
+ width: 100%; height: 100%; object-fit: cover; display: none; border-radius: 25px;
81
+ }
82
+
83
+ /* Scanning Animation */
84
+ .scan-line {
85
+ position: absolute; top: 0; width: 100%; height: 4px;
86
+ background: #00f2fe; box-shadow: 0 0 30px #00f2fe, 0 0 10px #00f2fe;
87
+ display: none; z-index: 5;
88
+ }
89
+ @keyframes scanning { 0% { top: 0; opacity: 0; } 50% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
90
+ @keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
91
+ @keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
92
+ @keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
93
+
94
+
95
+ .analyze-btn {
96
+ width: 100%;
97
+ padding: 20px;
98
+ background: linear-gradient(90deg, #00f2fe, #4facfe);
99
+ color: #0f172a;
100
+ border: none;
101
+ border-radius: 15px;
102
+ font-size: 18px;
103
+ font-weight: 800;
104
+ letter-spacing: 1px;
105
+ cursor: pointer;
106
+ box-shadow: 0 10px 30px -10px rgba(0, 242, 254, 0.5);
107
+ transition: 0.3s;
108
+ display: flex; justify-content: center; align-items: center; gap: 10px;
109
+ }
110
+
111
+ .analyze-btn:hover { transform: translateY(-3px); box-shadow: 0 15px 35px -10px rgba(0, 242, 254, 0.6); }
112
+ .analyze-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
113
+
114
+ /* Loading Progress */
115
+ .loading-container { display: none; margin-top: 30px; }
116
+ .progress-bar { background: #1e293b; height: 8px; border-radius: 10px; margin-top: 15px; overflow: hidden; position: relative; }
117
+ .progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #00f2fe, #4facfe); transition: width 0.2s ease-in-out; border-radius: 10px; }
118
+ .status-text-container { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
119
+ </style>
120
+ </head>
121
+ <body>
122
+
123
+ <div class="header">
124
+ <div class="logo">RetiCheck <span>AI</span></div>
125
+ <p class="subtitle">Advanced Retinal Disease Screening Portal</p>
126
+ </div>
127
+
128
+ <div class="glass-card">
129
+
130
+ <div class="upload-zone" id="dropZone" onclick="document.getElementById('fileInput').click()">
131
+ <div id="scan-line" class="scan-line"></div>
132
+
133
+ <div class="upload-placeholder" id="placeholderContent">
134
+ <i class="fa-solid fa-cloud-arrow-up upload-icon"></i>
135
+ <p class="upload-text">Click to Upload Retinal Scan</p>
136
+ <p class="upload-subtext">Supports JPG, PNG (Max 10MB)</p>
137
+ </div>
138
+
139
+ <img id="preview-img">
140
+ </div>
141
+
142
+ <input type="file" id="fileInput" hidden accept="image/*" onchange="previewFile()">
143
+
144
+ <button class="analyze-btn" id="analyzeBtn" onclick="runFullAnalysis()">
145
+ <i class="fa-solid fa-microchip"></i> START AI DIAGNOSIS
146
+ </button>
147
+
148
+ <div class="loading-container" id="loadingArea">
149
+ <div class="status-text-container">
150
+ <span style="color: #00f2fe;">Processing Image...</span>
151
+ <span id="progressPercent" style="color: #94a3b8;">0%</span>
152
+ </div>
153
+ <div class="progress-bar">
154
+ <div class="progress-fill" id="pFill"></div>
155
+ </div>
156
+ </div>
157
+ </div>
158
+
159
+ <script>
160
+ const previewImg = document.getElementById('preview-img');
161
+ const placeholderContent = document.getElementById('placeholderContent');
162
+ const dropZone = document.getElementById('dropZone');
163
+ const scanLine = document.getElementById('scan-line');
164
+ const pFill = document.getElementById('pFill');
165
+ const progressPercent = document.getElementById('progressPercent');
166
+ const loadingArea = document.getElementById('loadingArea');
167
+ const analyzeBtn = document.getElementById('analyzeBtn');
168
+ const fileInput = document.getElementById('fileInput');
169
+
170
+ // 1. File Preview Logic (Clean & Simple)
171
+ function previewFile() {
172
+ const file = fileInput.files[0];
173
+ if (!file) return;
174
+
175
+ const reader = new FileReader();
176
+ reader.onloadend = () => {
177
+ placeholderContent.style.display = 'none'; // Hide icon
178
+ previewImg.style.display = 'block'; // Show image
179
+ previewImg.src = reader.result;
180
+ // Add a cool border glow when image is loaded
181
+ dropZone.style.borderColor = '#00f2fe';
182
+ dropZone.style.boxShadow = '0 0 20px rgba(0, 242, 254, 0.2)';
183
+ }
184
+ reader.readAsDataURL(file);
185
+ }
186
+
187
+ // 2. The Analysis Logic (Removed Camera parts)
188
+ async function runFullAnalysis() {
189
+ if (!fileInput.files.length) {
190
+ alert("⚠️ Please upload a retinal scan image first.");
191
+ // Shake animation for feedback
192
+ dropZone.style.animation = 'shake 0.5s';
193
+ setTimeout(() => dropZone.style.animation = '', 500);
194
+ return;
195
+ }
196
+
197
+ // Start UI Animations
198
+ loadingArea.style.display = 'block';
199
+ scanLine.style.display = 'block';
200
+ scanLine.style.animation = 'scanning 1.5s infinite ease-in-out';
201
+ analyzeBtn.innerHTML = '<i class="fa-solid fa-circle-notch fa-spin"></i> Analyzing...';
202
+ analyzeBtn.disabled = true;
203
+ dropZone.style.pointerEvents = 'none'; // Prevent double upload during process
204
+
205
+ // Fake Progress Animation
206
+ let progress = 0;
207
+ let progressInterval = setInterval(() => {
208
+ if(progress < 95) {
209
+ progress += Math.floor(Math.random() * 5) + 1;
210
+ if(progress > 95) progress = 95;
211
+ pFill.style.width = progress + "%";
212
+ progressPercent.innerText = progress + "%";
213
+ }
214
+ }, 150);
215
+
216
+ // Prepare Data
217
+ const formData = new FormData();
218
+ formData.append('image', fileInput.files[0]);
219
+
220
+ try {
221
+ // Send to Python Backend
222
+ let response = await fetch('/predict', { method: 'POST', body: formData });
223
+ let data = await response.json();
224
+
225
+ // Save result to memory
226
+ localStorage.setItem('aiResult', JSON.stringify(data));
227
+
228
+ // Complete Animation
229
+ clearInterval(progressInterval);
230
+ pFill.style.width = "100%";
231
+ progressPercent.innerText = "100% - Complete";
232
+
233
+ setTimeout(() => { window.location.href = "/result"; }, 800);
234
+
235
+ } catch (error) {
236
+ clearInterval(progressInterval);
237
+ alert("❌ Error connecting to AI Server! Is Flask running?");
238
+ // Reset UI
239
+ analyzeBtn.innerHTML = '<i class="fa-solid fa-microchip"></i> START AI DIAGNOSIS';
240
+ analyzeBtn.disabled = false;
241
+ loadingArea.style.display = 'none';
242
+ scanLine.style.display = 'none';
243
+ dropZone.style.pointerEvents = 'auto';
244
+ }
245
+ }
246
+ </script>
247
+ <style>
248
+ @keyframes shake { 0% { transform: translateX(0); } 25% { transform: translateX(-10px); } 50% { transform: translateX(10px); } 75% { transform: translateX(-10px); } 100% { transform: translateX(0); } }
249
+ </style>
250
+ </body>
251
  </html>