Spaces:
Sleeping
Sleeping
Update ui/suggestions_tab.py
Browse files- ui/suggestions_tab.py +31 -22
ui/suggestions_tab.py
CHANGED
@@ -13,40 +13,45 @@ def create_suggestions_tab():
|
|
13 |
elem_classes="centered-text"
|
14 |
)
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
)
|
34 |
|
35 |
-
# Connect logic
|
36 |
suggest_btn.click(
|
37 |
generate_product_description,
|
38 |
inputs=suggestion_input,
|
39 |
outputs=suggestions_output
|
40 |
)
|
41 |
|
42 |
-
# Styling
|
43 |
gr.Markdown(
|
44 |
"""
|
45 |
<style>
|
46 |
.centered-text {
|
47 |
text-align: center;
|
48 |
-
font-size:
|
49 |
-
font-weight:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
}
|
51 |
#suggestion-box textarea {
|
52 |
font-family: 'Courier New', monospace;
|
@@ -54,7 +59,11 @@ def create_suggestions_tab():
|
|
54 |
background-color: #111827;
|
55 |
color: #e5e7eb;
|
56 |
border-radius: 10px;
|
57 |
-
padding:
|
|
|
|
|
|
|
|
|
58 |
}
|
59 |
</style>
|
60 |
"""
|
|
|
13 |
elem_classes="centered-text"
|
14 |
)
|
15 |
|
16 |
+
with gr.Box(elem_id="suggestion-form-box"):
|
17 |
+
with gr.Row():
|
18 |
+
suggestion_input = gr.Textbox(
|
19 |
+
label="💬 Your Request",
|
20 |
+
placeholder="Try: Gifts under 500, or Shampoo for dry hair",
|
21 |
+
lines=1,
|
22 |
+
scale=4
|
23 |
+
)
|
24 |
+
suggest_btn = gr.Button("🔍 Get Suggestions", scale=1)
|
25 |
|
26 |
+
suggestions_output = gr.Textbox(
|
27 |
+
label="✨ Suggested Products",
|
28 |
+
lines=10,
|
29 |
+
interactive=False,
|
30 |
+
show_copy_button=True,
|
31 |
+
elem_id="suggestion-box"
|
32 |
+
)
|
|
|
33 |
|
|
|
34 |
suggest_btn.click(
|
35 |
generate_product_description,
|
36 |
inputs=suggestion_input,
|
37 |
outputs=suggestions_output
|
38 |
)
|
39 |
|
|
|
40 |
gr.Markdown(
|
41 |
"""
|
42 |
<style>
|
43 |
.centered-text {
|
44 |
text-align: center;
|
45 |
+
font-size: 18px;
|
46 |
+
font-weight: 600;
|
47 |
+
}
|
48 |
+
#suggestion-form-box {
|
49 |
+
margin-top: 15px;
|
50 |
+
border: 1px solid #333;
|
51 |
+
border-radius: 12px;
|
52 |
+
padding: 20px;
|
53 |
+
background: #1c1c1c;
|
54 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.4);
|
55 |
}
|
56 |
#suggestion-box textarea {
|
57 |
font-family: 'Courier New', monospace;
|
|
|
59 |
background-color: #111827;
|
60 |
color: #e5e7eb;
|
61 |
border-radius: 10px;
|
62 |
+
padding: 12px;
|
63 |
+
}
|
64 |
+
button {
|
65 |
+
font-weight: bold;
|
66 |
+
font-size: 14px;
|
67 |
}
|
68 |
</style>
|
69 |
"""
|