Spaces:
Runtime error
Runtime error
File size: 1,560 Bytes
10e4cb6 34a4f65 a4cce9a 34a4f65 9903fee 72d0e7a 34a4f65 72d0e7a 9903fee 34a4f65 9903fee be8b77d 9903fee 61d9513 72d0e7a 9903fee 72d0e7a 1af4b74 61d9513 72d0e7a 10e4cb6 72d0e7a 10e4cb6 72d0e7a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
import streamlit as st
# Replace with the direct image URL
flower_image_url = "https://i.postimg.cc/hG2FG85D/2.png"
# Inject custom CSS for the background with a centered and blurred image
st.markdown(
f"""
<style>
/* Container for background */
html, body {{
margin: 0;
padding: 0;
overflow: hidden;
}}
[data-testid="stAppViewContainer"] {{
position: relative;
z-index: 1; /* Ensure UI elements are above the background */
}}
/* Blurred background image */
.blurred-background {{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1; /* Send background image behind all UI elements */
background-image: url("{flower_image_url}");
background-size: cover;
background-position: center;
filter: blur(10px); /* Adjust blur ratio here */
opacity: 0.8; /* Optional: Add slight transparency for a subtle effect */
}}
</style>
""",
unsafe_allow_html=True
)
# Add the blurred background div
st.markdown('<div class="blurred-background"></div>', unsafe_allow_html=True)
# Streamlit UI elements
st.title("Word Cloud Application")
st.markdown("Welcome to the Word Cloud Application with a blurred, centered flower background!")
# Add some interactivity
if st.button("Click Me"):
st.write("You clicked the button!")
# Add a select box
option = st.selectbox(
"Choose an option:",
["Option 1", "Option 2", "Option 3"]
)
st.write(f"You selected: {option}")
|