Update app.py
Browse files
app.py
CHANGED
@@ -172,6 +172,26 @@ def display_iframe():
|
|
172 |
def display_iframe2():
|
173 |
return iframe2
|
174 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
theme = gr.themes.Default(
|
176 |
primary_hue="neutral",
|
177 |
secondary_hue="neutral",
|
@@ -191,6 +211,7 @@ theme = gr.themes.Default(
|
|
191 |
|
192 |
# Setup the Gradio Blocks interface with custom layout components
|
193 |
with gr.Blocks(theme=theme) as demo:
|
|
|
194 |
gr.Image("CalmConnect.jpg", show_label = False, show_share_button = False, show_download_button = False)
|
195 |
gr.Markdown(welcome_message) # Display the formatted welcome message
|
196 |
with gr.Row():
|
@@ -211,29 +232,6 @@ with gr.Blocks(theme=theme) as demo:
|
|
211 |
big_block2 = gr.HTML("<button><a href='https://calmconnect-flower.replit.app/'>PLAY FLOWER GAME</a></button>")
|
212 |
big_block3 = gr.HTML("<button><a href='https://www.nyc.gov/site/doh/health/health-topics/teenspace.page'>NYC: TEENSPACE (free services)</a></button>")
|
213 |
big_block4 =gr.HTML("<button><a href='https://www.teenlife.com/blog/mental-health-resources-for-teens/'>TEEN MENTAL HEALTH RESOURCES (free services)</a></button>")
|
214 |
-
|
215 |
-
with gr.Blocks(theme='gstaff/xkcd') as demo:
|
216 |
-
gr.Image("CalmConnect.jpg", show_label = False, show_share_button = False, show_download_button = False)
|
217 |
-
gr.Markdown(welcome_message) # Display the formatted welcome message
|
218 |
-
with gr.Row():
|
219 |
-
with gr.Column():
|
220 |
-
gr.Markdown(topics) # Show the topics on the left side
|
221 |
-
gr.HTML(display_iframe()) # Embed the iframe on the left side
|
222 |
-
gr.HTML(display_iframe2()) # Embed the iframe on the right side
|
223 |
-
with gr.Column():
|
224 |
-
gr.Markdown(topics2) # Show the topics on the left side
|
225 |
-
with gr.Row():
|
226 |
-
with gr.Column():
|
227 |
-
question = gr.Textbox(label="You", placeholder="What do you want to talk to CalmBot about?")
|
228 |
-
answer = gr.Textbox(label="CalmBot's Response :D", placeholder="CalmBot will respond here..", interactive=False, lines=20)
|
229 |
-
submit_button = gr.Button("Submit")
|
230 |
-
submit_button.click(fn=query_model, inputs=question, outputs=answer)
|
231 |
-
with gr.Row():
|
232 |
-
big_block = gr.HTML("### <button><a href='https://www.headspace.com/teens'>FREE: HEADSPACE FOR TEENS </a></button>")
|
233 |
-
big_block2 = gr.HTML("<button><a href='https://calmconnect-flower.replit.app/'>PLAY FLOWER GAME</a></button>")
|
234 |
-
big_block3 = gr.HTML("<button><a href='https://www.nyc.gov/site/doh/health/health-topics/teenspace.page'>NYC: TEENSPACE (free services)</a></button>")
|
235 |
-
big_block4 =gr.HTML("<button><a href='https://www.teenlife.com/blog/mental-health-resources-for-teens/'>TEEN MENTAL HEALTH RESOURCES (free services)</a></button>")
|
236 |
-
|
237 |
|
238 |
|
239 |
demo.launch()
|
|
|
172 |
def display_iframe2():
|
173 |
return iframe2
|
174 |
|
175 |
+
custom_css = """
|
176 |
+
<style>
|
177 |
+
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
|
178 |
+
|
179 |
+
body {
|
180 |
+
font-family: 'Roboto', sans-serif;
|
181 |
+
}
|
182 |
+
|
183 |
+
.gr-chat-message {
|
184 |
+
background-color: #ff5733 !important; /* Example background color */
|
185 |
+
color: #ffffff !important; /* Example text color */
|
186 |
+
}
|
187 |
+
|
188 |
+
button a {
|
189 |
+
text-decoration: none;
|
190 |
+
color: white;
|
191 |
+
}
|
192 |
+
</style>
|
193 |
+
"""
|
194 |
+
|
195 |
theme = gr.themes.Default(
|
196 |
primary_hue="neutral",
|
197 |
secondary_hue="neutral",
|
|
|
211 |
|
212 |
# Setup the Gradio Blocks interface with custom layout components
|
213 |
with gr.Blocks(theme=theme) as demo:
|
214 |
+
gr.HTML(custom_css)
|
215 |
gr.Image("CalmConnect.jpg", show_label = False, show_share_button = False, show_download_button = False)
|
216 |
gr.Markdown(welcome_message) # Display the formatted welcome message
|
217 |
with gr.Row():
|
|
|
232 |
big_block2 = gr.HTML("<button><a href='https://calmconnect-flower.replit.app/'>PLAY FLOWER GAME</a></button>")
|
233 |
big_block3 = gr.HTML("<button><a href='https://www.nyc.gov/site/doh/health/health-topics/teenspace.page'>NYC: TEENSPACE (free services)</a></button>")
|
234 |
big_block4 =gr.HTML("<button><a href='https://www.teenlife.com/blog/mental-health-resources-for-teens/'>TEEN MENTAL HEALTH RESOURCES (free services)</a></button>")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
|
236 |
|
237 |
demo.launch()
|