Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,14 @@
|
|
| 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")
|
|
@@ -14,106 +22,126 @@ def load_lottieurl(url: str):
|
|
| 14 |
# Load the Lottie animation
|
| 15 |
lottie_hello = load_lottieurl("https://lottie.host/d29edbdd-af94-402e-bb4c-b314f17897e6/n5SKHOkbYQ.json")
|
| 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 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
#
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
<
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
)
|
| 105 |
-
|
| 106 |
-
#
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import requests
|
| 3 |
from streamlit_lottie import st_lottie
|
| 4 |
+
from dotenv import load_dotenv
|
| 5 |
+
import os
|
| 6 |
+
|
| 7 |
+
# Load environment variables from .env file
|
| 8 |
+
load_dotenv()
|
| 9 |
+
|
| 10 |
+
# Retrieve the password from the environment variable
|
| 11 |
+
APP_PASSWORD = os.getenv("APP_PASSWORD")
|
| 12 |
|
| 13 |
# Set the page title and layout
|
| 14 |
st.set_page_config(page_title="Space Birthday Exploration", page_icon="🚀", layout="centered")
|
|
|
|
| 22 |
# Load the Lottie animation
|
| 23 |
lottie_hello = load_lottieurl("https://lottie.host/d29edbdd-af94-402e-bb4c-b314f17897e6/n5SKHOkbYQ.json")
|
| 24 |
|
| 25 |
+
# Function to display the login form
|
| 26 |
+
def login():
|
| 27 |
+
st.sidebar.header("Login")
|
| 28 |
+
password = st.sidebar.text_input("Password", type="password")
|
| 29 |
+
if st.sidebar.button("Submit"):
|
| 30 |
+
if password == APP_PASSWORD: # Compare entered password with the environment password
|
| 31 |
+
st.session_state["authenticated"] = True
|
| 32 |
+
else:
|
| 33 |
+
st.error("Incorrect password")
|
| 34 |
+
|
| 35 |
+
# Check authentication status
|
| 36 |
+
if "authenticated" not in st.session_state:
|
| 37 |
+
st.session_state["authenticated"] = False
|
| 38 |
+
|
| 39 |
+
if not st.session_state["authenticated"]:
|
| 40 |
+
login()
|
| 41 |
+
else:
|
| 42 |
+
# Custom styles with the background image and updated shadow effect
|
| 43 |
+
st.markdown(
|
| 44 |
+
"""
|
| 45 |
+
<style>
|
| 46 |
+
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');
|
| 47 |
+
|
| 48 |
+
body {
|
| 49 |
+
background-image: url('https://i.imghippo.com/files/nYbNv1725063923.png');
|
| 50 |
+
background-size: cover;
|
| 51 |
+
background-repeat: no-repeat;
|
| 52 |
+
background-attachment: fixed;
|
| 53 |
+
color: #FFFFFF;
|
| 54 |
+
margin: 0;
|
| 55 |
+
font-family: 'Orbitron', sans-serif;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.stApp {
|
| 59 |
+
background: transparent;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
.birthday-text {
|
| 63 |
+
font-size: 48px;
|
| 64 |
+
font-weight: bold;
|
| 65 |
+
color: #FFB6C1;
|
| 66 |
+
text-shadow: 0 0 10px #000000, 0 0 20px #000000, 0 0 30px #000000;
|
| 67 |
+
text-align: center;
|
| 68 |
+
margin-top: 20px;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
.custom-text {
|
| 72 |
+
font-size: 20px;
|
| 73 |
+
color: #FF00FF; /* Magenta color */
|
| 74 |
+
text-shadow: 0 0 10px #000000, 0 0 20px #000000, 0 0 30px #000000;
|
| 75 |
+
text-align: center;
|
| 76 |
+
margin-top: 10px;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
.video-container {
|
| 80 |
+
display: flex;
|
| 81 |
+
justify-content: center;
|
| 82 |
+
margin-top: 30px;
|
| 83 |
+
box-shadow: 0px 0px 20px rgba(0,0,0,0.5);
|
| 84 |
+
border-radius: 10px;
|
| 85 |
+
overflow: hidden;
|
| 86 |
+
background-color: rgba(0,0,0,0); /* Fully transparent background */
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
.space-text {
|
| 90 |
+
font-size: 24px;
|
| 91 |
+
font-weight: bold;
|
| 92 |
+
color: #00FFFF;
|
| 93 |
+
text-shadow: 0 0 10px #00FFFF, 0 0 20px #00FFFF, 0 0 30px #00FFFF;
|
| 94 |
+
text-align: center;
|
| 95 |
+
margin-top: 20px;
|
| 96 |
+
margin-bottom: 20px;
|
| 97 |
+
}
|
| 98 |
+
</style>
|
| 99 |
+
""",
|
| 100 |
+
unsafe_allow_html=True
|
| 101 |
+
)
|
| 102 |
+
|
| 103 |
+
# Add "Happy Birthday!" text at the top
|
| 104 |
+
st.markdown('<div class="birthday-text">Happy Birthday!</div>', unsafe_allow_html=True)
|
| 105 |
+
|
| 106 |
+
# Add custom text after the heading, with two paragraphs
|
| 107 |
+
custom_text = """
|
| 108 |
+
<p>Wishing you many wonderful years ahead, filled with love, happiness, and out-of-this-world adventures, space girl!</p>
|
| 109 |
+
<p>Now let me present to you the bday vid edit "20thChondiEdit"</p>
|
| 110 |
+
<p>I hope you like it!</p>
|
| 111 |
+
""" # You can change this text
|
| 112 |
+
st.markdown(f'<div class="custom-text">{custom_text}</div>', unsafe_allow_html=True)
|
| 113 |
+
|
| 114 |
+
# Embed the YouTube video with a transparent background
|
| 115 |
+
video_id = "SLBzL4f7r3k" # Your YouTube video ID
|
| 116 |
+
st.markdown(
|
| 117 |
+
f"""
|
| 118 |
+
<div class="video-container">
|
| 119 |
+
<iframe width="560" height="315" src="https://www.youtube.com/embed/{video_id}" frameborder="0" allowfullscreen></iframe>
|
| 120 |
+
</div>
|
| 121 |
+
""",
|
| 122 |
+
unsafe_allow_html=True
|
| 123 |
+
)
|
| 124 |
+
|
| 125 |
+
# Add the space-themed text after the video, with two paragraphs
|
| 126 |
+
space_text = """
|
| 127 |
+
<p>Hey dude that last 1 year was damn crazy but it was filled with many moments.</p>
|
| 128 |
+
<p>These are some of those moments that were captured.</p>
|
| 129 |
+
<p>In all these moments Ik I haven't always been the ideal best friend and I am truly sorry for those.</p>
|
| 130 |
+
<p>You have been a great friend all this time and am sorry for all those times I couldn't reciprocate that.</p>
|
| 131 |
+
<p>Seriously though thank you for being there for me and for taking all the messed up things that I do.</p>
|
| 132 |
+
<p>I haven't always been the bunny that you deserve but thank you for the aditi you have been.</p>
|
| 133 |
+
<p>So Happy Birthday! And I hope we stay like this for all your next bdays well just a lil bit more matured 🤓</p>
|
| 134 |
+
""" # You can change this text
|
| 135 |
+
st.markdown(f'<div class="space-text">{space_text}</div>', unsafe_allow_html=True)
|
| 136 |
+
|
| 137 |
+
# Add the Lottie animation directly without an extra container
|
| 138 |
+
st_lottie(
|
| 139 |
+
lottie_hello,
|
| 140 |
+
speed=1,
|
| 141 |
+
reverse=False,
|
| 142 |
+
loop=True,
|
| 143 |
+
quality="low",
|
| 144 |
+
height=150,
|
| 145 |
+
width=150,
|
| 146 |
+
key=None,
|
| 147 |
+
)
|