Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,36 +3,46 @@ import streamlit as st
|
|
3 |
# Replace with the direct image URL
|
4 |
flower_image_url = "https://i.postimg.cc/hG2FG85D/2.png"
|
5 |
|
6 |
-
# Inject custom CSS for the background with
|
7 |
st.markdown(
|
8 |
f"""
|
9 |
<style>
|
10 |
-
/*
|
11 |
-
html, body
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
18 |
}}
|
19 |
-
/*
|
20 |
-
.
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}}
|
24 |
</style>
|
25 |
""",
|
26 |
unsafe_allow_html=True
|
27 |
)
|
28 |
|
|
|
|
|
|
|
29 |
# Streamlit UI elements
|
30 |
st.title("Word Cloud Application")
|
31 |
st.markdown("Welcome to the Word Cloud Application with a blurred, centered flower background!")
|
32 |
|
33 |
-
# Add interactivity for blur ratio adjustment
|
34 |
-
st.markdown('<div class="blur-adjust">Adjust the blur ratio manually in the code using the <code>filter: blur()</code> property.</div>', unsafe_allow_html=True)
|
35 |
-
|
36 |
# Add some interactivity
|
37 |
if st.button("Click Me"):
|
38 |
st.write("You clicked the button!")
|
|
|
3 |
# Replace with the direct image URL
|
4 |
flower_image_url = "https://i.postimg.cc/hG2FG85D/2.png"
|
5 |
|
6 |
+
# Inject custom CSS for the background with a centered and blurred image
|
7 |
st.markdown(
|
8 |
f"""
|
9 |
<style>
|
10 |
+
/* Container for background */
|
11 |
+
html, body {{
|
12 |
+
margin: 0;
|
13 |
+
padding: 0;
|
14 |
+
overflow: hidden;
|
15 |
+
}}
|
16 |
+
[data-testid="stAppViewContainer"] {{
|
17 |
+
position: relative;
|
18 |
+
z-index: 1; /* Ensure UI elements are above the background */
|
19 |
}}
|
20 |
+
/* Blurred background image */
|
21 |
+
.blurred-background {{
|
22 |
+
position: fixed;
|
23 |
+
top: 0;
|
24 |
+
left: 0;
|
25 |
+
width: 100%;
|
26 |
+
height: 100%;
|
27 |
+
z-index: -1; /* Send background image behind all UI elements */
|
28 |
+
background-image: url("{flower_image_url}");
|
29 |
+
background-size: cover;
|
30 |
+
background-position: center;
|
31 |
+
filter: blur(10px); /* Adjust blur ratio here */
|
32 |
+
opacity: 0.8; /* Optional: Add slight transparency for a subtle effect */
|
33 |
}}
|
34 |
</style>
|
35 |
""",
|
36 |
unsafe_allow_html=True
|
37 |
)
|
38 |
|
39 |
+
# Add the blurred background div
|
40 |
+
st.markdown('<div class="blurred-background"></div>', unsafe_allow_html=True)
|
41 |
+
|
42 |
# Streamlit UI elements
|
43 |
st.title("Word Cloud Application")
|
44 |
st.markdown("Welcome to the Word Cloud Application with a blurred, centered flower background!")
|
45 |
|
|
|
|
|
|
|
46 |
# Add some interactivity
|
47 |
if st.button("Click Me"):
|
48 |
st.write("You clicked the button!")
|