Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,59 +1,17 @@
|
|
| 1 |
-
import
|
| 2 |
|
| 3 |
# Function to greet the user
|
| 4 |
def greet(name):
|
| 5 |
-
return f"
|
| 6 |
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
|
| 9 |
-
.
|
| 10 |
-
background-color: #c48fc4; /* Pink background */
|
| 11 |
-
font-family: "Gradio"; /* Fun font */
|
| 12 |
-
text-align: center;
|
| 13 |
-
}
|
| 14 |
-
|
| 15 |
-
.gradio-button {
|
| 16 |
-
background-color: #FF66B2; /* Pink button */
|
| 17 |
-
color: white;
|
| 18 |
-
font-size: 18px;
|
| 19 |
-
padding: 15px;
|
| 20 |
-
border-radius: 10px;
|
| 21 |
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
| 22 |
-
}
|
| 23 |
-
.gradio-button:hover {
|
| 24 |
-
background-color: #FF3385; /* Lighter pink on hover */
|
| 25 |
-
}
|
| 26 |
-
.gradio-input textarea {
|
| 27 |
-
background-color: #FFCCE5; /* Light pink input box */
|
| 28 |
-
border-radius: 10px;
|
| 29 |
-
border: 2px solid #FF66B2;
|
| 30 |
-
padding: 10px;
|
| 31 |
-
font-size: 16px;
|
| 32 |
-
}
|
| 33 |
-
.gradio-input textarea:focus {
|
| 34 |
-
border-color: #FF3385; /* Focus effect for the input box */
|
| 35 |
-
}
|
| 36 |
-
.gradio-output {
|
| 37 |
-
background-color: #FFF0F6; /* Soft pink background for output */
|
| 38 |
-
border-radius: 10px;
|
| 39 |
-
padding: 15px;
|
| 40 |
-
font-size: 18px;
|
| 41 |
-
color: #FF66B2; /* Pink text for the response */
|
| 42 |
-
}
|
| 43 |
-
.gradio-interface {
|
| 44 |
-
padding-top: 30px;
|
| 45 |
-
}
|
| 46 |
-
"""
|
| 47 |
-
|
| 48 |
-
# Creating a Gradio interface
|
| 49 |
-
demo = gr.Interface(
|
| 50 |
-
fn=greet, inputs="text",
|
| 51 |
-
outputs="text",
|
| 52 |
-
title="Cute Greeting App",
|
| 53 |
-
description="This app greets the user with a fun message!",
|
| 54 |
-
css=css
|
| 55 |
-
)
|
| 56 |
-
|
| 57 |
-
# Launch the app
|
| 58 |
-
demo.launch()
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
|
| 3 |
# Function to greet the user
|
| 4 |
def greet(name):
|
| 5 |
+
return f"Hi, {name}! Welcome to the cute greeting app! 🌸"
|
| 6 |
|
| 7 |
+
# Streamlit interface
|
| 8 |
+
st.title("Cute Greeting App")
|
| 9 |
+
st.write("Enter your name below to get a cute greeting!")
|
| 10 |
|
| 11 |
+
# Input field for the user's name
|
| 12 |
+
name = st.text_input("What's your name?")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
# Display the greeting if a name is entered
|
| 15 |
+
if name:
|
| 16 |
+
greeting = greet(name)
|
| 17 |
+
st.write(greeting)
|