Skip to content

Commit 66617e2

Browse files
committed
updated ui
1 parent 468a377 commit 66617e2

File tree

7 files changed

+165
-118
lines changed

7 files changed

+165
-118
lines changed

app.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from flask import Flask, jsonify, request, send_from_directory, render_template
1+
from flask import Flask, send_from_directory, jsonify, request, send_from_directory, render_template
22
import json
33
import os
44
from handlers import ScraperFactory
@@ -152,6 +152,14 @@ def feedback():
152152

153153
return jsonify({"status": "success", "message": "Feedback submitted successfully."})
154154

155+
@app.route("/robots.txt")
156+
def robots_txt():
157+
return send_from_directory(app.static_folder, "robots.txt")
158+
159+
@app.route("/sitemap.xml")
160+
def sitemap_xml():
161+
return send_from_directory(app.static_folder, "sitemap.xml")
162+
155163
if __name__ == "__main__":
156164
if os.getenv("FLASK_ENV") == "Production":
157165
app.run()

middleware.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,40 @@
55

66
def summarize_response(response):
77
content_type = response.content_type
8-
data = response.get_data(as_text=True)
98
preview = None
10-
item_count = None
9+
length = None
10+
11+
# Skip streaming/passthrough responses (like send_file)
12+
if getattr(response, "direct_passthrough", False):
13+
return {
14+
"content_type": content_type,
15+
"length": 0,
16+
"preview": "<streaming response>"
17+
}
1118

19+
data = response.get_data(as_text=True)
1220
try:
1321
if "application/json" in content_type:
1422
parsed = json.loads(data)
1523
if isinstance(parsed, list):
16-
item_count = len(parsed)
17-
preview = f"[List with {item_count} items]"
24+
preview = f"[List with {len(parsed)} items]"
1825
elif isinstance(parsed, dict):
19-
preview = json.dumps(parsed)[:150] + "..." if len(json.dumps(parsed)) > 150 else json.dumps(parsed)
26+
j = json.dumps(parsed)
27+
preview = j[:150] + "..." if len(j) > 150 else j
2028
else:
2129
preview = str(parsed)[:150]
2230
elif "text" in content_type:
2331
preview = data[:150] + "..." if len(data) > 150 else data
2432
else:
2533
preview = "[Binary or non-text response]"
26-
except Exception as e:
34+
length = len(response.get_data())
35+
except Exception:
2736
preview = "[Failed to parse response]"
37+
length = len(response.get_data())
2838

2939
return {
3040
"content_type": content_type,
31-
"length": len(response.get_data()),
41+
"length": length,
3242
"preview": preview
3343
}
3444

File renamed without changes.

static/script2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const topicInput = document.getElementById('topicInput');
1010
const topicDropdown = document.getElementById('topicDropdown');
1111
const notifyCheckboxes = document.querySelectorAll('input[name="notify_from"]');
1212
const subscription_status = document.getElementById("already-subscribed");
13-
const icon = document.getElementById('logo');
13+
const icon = document.getElementById('notification-icon');
1414
const panel = document.getElementById('right-panel');
1515
const dot = document.getElementById("notification-dot");
1616
const chatMessage = document.getElementById("chat-message");
File renamed without changes.

static/style3.css

Lines changed: 112 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ body {
44
font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
55
background-color: #f4f6f9;
66
color: #222;
7+
padding-bottom: 200px;
78
}
89

910
.container {
@@ -12,14 +13,6 @@ body {
1213
padding: 2rem 1rem;
1314
}
1415

15-
/* Typography */
16-
.page-title {
17-
text-align: center;
18-
font-size: 1.8rem;
19-
font-weight: 700;
20-
margin-bottom: 2rem;
21-
}
22-
2316
/* Form */
2417
.subscription-form {
2518
display: flex;
@@ -162,35 +155,6 @@ input:focus {
162155
cursor: pointer;
163156
}
164157

165-
.intro-text {
166-
text-align: center;
167-
max-width: 600px;
168-
margin: 0 auto 20px auto;
169-
font-size: 1.1rem;
170-
color: #333;
171-
line-height: 1.6rem;
172-
}
173-
174-
.footer {
175-
text-align: center;
176-
max-width: 600px;
177-
margin: 0 auto 20px auto;
178-
font-size: 0.8rem;
179-
color: #646464;
180-
line-height: 1.6rem;
181-
}
182-
.seo-text
183-
{
184-
line-height: 1.6rem;
185-
text-align: center;
186-
max-width: 600px;
187-
margin: auto;
188-
font-size: 0.8rem;
189-
color: #5c5b5b;
190-
line-height: 1.6rem;
191-
width: 35%;
192-
}
193-
194158
.tag-checkbox-group {
195159
display: flex;
196160
flex-wrap: wrap;
@@ -207,40 +171,48 @@ input:focus {
207171
font-weight: 500;
208172
cursor: pointer;
209173
user-select: none;
210-
position: relative; /* <-- needed for tooltip */
174+
position: relative;
175+
/* <-- needed for tooltip */
211176
}
212177

213178
.tag-checkbox input[disabled] {
214-
pointer-events: none; /* disabled input won’t capture hover */
179+
pointer-events: none;
180+
/* disabled input won’t capture hover */
215181
}
216182

217183
.subscription-toast {
218-
position: fixed; /* out of document flow */
219-
bottom: 20px; /* bottom-right corner */
184+
position: fixed;
185+
/* out of document flow */
186+
bottom: 20px;
187+
/* bottom-right corner */
220188
right: 20px;
221189
background-color: #e6f4ea;
222190
color: #2e7d32;
223191
padding: 12px 20px;
224192
border-radius: 8px;
225-
box-shadow: 0 2px 10px rgba(0,0,0,0.2);
193+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
226194
opacity: 0;
227-
pointer-events: none; /* clicks go through when hidden */
195+
pointer-events: none;
196+
/* clicks go through when hidden */
228197
transition: opacity 0.5s ease, transform 0.5s ease;
229-
transform: translateY(20px); /* start slightly lower */
198+
transform: translateY(20px);
199+
/* start slightly lower */
230200
z-index: 9999;
231201
}
232202

233203
.subscription-toast.show {
234204
opacity: 1;
235205
pointer-events: auto;
236-
transform: translateY(0); /* move to visible position */
206+
transform: translateY(0);
207+
/* move to visible position */
237208
}
238209

239210
/* Tooltip styling */
240211
.tooltip {
241212
visibility: hidden;
242213
position: absolute;
243-
bottom: 125%; /* above the tag */
214+
bottom: 125%;
215+
/* above the tag */
244216
left: 50%;
245217
transform: translateX(-50%);
246218
background-color: #333;
@@ -260,17 +232,25 @@ input:focus {
260232
}
261233

262234
.notify-from-group label {
263-
display: block; /* ensures the label is on its own line */
264-
margin-bottom: 0.5rem; /* adjust the gap as needed */
265-
font-weight: 600; /* optional: make label slightly bolder */
235+
display: block;
236+
/* ensures the label is on its own line */
237+
margin-bottom: 0.5rem;
238+
/* adjust the gap as needed */
239+
font-weight: 600;
240+
/* optional: make label slightly bolder */
266241
}
267242

268243
#companyInput:disabled {
269-
background-color: #f0f0f0; /* lighter gray */
270-
color: #999; /* gray text */
271-
cursor: not-allowed; /* show “disabled” cursor */
272-
border: 1px solid #ccc; /* optional border styling */
273-
opacity: 0.8; /* slightly faded */
244+
background-color: #f0f0f0;
245+
/* lighter gray */
246+
color: #999;
247+
/* gray text */
248+
cursor: not-allowed;
249+
/* show “disabled” cursor */
250+
border: 1px solid #ccc;
251+
/* optional border styling */
252+
opacity: 0.8;
253+
/* slightly faded */
274254
}
275255

276256
/* Show tooltip on hover */
@@ -285,7 +265,8 @@ input:focus {
285265
right: -280px;
286266
width: 240px;
287267
height: 100vh;
288-
background-color: rgba(234, 236, 240, 0.5); /* same color with transparency */
268+
background-color: rgba(234, 236, 240, 0.5);
269+
/* same color with transparency */
289270
backdrop-filter: blur(10px);
290271
-webkit-backdrop-filter: blur(10px);
291272
border-left: 2px solid rgba(200, 200, 200, 0.5);
@@ -320,34 +301,15 @@ input:focus {
320301
animation: float 1.5s infinite alternate;
321302
}
322303

323-
.logo {
324-
display: block;
325-
width: 50px;
326-
height: 50px;
327-
object-fit: cover;
328-
top: -10px;
329-
right: -10px;
330-
position: absolute;
331-
/* soften corners */
332-
border-radius: 10px; /* try 8px, 12px, or even 16px for more rounded */
333-
334-
/* keep the nice look */
335-
background: white;
336-
border: 2px solid #fff;
337-
box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
338-
339-
transition: transform 0.3s ease, box-shadow 0.3s ease;
340-
}
341-
342-
.logo:hover {
343-
transform: scale(1.08);
344-
box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
345-
}
346-
347304
/* Floating animation for cat */
348305
@keyframes float {
349-
0% { transform: translateY(0px); }
350-
100% { transform: translateY(-5px); }
306+
0% {
307+
transform: translateY(0px);
308+
}
309+
310+
100% {
311+
transform: translateY(-5px);
312+
}
351313
}
352314

353315
/* Message bubble */
@@ -358,7 +320,7 @@ input:focus {
358320
border-radius: 15px;
359321
font-size: 16px;
360322
line-height: 1.4;
361-
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
323+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
362324
}
363325

364326
#notification-wrapper {
@@ -382,14 +344,16 @@ input:focus {
382344
height: 10px;
383345
background-color: red;
384346
border-radius: 50%;
385-
display: block; /* initially visible */
347+
display: block;
348+
/* initially visible */
386349
}
387350

388351
.feedback-form-card {
389352
background-color: #f0f4f8;
390353
padding: 10px;
391354
margin-top: 10px;
392-
display: none; /* hidden by default */
355+
display: none;
356+
/* hidden by default */
393357
}
394358

395359
/* Textarea and button styling */
@@ -416,10 +380,6 @@ input:focus {
416380
padding: 1.5rem;
417381
}
418382

419-
.page-title {
420-
font-size: 1.5rem;
421-
}
422-
423383
input,
424384
.submit-button {
425385
font-size: 1rem;
@@ -430,8 +390,71 @@ input:focus {
430390
.tag-checkbox-group {
431391
gap: 0.5rem;
432392
}
393+
433394
.tag-checkbox {
434395
padding: 5px 12px;
435396
font-size: 0.85rem;
436397
}
437-
}
398+
}
399+
400+
.page-title-cont {
401+
display: flex;
402+
margin-bottom: 1rem;
403+
}
404+
405+
.page-title {
406+
display: inline-block;
407+
line-height: 1.6rem;
408+
font-size: 1.5rem;
409+
margin-bottom: 0.5rem;
410+
color: #585858;
411+
}
412+
413+
.intro-text {
414+
margin: 0 auto 20px auto;
415+
font-size: 1rem;
416+
color: #828282;
417+
line-height: 1.2rem;
418+
}
419+
420+
.logo {
421+
width: 70px;
422+
height: 70px;
423+
object-fit: cover;
424+
border-radius: 10px;
425+
margin-top: 0.9rem;
426+
427+
background: white;
428+
border: 2px solid #fff;
429+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
430+
431+
transition: transform 0.3s ease, box-shadow 0.3s ease;
432+
display: inline-block;
433+
}
434+
435+
/* .logo:hover {
436+
transform: scale(1.08);
437+
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.35);
438+
} */
439+
440+
.seo-text {
441+
text-align: center;
442+
margin: auto;
443+
font-size: 0.7rem;
444+
color: #585858;
445+
padding: 1rem;
446+
max-width: 500px;
447+
}
448+
449+
.footer {
450+
position: fixed;
451+
bottom: 0;
452+
left: 0;
453+
width: 100%;
454+
text-align: center;
455+
font-size: 0.8rem;
456+
color: #828282;
457+
padding: auto;
458+
border-top: 1px solid #ddd;
459+
background-color: #f4f6f9;
460+
}

0 commit comments

Comments
 (0)