tahirsher commited on
Commit
5e0383e
·
verified ·
1 Parent(s): aa6aa67

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +49 -68
app.py CHANGED
@@ -1,84 +1,65 @@
1
  import streamlit as st
2
 
3
- # Inject custom CSS for background with your image, gradient, and floral overlay
4
  st.markdown(
5
- f"""
6
  <style>
7
- /* General background with gradient, your image, and floral pattern */
8
- html, body, [data-testid="stAppViewContainer"] {{
9
- background-image:
10
- linear-gradient(
11
- to bottom right,
12
- rgba(135, 206, 250, 0.5), /* Light Sky Blue */
13
- rgba(255, 223, 186, 0.5), /* Soft Peach */
14
- rgba(192, 192, 192, 0.5), /* Bright Silver */
15
- rgba(169, 169, 169, 0.5), /* Gray */
16
- rgba(240, 248, 255, 0.5), /* Alice Blue */
17
- rgba(173, 216, 230, 0.5) /* Light Blue */
18
- ),
19
- url("https://huggingface.co/spaces/tahirsher/wellbeing_GenAI/blob/main/1.png"),
20
- url("https://www.transparenttextures.com/patterns/flower.png"); /* Floral pattern */
21
- background-size: cover, contain, 100px 100px; /* Adjust image sizes */
22
- background-blend-mode: overlay, normal;
23
- background-position: center, center, center;
24
  font-family: 'Arial', sans-serif;
25
- }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  /* Header slide-right animation */
27
- @keyframes slide-right {{
28
- 0% {{
29
- transform: translateX(-100%); /* Start off-screen to the left */
30
- }}
31
- 100% {{
32
- transform: translateX(0); /* End at the normal position */
33
- }}
34
- }}
35
- /* Header slide-left animation */
36
- @keyframes slide-left {{
37
- 0% {{
38
- transform: translateX(100%); /* Start off-screen to the right */
39
- }}
40
- 100% {{
41
- transform: translateX(0); /* End at the normal position */
42
- }}
43
- }}
44
- /* Header slide-right animation for the title */
45
- .header-slide-right {{
46
  display: inline-block;
47
  animation: slide-right 2s ease-out;
48
- }}
49
- /* Subtitle slide-left animation */
50
- .header_description {{
51
- display: inline-block;
52
- animation: slide-left 2s ease-out;
53
- }}
54
- /* Button styles */
55
- .stButton button {{
56
- background-color: #333333;
57
- color: white;
58
- border: 2px solid black;
59
- padding: 10px 20px;
60
- font-size: 16px;
61
- cursor: pointer;
62
- }}
63
- .stButton button:hover {{
64
- background-color: #555555;
65
- }}
66
- .stSelectbox select {{
67
- background-color: #333333;
68
- color: white;
69
- border: 2px solid black;
70
- padding: 10px 20px;
71
- font-size: 16px;
72
- cursor: pointer;
73
- }}
74
- .stSelectbox select:hover {{
75
- background-color: #555555;
76
- }}
77
  </style>
78
  """,
79
  unsafe_allow_html=True
80
  )
81
 
 
 
 
82
  # Streamlit UI elements
83
  st.title("Word Cloud Application", anchor=None)
84
  st.markdown(
 
1
  import streamlit as st
2
 
3
+ # Inject custom CSS for a centered flower with your background and gradient
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.5), /* Light Sky Blue */
12
+ rgba(255, 223, 186, 0.5), /* Soft Peach */
13
+ rgba(192, 192, 192, 0.5), /* Bright Silver */
14
+ rgba(169, 169, 169, 0.5), /* Gray */
15
+ rgba(240, 248, 255, 0.5), /* Alice Blue */
16
+ rgba(173, 216, 230, 0.5) /* Light Blue */
17
+ );
18
+ background-size: cover;
 
 
 
 
 
19
  font-family: 'Arial', sans-serif;
20
+ position: relative;
21
+ }
22
+ /* Flower in the center */
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
+ /* Animating the flower */
35
+ @keyframes rotate-flower {
36
+ 0% { transform: translate(-50%, -50%) rotate(0deg); }
37
+ 100% { transform: translate(-50%, -50%) rotate(360deg); }
38
+ }
39
+ .flower:hover {
40
+ animation: rotate-flower 4s linear infinite;
41
+ }
42
  /* Header slide-right animation */
43
+ @keyframes slide-right {
44
+ 0% {
45
+ transform: translateX(-100%);
46
+ }
47
+ 100% {
48
+ transform: translateX(0);
49
+ }
50
+ }
51
+ .header-slide-right {
 
 
 
 
 
 
 
 
 
 
52
  display: inline-block;
53
  animation: slide-right 2s ease-out;
54
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  </style>
56
  """,
57
  unsafe_allow_html=True
58
  )
59
 
60
+ # Add flower in the center
61
+ st.markdown('<div class="flower"></div>', unsafe_allow_html=True)
62
+
63
  # Streamlit UI elements
64
  st.title("Word Cloud Application", anchor=None)
65
  st.markdown(