WebashalarForML commited on
Commit
20b8285
·
verified ·
1 Parent(s): 0edc3f0

Update templates/result.html

Browse files
Files changed (1) hide show
  1. templates/result.html +237 -160
templates/result.html CHANGED
@@ -5,244 +5,321 @@
5
  <meta charset="UTF-8" />
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
  <title>Processed Results</title>
 
8
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" />
9
  <style>
 
 
 
 
 
 
 
 
10
  body {
11
- background-color: #1c1c1e;
12
- font-family: "Poppins", sans-serif;
13
  color: #f5f5f7;
 
 
 
14
  }
15
 
16
- h1 {
17
- color: #e5e5e7;
18
- text-align: center;
 
 
 
 
 
 
19
  }
20
 
21
- .cont {
22
- background-color: #2c2c2e;
23
- padding: 30px;
24
- border-radius: 15px;
25
- box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
26
- transition: 1s ease;
 
 
 
 
 
 
 
 
27
  }
28
 
29
  .section-title {
30
- color: #ee4410;
31
- font-size: 1.5rem;
32
- font-weight: bold;
33
- margin-top: 20px;
34
- border-bottom: 2px solid #ee4410;
35
- padding-bottom: 10px;
 
36
  }
37
 
38
- .card {
39
- background-color: #3a3a3c;
40
- color: #f5f5f7;
41
- border-radius: 10px;
42
- margin-bottom: 15px;
43
- padding: 15px;
44
- box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
45
- transition: background-color 0.3s ease;
46
  }
47
 
48
- .card:hover {
49
- background-color: #3a3a3c98;
 
 
 
 
50
  }
51
 
52
- .card-title {
53
- color: #ee4410;
54
- font-size: 1.2rem;
55
- font-weight: bold;
56
  }
57
 
58
- .card-text {
59
- color: #d1d1d6;
60
- font-size: 1rem;
 
61
  }
62
 
63
- ul {
64
- list-style-type: none;
65
- padding-left: 0;
 
 
66
  }
67
 
68
- li::before {
69
- content: "• ";
70
- color: #ee4410;
71
  }
72
 
73
- .btn-reset {
74
- background-color: #ff9f0a;
75
- color: white;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  border: none;
77
- padding: 10px 20px;
78
- border-radius: 5px;
79
- transition: background-color 0.3s ease;
80
- margin-bottom: 20px;
 
 
 
 
 
 
 
 
 
 
81
  }
82
 
83
- .btn-reset:hover {
84
- background-color: #e03a2f;
 
 
 
 
 
85
  }
86
 
87
- .alert {
88
- text-align: center;
89
- position: absolute;
90
- top: 0;
91
- right: 15%;
92
  }
93
 
94
- .image-container img {
95
- max-width: 100%;
96
- border-radius: 10px;
 
 
 
 
 
97
  }
98
  </style>
 
99
  </head>
100
 
101
  <body>
102
- <div class="container">
103
- {% with messages = get_flashed_messages() %} {% if messages %}
104
- <div class="alert alert-success mt-4 " id="flash-message">
 
105
  {{ messages[0] }}
106
  </div>
107
- {% endif %} {% endwith %}
108
- </div>
109
 
110
- <div class="container cont mt-5">
111
- <div class="d-flex align-items-center justify-content-between">
112
- <h1>Extracted Details From Image</h1>
113
- <!-- Reset Button -->
114
- <div class="text-center mt-4">
115
- <a href="{{ url_for('reset_upload') }}" class="btn btn-reset">Reset & Upload New File</a>
116
- </div>
117
  </div>
118
 
119
  {% if data %}
120
- <!-- Personal Information Section -->
121
- <section>
122
- <h3 class="section-title">Extracted Information</h3>
123
- <div class="row">
124
- <!-- Image Container on the Left -->
125
- <div class="col-md-6 image-container">
126
- <div class="card">
127
- <div class="card-body">
128
- {% if data.extracted_text.items() %}
129
- <h5 class="card-title">Extracted Image:</h5>
130
- <ul>
131
  {% for filename, text in data.extracted_text.items() %}
132
- <!--<li>{{ filename }}:</li>-->
133
- <img src="{{ Img[filename] }}" alt="Processed Image" class="img-fluid" />
 
 
134
  {% endfor %}
135
- </ul>
 
136
  {% endif %}
137
- </div>
138
- </div>
139
  </div>
 
140
 
141
- <!-- Extracted Text on the Right -->
142
- <div class="col-md-6">
143
- <div class="card">
144
- <div class="card-body">
145
- {% if data.name and data.name is iterable and data.name is not string %}
146
- <h5 class="card-title">Name:</h5>
147
- <ul>
148
- {% for value in data.name %}
149
- {% if value|lower != 'not found' %}
150
- <li>{{ value }}</li>
151
- {% endif %}
152
- {% endfor %}
153
- </ul>
 
 
154
  {% endif %}
155
 
156
- {% if data.Designation and data.Designation is iterable and data.Designation is not string %}
157
- <h5 class="card-title">Designation:</h5>
158
- <ul>
159
- {% for value in data.Designation %}
160
- {% if value|lower != 'not found' %}
161
- <li>{{ value }}</li>
162
- {% endif %}
163
- {% endfor %}
164
- </ul>
165
  {% endif %}
166
 
167
- {% if data.contact_number and data.contact_number is iterable and data.contact_number is not string %}
168
- <h5 class="card-title">Contact number:</h5>
169
- <ul>
170
- {% for value in data.contact_number %}
171
- {% if value|lower != 'not found' %}
172
- <li>{{ value }}</li>
173
- {% endif %}
174
- {% endfor %}
175
- </ul>
176
  {% endif %}
 
177
 
178
- {% if data.email and data.email is iterable and data.email is not string %}
179
- <h5 class="card-title">Email:</h5>
180
- <ul>
181
- {% for value in data.email %}
182
- {% if value|lower != 'not found' %}
183
- <li>{{ value }}</li>
184
- {% endif %}
185
- {% endfor %}
186
- </ul>
187
  {% endif %}
188
 
189
- {% if data.Location and data.Location is iterable and data.Location is not string %}
190
- <h5 class="card-title">Location:</h5>
191
- <ul>
192
- {% for value in data.Location %}
193
- {% if value|lower != 'not found' %}
194
- <li>{{ value }}</li>
195
- {% endif %}
196
- {% endfor %}
197
- </ul>
198
  {% endif %}
199
 
200
- {% if data.Link and data.Link is iterable and data.Link is not string %}
201
- <h5 class="card-title">Link:</h5>
202
- <ul>
203
- {% for value in data.Link %}
204
- {% if value|lower != 'not found' %}
205
- <li>{{ value }}</li>
206
- {% endif %}
207
- {% endfor %}
208
- </ul>
209
  {% endif %}
210
 
211
- {% if data.Company and data.Company is iterable and data.Company is not string %}
212
- <h5 class="card-title">Organisation:</h5>
213
- <ul>
214
- {% for value in data.Company %}
215
- {% if value|lower != 'not found' %}
216
- <li>{{ value }}</li>
217
- {% endif %}
218
- {% endfor %}
219
- </ul>
220
  {% endif %}
221
  </div>
222
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  </div>
224
  </div>
225
- </section>
 
226
 
227
  {% else %}
228
- <p>No data available. Please process a file.</p>
 
 
 
 
229
  {% endif %}
230
  </div>
231
 
232
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
233
- <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
234
- <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
235
- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
236
  <script>
 
237
  setTimeout(function () {
238
  let flashMessage = document.getElementById("flash-message");
239
  if (flashMessage) {
240
- flashMessage.style.transition = "opacity 1s ease";
241
  flashMessage.style.opacity = 0;
242
- setTimeout(() => flashMessage.remove(), 1000);
 
243
  }
244
- }, 3000);
245
  </script>
246
  </body>
 
247
 
248
  </html>
 
5
  <meta charset="UTF-8" />
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
  <title>Processed Results</title>
8
+ <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&display=swap" rel="stylesheet">
9
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" />
10
  <style>
11
+ :root {
12
+ --primary: #ee4410;
13
+ --secondary: #ff9f0a;
14
+ --bg-dark: #0a0a0c;
15
+ --card-bg: rgba(30, 30, 35, 0.7);
16
+ --text-glow: 0 0 10px rgba(238, 68, 16, 0.5);
17
+ }
18
+
19
  body {
20
+ background-color: var(--bg-dark);
21
+ font-family: 'Outfit', sans-serif;
22
  color: #f5f5f7;
23
+ overflow-x: hidden;
24
+ background: radial-gradient(circle at 50% 50%, #1a1a1f 0%, #0a0a0c 100%);
25
+ min-height: 100vh;
26
  }
27
 
28
+ .glass-card {
29
+ background: var(--card-bg);
30
+ backdrop-filter: blur(12px);
31
+ border: 1px solid rgba(255, 255, 255, 0.1);
32
+ border-radius: 20px;
33
+ box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
34
+ transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
35
+ padding: 2rem;
36
+ margin-bottom: 2rem;
37
  }
38
 
39
+ .glass-card:hover {
40
+ transform: translateY(-5px);
41
+ border-color: rgba(238, 68, 16, 0.3);
42
+ box-shadow: 0 20px 45px rgba(238, 68, 16, 0.1);
43
+ }
44
+
45
+ .premium-title {
46
+ background: linear-gradient(135deg, #fff 0%, #aaa 100%);
47
+ -webkit-background-clip: text;
48
+ -webkit-text-fill-color: transparent;
49
+ font-weight: 600;
50
+ letter-spacing: -1px;
51
+ text-shadow: var(--text-glow);
52
+ margin-bottom: 1.5rem;
53
  }
54
 
55
  .section-title {
56
+ color: var(--primary);
57
+ font-size: 1.1rem;
58
+ text-transform: uppercase;
59
+ letter-spacing: 2px;
60
+ margin-bottom: 1.5rem;
61
+ display: flex;
62
+ align-items: center;
63
  }
64
 
65
+ .section-title::after {
66
+ content: '';
67
+ flex: 1;
68
+ height: 1px;
69
+ background: linear-gradient(90deg, var(--primary), transparent);
70
+ margin-left: 1rem;
 
 
71
  }
72
 
73
+ .data-item {
74
+ margin-bottom: 1.5rem;
75
+ border-left: 3px solid var(--primary);
76
+ padding-left: 1rem;
77
+ animation: fadeIn 0.6s ease-out forwards;
78
+ opacity: 0;
79
  }
80
 
81
+ @keyframes fadeIn {
82
+ from { opacity: 0; transform: translateX(-10px); }
83
+ to { opacity: 1; transform: translateX(0); }
 
84
  }
85
 
86
+ .data-label {
87
+ color: #8e8e93;
88
+ font-size: 0.85rem;
89
+ margin-bottom: 0.2rem;
90
  }
91
 
92
+ .data-value {
93
+ font-size: 1.1rem;
94
+ color: #fff;
95
+ list-style: none;
96
+ padding: 0;
97
  }
98
 
99
+ .data-value li {
100
+ margin-bottom: 0.4rem;
 
101
  }
102
 
103
+ .result-img-container {
104
+ border-radius: 15px;
105
+ overflow: hidden;
106
+ border: 1px solid rgba(255, 255, 255, 0.1);
107
+ position: relative;
108
+ }
109
+
110
+ .result-img-container img {
111
+ width: 100%;
112
+ height: auto;
113
+ display: block;
114
+ transition: transform 0.5s ease;
115
+ }
116
+
117
+ .result-img-container:hover img {
118
+ transform: scale(1.05);
119
+ }
120
+
121
+ .btn-premium {
122
+ background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
123
  border: none;
124
+ color: white;
125
+ padding: 0.8rem 2rem;
126
+ border-radius: 30px;
127
+ font-weight: 600;
128
+ box-shadow: 0 5px 15px rgba(238, 68, 16, 0.3);
129
+ text-decoration: none;
130
+ transition: all 0.3s ease;
131
+ display: inline-block;
132
+ }
133
+
134
+ .btn-premium:hover {
135
+ transform: scale(1.05);
136
+ box-shadow: 0 8px 25px rgba(238, 68, 16, 0.5);
137
+ color: #fff;
138
  }
139
 
140
+ .alert-premium {
141
+ background: rgba(40, 40, 45, 0.9);
142
+ border: 1px solid var(--primary);
143
+ color: #fff;
144
+ border-radius: 12px;
145
+ padding: 1rem;
146
+ animation: slideDown 0.5s cubic-bezier(0.19, 1, 0.22, 1);
147
  }
148
 
149
+ @keyframes slideDown {
150
+ from { transform: translateY(-50px); opacity: 0; }
151
+ to { transform: translateY(0); opacity: 1; }
 
 
152
  }
153
 
154
+ .debug-panel {
155
+ margin-top: 4rem;
156
+ padding: 2rem;
157
+ background: rgba(0, 0, 0, 0.3);
158
+ border-top: 1px solid rgba(255, 255, 255, 0.05);
159
+ font-family: monospace;
160
+ font-size: 0.8rem;
161
+ color: #666;
162
  }
163
  </style>
164
+ </style>
165
  </head>
166
 
167
  <body>
168
+ <div class="container py-5">
169
+ {% with messages = get_flashed_messages() %}
170
+ {% if messages %}
171
+ <div class="alert-premium mb-4" id="flash-message">
172
  {{ messages[0] }}
173
  </div>
174
+ {% endif %}
175
+ {% endwith %}
176
 
177
+ <div class="d-flex align-items-center justify-content-between mb-5">
178
+ <h1 class="premium-title mb-0">Extraction Analysis</h1>
179
+ <a href="{{ url_for('reset_upload') }}" class="btn-premium">Process New Image</a>
 
 
 
 
180
  </div>
181
 
182
  {% if data %}
183
+ <div class="row g-4">
184
+ <!-- Source Image Column -->
185
+ <div class="col-lg-5">
186
+ <div class="glass-card">
187
+ <h3 class="section-title">Source Image</h3>
188
+ {% if data.extracted_text %}
 
 
 
 
 
189
  {% for filename, text in data.extracted_text.items() %}
190
+ <div class="result-img-container mb-3">
191
+ <img src="{{ Img[filename] }}" alt="Analyzed Document" />
192
+ </div>
193
+ <p class="text-muted small">File: {{ filename | basename }}</p>
194
  {% endfor %}
195
+ {% else %}
196
+ <div class="p-4 text-center text-muted">No image path available</div>
197
  {% endif %}
 
 
198
  </div>
199
+ </div>
200
 
201
+ <!-- Extracted Details Column -->
202
+ <div class="col-lg-7">
203
+ <div class="glass-card">
204
+ <h3 class="section-title">Verified Details</h3>
205
+
206
+ <div class="row">
207
+ <!-- Left Data Sub-col -->
208
+ <div class="col-md-6">
209
+ {% if data.name %}
210
+ <div class="data-item" style="animation-delay: 0.1s">
211
+ <div class="data-label">Full Name</div>
212
+ <ul class="data-value">
213
+ {% for val in data.name %}<li>{{ val }}</li>{% endfor %}
214
+ </ul>
215
+ </div>
216
  {% endif %}
217
 
218
+ {% if data.Designation %}
219
+ <div class="data-item" style="animation-delay: 0.2s">
220
+ <div class="data-label">Designation</div>
221
+ <ul class="data-value">
222
+ {% for val in data.Designation %}<li>{{ val }}</li>{% endfor %}
223
+ </ul>
224
+ </div>
 
 
225
  {% endif %}
226
 
227
+ {% if data.Company %}
228
+ <div class="data-item" style="animation-delay: 0.3s">
229
+ <div class="data-label">Organization</div>
230
+ <ul class="data-value">
231
+ {% for val in data.Company %}<li>{{ val }}</li>{% endfor %}
232
+ </ul>
233
+ </div>
 
 
234
  {% endif %}
235
+ </div>
236
 
237
+ <!-- Right Data Sub-col -->
238
+ <div class="col-md-6">
239
+ {% if data.contact_number %}
240
+ <div class="data-item" style="animation-delay: 0.4s">
241
+ <div class="data-label">Phone Numbers</div>
242
+ <ul class="data-value">
243
+ {% for val in data.contact_number %}<li>{{ val }}</li>{% endfor %}
244
+ </ul>
245
+ </div>
246
  {% endif %}
247
 
248
+ {% if data.email %}
249
+ <div class="data-item" style="animation-delay: 0.5s">
250
+ <div class="data-label">Email Addresses</div>
251
+ <ul class="data-value">
252
+ {% for val in data.email %}<li>{{ val }}</li>{% endfor %}
253
+ </ul>
254
+ </div>
 
 
255
  {% endif %}
256
 
257
+ {% if data.Location %}
258
+ <div class="data-item" style="animation-delay: 0.6s">
259
+ <div class="data-label">Address</div>
260
+ <ul class="data-value">
261
+ {% for val in data.Location %}<li>{{ val }}</li>{% endfor %}
262
+ </ul>
263
+ </div>
 
 
264
  {% endif %}
265
 
266
+ {% if data.Link %}
267
+ <div class="data-item" style="animation-delay: 0.7s">
268
+ <div class="data-label">Social/Web Links</div>
269
+ <ul class="data-value">
270
+ {% for val in data.Link %}<li>{{ val }}</li>{% endfor %}
271
+ </ul>
272
+ </div>
 
 
273
  {% endif %}
274
  </div>
275
  </div>
276
+
277
+ {% if not (data.name or data.contact_number or data.email or data.Location or data.Designation or data.Company or data.Link) %}
278
+ <div class="text-center py-5">
279
+ <p class="text-muted">No specific entities detected high-confidence.</p>
280
+ <p class="small">Check the "Raw Information" panel below for OCR output.</p>
281
+ </div>
282
+ {% endif %}
283
+ </div>
284
+ </div>
285
+ </div>
286
+
287
+ <!-- Debug / Raw Output Panel -->
288
+ <div class="debug-panel rounded">
289
+ <h5 class="mb-3" style="color: #444; font-size: 0.9rem">SYSTEM_LOG :: RAW_EXTRACTION_BUFFER</h5>
290
+ {% for filename, raw in data.extracted_text.items() %}
291
+ <div class="mb-4">
292
+ <div class="mb-1 text-primary">>> {{ filename | basename }}</div>
293
+ <div class="p-3 bg-black rounded" style="color: #0f0; opacity: 0.8; font-size: 0.85rem">
294
+ {{ raw }}
295
  </div>
296
  </div>
297
+ {% endfor %}
298
+ </div>
299
 
300
  {% else %}
301
+ <div class="text-center glass-card py-5">
302
+ <h2 class="premium-title">Waiting for Data...</h2>
303
+ <p class="text-muted">No analysis results found in session.</p>
304
+ <a href="{{ url_for('index') }}" class="btn-premium mt-3">Back to Upload</a>
305
+ </div>
306
  {% endif %}
307
  </div>
308
 
309
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
 
 
 
310
  <script>
311
+ // Auto-remove flash messages
312
  setTimeout(function () {
313
  let flashMessage = document.getElementById("flash-message");
314
  if (flashMessage) {
315
+ flashMessage.style.transition = "all 0.8s ease";
316
  flashMessage.style.opacity = 0;
317
+ flashMessage.style.transform = "translateY(-20px)";
318
+ setTimeout(() => flashMessage.remove(), 800);
319
  }
320
+ }, 4000);
321
  </script>
322
  </body>
323
+ </html>
324
 
325
  </html>