tahirsher commited on
Commit
34a4f65
1 Parent(s): 374674e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -31
app.py CHANGED
@@ -1,47 +1,28 @@
1
  import streamlit as st
2
 
3
- # Inject custom CSS for background with a centered flower
 
 
 
4
  st.markdown(
5
- """
6
  <style>
7
- /* General background with gradient */
8
- html, body, [data-testid="stAppViewContainer"] {
9
- background-image: linear-gradient(
10
- to bottom right,
11
- rgba(135, 206, 250, 0.7), /* Light Sky Blue */
12
- rgba(255, 223, 186, 0.7), /* Soft Peach */
13
- rgba(192, 192, 192, 0.7), /* Bright Silver */
14
- rgba(169, 169, 169, 0.7), /* Gray */
15
- rgba(240, 248, 255, 0.7), /* Alice Blue */
16
- rgba(173, 216, 230, 0.7) /* Light Blue */
17
- );
18
  background-size: cover;
19
- font-family: 'Arial', sans-serif;
20
- }
21
-
22
- /* Centered flower */
23
- .flower {
24
- position: absolute;
25
- top: 50%;
26
- left: 50%;
27
- transform: translate(-50%, -50%);
28
- width: 200px;
29
- height: 200px;
30
- background-image: url("https://upload.wikimedia.org/wikipedia/commons/thumb/3/30/Red_flower.svg/1200px-Red_flower.svg.png");
31
- background-size: contain;
32
  background-repeat: no-repeat;
33
- }
 
34
  </style>
35
  """,
36
  unsafe_allow_html=True
37
  )
38
 
39
- # Add flower in the center
40
- st.markdown('<div class="flower"></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 centered flower and gradient background!")
45
 
46
  # Add some interactivity
47
  if st.button("Click Me"):
 
1
  import streamlit as st
2
 
3
+ # Replace with the direct image URL
4
+ flower_image_url = "https://i.postimg.cc/yxjM5mC3/1.png"
5
+
6
+ # Inject custom CSS for the background with the provided flower image
7
  st.markdown(
8
+ f"""
9
  <style>
10
+ /* General background with flower image */
11
+ html, body, [data-testid="stAppViewContainer"] {{
12
+ background-image: url("{flower_image_url}");
 
 
 
 
 
 
 
 
13
  background-size: cover;
14
+ background-position: center;
 
 
 
 
 
 
 
 
 
 
 
 
15
  background-repeat: no-repeat;
16
+ font-family: 'Arial', sans-serif;
17
+ }}
18
  </style>
19
  """,
20
  unsafe_allow_html=True
21
  )
22
 
 
 
 
23
  # Streamlit UI elements
24
  st.title("Word Cloud Application")
25
+ st.markdown("Welcome to the Word Cloud Application with a beautiful flower background!")
26
 
27
  # Add some interactivity
28
  if st.button("Click Me"):