DS2 commited on
Commit
85bd90b
·
verified ·
1 Parent(s): 73c9821

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +58 -83
app.py CHANGED
@@ -1,10 +1,9 @@
1
  import streamlit as st
2
- import streamlit.components.v1 as stc
3
  import requests
4
  from streamlit_lottie import st_lottie
5
 
6
- # Set the page title and layout (this must be at the top)
7
- st.set_page_config(page_title="Space Birthday Exploration", page_icon="🚀", layout="wide")
8
 
9
  def load_lottieurl(url: str):
10
  r = requests.get(url)
@@ -15,130 +14,106 @@ def load_lottieurl(url: str):
15
  # Load the Lottie animation
16
  lottie_hello = load_lottieurl("https://lottie.host/d29edbdd-af94-402e-bb4c-b314f17897e6/n5SKHOkbYQ.json")
17
 
18
- # Add CSS styles to the page
19
  st.markdown(
20
  """
21
  <style>
22
  @import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');
23
-
24
  body {
25
- background-color: #000011;
26
- background-image:
27
- radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 40px),
28
- radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 30px),
29
- radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 40px),
30
- radial-gradient(rgba(255,255,255,.4), rgba(255,255,255,.1) 2px, transparent 30px);
31
- background-size: 550px 550px, 350px 350px, 250px 250px, 150px 150px;
32
- background-position: 0 0, 40px 60px, 130px 270px, 70px 100px;
33
- animation: backgroundScroll 60s linear infinite;
34
- }
35
-
36
- @keyframes backgroundScroll {
37
- 0% {background-position: 0 0, 40px 60px, 130px 270px, 70px 100px;}
38
- 100% {background-position: 550px 550px, 590px 610px, 680px 820px, 620px 650px;}
39
  }
40
 
41
  .stApp {
42
  background: transparent;
43
  }
44
 
45
- .content-container {
46
- display: flex;
47
- flex-direction: column;
48
- align-items: center;
49
- justify-content: flex-start;
50
- min-height: 100vh;
51
- padding: 20px;
52
- }
53
-
54
  .birthday-text {
55
  font-size: 48px;
56
  font-weight: bold;
57
  color: #FFB6C1;
58
- font-family: 'Orbitron', sans-serif;
59
- text-shadow: 0 0 10px #FFB6C1, 0 0 20px #FFB6C1, 0 0 30px #FFB6C1;
60
- animation: birthday-glow 2s ease-in-out infinite alternate;
61
  margin-top: 20px;
62
- margin-bottom: 30px;
63
  }
64
 
65
- @keyframes birthday-glow {
66
- from {
67
- text-shadow: 0 0 10px #FFB6C1, 0 0 20px #FFB6C1, 0 0 30px #FFB6C1;
68
- }
69
- to {
70
- text-shadow: 0 0 20px #FFB6C1, 0 0 30px #FFB6C1, 0 0 40px #FFB6C1, 0 0 50px #FFB6C1;
71
- }
72
  }
73
 
74
  .video-container {
75
- width: 80%;
76
- height: 450px;
77
- border-radius: 20px;
78
- box-shadow: 0px 0px 20px rgba(255,255,255,0.3);
 
79
  overflow: hidden;
80
- margin-bottom: 30px;
81
  }
82
 
83
  .lottie-container {
84
- width: 200px;
85
- height: 200px;
86
- margin-bottom: 30px;
 
 
 
 
 
 
87
  }
88
 
89
  .space-text {
90
  font-size: 24px;
91
  font-weight: bold;
92
- color: #fff;
93
- font-family: 'Orbitron', sans-serif;
94
- text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff, 0 0 30px #00ffff;
95
- animation: glow 2s ease-in-out infinite alternate;
96
- }
97
-
98
- @keyframes glow {
99
- from {
100
- text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff, 0 0 30px #00ffff;
101
- }
102
- to {
103
- text-shadow: 0 0 20px #00ffff, 0 0 30px #00ffff, 0 0 40px #00ffff, 0 0 50px #00ffff;
104
- }
105
  }
106
  </style>
107
  """,
108
  unsafe_allow_html=True
109
  )
110
 
111
- # Create a container for all content
112
- st.markdown('<div class="content-container">', unsafe_allow_html=True)
113
-
114
- # Add birthday text at the top
115
  st.markdown('<div class="birthday-text">Happy Birthday!</div>', unsafe_allow_html=True)
116
 
117
- # Create a YouTube video embed
 
 
 
 
118
  video_id = "your_youtube_video_id_here" # Replace with your YouTube video ID
119
- video_embed = f"""
120
- <div class="video-container">
121
- <iframe width="100%" height="100%" src="https://www.youtube.com/embed/{video_id}" frameborder="0" allowfullscreen>
122
- </iframe>
123
- </div>
124
- """
125
-
126
- # Add the video embed
127
- st.markdown(video_embed, unsafe_allow_html=True)
128
-
129
- # Add the Lottie animation
130
- st.markdown('<div class="lottie-container">', unsafe_allow_html=True)
 
131
  st_lottie(
132
  lottie_hello,
133
  speed=1,
134
  reverse=False,
135
  loop=True,
136
  quality="low",
 
 
137
  key=None,
138
  )
139
- st.markdown('</div>', unsafe_allow_html=True)
140
-
141
- # Add space-themed text
142
- st.markdown('<div class="space-text">Explore the Wonders of Space!</div>', unsafe_allow_html=True)
143
-
144
- st.markdown('</div>', unsafe_allow_html=True)
 
1
  import streamlit as st
 
2
  import requests
3
  from streamlit_lottie import st_lottie
4
 
5
+ # Set the page title and layout
6
+ st.set_page_config(page_title="Space Birthday Exploration", page_icon="🚀", layout="centered")
7
 
8
  def load_lottieurl(url: str):
9
  r = requests.get(url)
 
14
  # Load the Lottie animation
15
  lottie_hello = load_lottieurl("https://lottie.host/d29edbdd-af94-402e-bb4c-b314f17897e6/n5SKHOkbYQ.json")
16
 
17
+ # Custom styles with the background image and updated shadow effect
18
  st.markdown(
19
  """
20
  <style>
21
  @import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');
22
+
23
  body {
24
+ background-image: url('https://i.imghippo.com/files/nYbNv1725063923.png');
25
+ background-size: cover;
26
+ background-repeat: no-repeat;
27
+ background-attachment: fixed;
28
+ color: #FFFFFF;
29
+ margin: 0;
30
+ font-family: 'Orbitron', sans-serif;
 
 
 
 
 
 
 
31
  }
32
 
33
  .stApp {
34
  background: transparent;
35
  }
36
 
 
 
 
 
 
 
 
 
 
37
  .birthday-text {
38
  font-size: 48px;
39
  font-weight: bold;
40
  color: #FFB6C1;
41
+ text-shadow: 0 0 10px #000000, 0 0 20px #000000, 0 0 30px #000000;
42
+ text-align: center;
 
43
  margin-top: 20px;
 
44
  }
45
 
46
+ .custom-text {
47
+ font-size: 20px;
48
+ text-align: center;
49
+ margin-top: 10px;
 
 
 
50
  }
51
 
52
  .video-container {
53
+ display: flex;
54
+ justify-content: center;
55
+ margin-top: 30px;
56
+ box-shadow: 0px 0px 20px rgba(0,0,0,0.5);
57
+ border-radius: 10px;
58
  overflow: hidden;
59
+ background-color: rgba(0,0,0,0); /* Fully transparent background */
60
  }
61
 
62
  .lottie-container {
63
+ display: flex;
64
+ justify-content: center;
65
+ margin-top: 20px;
66
+ margin-bottom: 20px;
67
+ box-shadow: 0px 0px 20px rgba(0,0,0,0.5);
68
+ border-radius: 10px;
69
+ background-color: rgba(0,0,0,0); /* Fully transparent background */
70
+ width: 150px;
71
+ height: 150px;
72
  }
73
 
74
  .space-text {
75
  font-size: 24px;
76
  font-weight: bold;
77
+ color: #00FFFF;
78
+ text-shadow: 0 0 10px #00FFFF, 0 0 20px #00FFFF, 0 0 30px #00FFFF;
79
+ text-align: center;
80
+ margin-top: 20px;
81
+ margin-bottom: 20px;
 
 
 
 
 
 
 
 
82
  }
83
  </style>
84
  """,
85
  unsafe_allow_html=True
86
  )
87
 
88
+ # Add "Happy Birthday!" text at the top
 
 
 
89
  st.markdown('<div class="birthday-text">Happy Birthday!</div>', unsafe_allow_html=True)
90
 
91
+ # Add custom text after the heading
92
+ custom_text = "Wishing you a day filled with love and happiness!" # You can change this text
93
+ st.markdown(f'<div class="custom-text">{custom_text}</div>', unsafe_allow_html=True)
94
+
95
+ # Embed the YouTube video with a transparent background
96
  video_id = "your_youtube_video_id_here" # Replace with your YouTube video ID
97
+ st.markdown(
98
+ f"""
99
+ <div class="video-container">
100
+ <iframe width="560" height="315" src="https://www.youtube.com/embed/{video_id}" frameborder="0" allowfullscreen></iframe>
101
+ </div>
102
+ """,
103
+ unsafe_allow_html=True
104
+ )
105
+
106
+ # Add the space-themed text after the video
107
+ st.markdown('<div class="space-text">Explore the Wonders of Space!</div>', unsafe_allow_html=True)
108
+
109
+ # Add the Lottie animation directly without extra container
110
  st_lottie(
111
  lottie_hello,
112
  speed=1,
113
  reverse=False,
114
  loop=True,
115
  quality="low",
116
+ height=150,
117
+ width=150,
118
  key=None,
119
  )