Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -104,17 +104,20 @@ def search_apps(user_query):
|
|
| 104 |
except Exception as e:
|
| 105 |
return f"<div style='color:red;'>Error: {str(e)}</div>"
|
| 106 |
|
| 107 |
-
# --- 3. The UI (
|
| 108 |
-
with gr.Blocks() as demo:
|
| 109 |
|
|
|
|
| 110 |
gr.Markdown("# 📱 AI App Recommender")
|
| 111 |
-
gr.Markdown("Describe what you need, and the AI will find the best apps for you.")
|
| 112 |
|
| 113 |
-
#
|
| 114 |
with gr.Tabs():
|
| 115 |
|
| 116 |
-
# TAB 1: SEARCH
|
| 117 |
with gr.Tab("🔍 Find Apps"):
|
|
|
|
|
|
|
|
|
|
| 118 |
with gr.Column():
|
| 119 |
with gr.Row():
|
| 120 |
txt_input = gr.Textbox(show_label=False, placeholder="Type here... (e.g., 'I need a puzzle game for kids')", scale=4)
|
|
@@ -123,16 +126,18 @@ with gr.Blocks() as demo: # Removed theme from here (Fixes Warning)
|
|
| 123 |
gr.Examples(examples=[["I want a timer for my kitchen"], ["A game to learn math"]], inputs=txt_input)
|
| 124 |
output_html = gr.HTML(label="Recommended Apps")
|
| 125 |
|
| 126 |
-
# TAB 2: VIDEO (
|
| 127 |
with gr.Tab("🎥 Video Presentation"):
|
| 128 |
gr.Markdown("### Watch our project presentation below:")
|
| 129 |
|
| 130 |
-
#
|
| 131 |
gr.HTML("""
|
| 132 |
-
<
|
| 133 |
-
<
|
| 134 |
-
|
| 135 |
-
|
|
|
|
|
|
|
| 136 |
""")
|
| 137 |
|
| 138 |
# --- FOOTER ---
|
|
@@ -142,5 +147,5 @@ with gr.Blocks() as demo: # Removed theme from here (Fixes Warning)
|
|
| 142 |
btn_submit.click(fn=search_apps, inputs=txt_input, outputs=output_html)
|
| 143 |
txt_input.submit(fn=search_apps, inputs=txt_input, outputs=output_html)
|
| 144 |
|
| 145 |
-
# --- Launch
|
| 146 |
demo.launch(theme=gr.themes.Soft())
|
|
|
|
| 104 |
except Exception as e:
|
| 105 |
return f"<div style='color:red;'>Error: {str(e)}</div>"
|
| 106 |
|
| 107 |
+
# --- 3. The UI (Rearranged Layout) ---
|
| 108 |
+
with gr.Blocks() as demo:
|
| 109 |
|
| 110 |
+
# Title stays at the absolute top (Header)
|
| 111 |
gr.Markdown("# 📱 AI App Recommender")
|
|
|
|
| 112 |
|
| 113 |
+
# TABS are now at the top of the content
|
| 114 |
with gr.Tabs():
|
| 115 |
|
| 116 |
+
# --- TAB 1: SEARCH ---
|
| 117 |
with gr.Tab("🔍 Find Apps"):
|
| 118 |
+
# Description is now INSIDE the tab, above the search bar
|
| 119 |
+
gr.Markdown("Describe what you need, and the AI will find the best apps for you.")
|
| 120 |
+
|
| 121 |
with gr.Column():
|
| 122 |
with gr.Row():
|
| 123 |
txt_input = gr.Textbox(show_label=False, placeholder="Type here... (e.g., 'I need a puzzle game for kids')", scale=4)
|
|
|
|
| 126 |
gr.Examples(examples=[["I want a timer for my kitchen"], ["A game to learn math"]], inputs=txt_input)
|
| 127 |
output_html = gr.HTML(label="Recommended Apps")
|
| 128 |
|
| 129 |
+
# --- TAB 2: VIDEO (Smaller & Centered) ---
|
| 130 |
with gr.Tab("🎥 Video Presentation"):
|
| 131 |
gr.Markdown("### Watch our project presentation below:")
|
| 132 |
|
| 133 |
+
# Smaller video (600px) and centered
|
| 134 |
gr.HTML("""
|
| 135 |
+
<div style="display: flex; justify-content: center; align-items: center;">
|
| 136 |
+
<video width="600" controls style="border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.1);">
|
| 137 |
+
<source src="https://huggingface.co/spaces/Liori25/ReccomendationSystemForApps/resolve/main/PresentationVideo.mp4" type="video/mp4">
|
| 138 |
+
Your browser does not support the video tag.
|
| 139 |
+
</video>
|
| 140 |
+
</div>
|
| 141 |
""")
|
| 142 |
|
| 143 |
# --- FOOTER ---
|
|
|
|
| 147 |
btn_submit.click(fn=search_apps, inputs=txt_input, outputs=output_html)
|
| 148 |
txt_input.submit(fn=search_apps, inputs=txt_input, outputs=output_html)
|
| 149 |
|
| 150 |
+
# --- Launch ---
|
| 151 |
demo.launch(theme=gr.themes.Soft())
|