Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,11 +59,18 @@ def show_loading_animation():
|
|
| 59 |
if lottie_json:
|
| 60 |
st_lottie(lottie_json, height=300, key="loading")
|
| 61 |
|
|
|
|
|
|
|
| 62 |
def login_page():
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
if "login_success" not in st.session_state:
|
| 65 |
st.session_state["login_success"] = False
|
| 66 |
|
|
|
|
| 67 |
if not st.session_state["login_success"]:
|
| 68 |
username = st.text_input("Username")
|
| 69 |
password = st.text_input("Password", type="password")
|
|
@@ -77,6 +84,8 @@ def login_page():
|
|
| 77 |
else:
|
| 78 |
st.error("Invalid username or password.")
|
| 79 |
|
|
|
|
|
|
|
| 80 |
def add_return_to_login():
|
| 81 |
if "logged_in" in st.session_state and st.session_state["logged_in"]:
|
| 82 |
if st.sidebar.button("Back"):
|
|
@@ -261,11 +270,47 @@ def customize_navigation_menu_dark_green():
|
|
| 261 |
)
|
| 262 |
|
| 263 |
|
| 264 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
if __name__ == "__main__":
|
| 269 |
customize_navigation_menu_dark_green()
|
|
|
|
| 270 |
main()
|
| 271 |
|
|
|
|
| 59 |
if lottie_json:
|
| 60 |
st_lottie(lottie_json, height=300, key="loading")
|
| 61 |
|
| 62 |
+
|
| 63 |
+
|
| 64 |
def login_page():
|
| 65 |
+
# Add custom styling and an image at the top
|
| 66 |
+
customize_login_page_with_image("logo.png") # Replace "image.png" with the actual path to your image
|
| 67 |
+
st.title("Login Page") # The title will be styled in dark green
|
| 68 |
+
|
| 69 |
+
# Check login state
|
| 70 |
if "login_success" not in st.session_state:
|
| 71 |
st.session_state["login_success"] = False
|
| 72 |
|
| 73 |
+
# Login logic
|
| 74 |
if not st.session_state["login_success"]:
|
| 75 |
username = st.text_input("Username")
|
| 76 |
password = st.text_input("Password", type="password")
|
|
|
|
| 84 |
else:
|
| 85 |
st.error("Invalid username or password.")
|
| 86 |
|
| 87 |
+
|
| 88 |
+
|
| 89 |
def add_return_to_login():
|
| 90 |
if "logged_in" in st.session_state and st.session_state["logged_in"]:
|
| 91 |
if st.sidebar.button("Back"):
|
|
|
|
| 270 |
)
|
| 271 |
|
| 272 |
|
| 273 |
+
def customize_login_page_with_image(image_path):
|
| 274 |
+
st.markdown(
|
| 275 |
+
"""
|
| 276 |
+
<style>
|
| 277 |
+
h1 {
|
| 278 |
+
color: #084C3C !important; /* Dark green for Login Page title */
|
| 279 |
+
text-align: center; /* Center align the title */
|
| 280 |
+
}
|
| 281 |
+
</style>
|
| 282 |
+
""",
|
| 283 |
+
unsafe_allow_html=True
|
| 284 |
+
)
|
| 285 |
+
# Add the image
|
| 286 |
+
st.image(image_path, width=200, use_column_width=False)
|
| 287 |
+
|
| 288 |
+
|
| 289 |
+
|
| 290 |
+
def customize_submit_button():
|
| 291 |
+
st.markdown(
|
| 292 |
+
"""
|
| 293 |
+
<style>
|
| 294 |
+
div[data-testid="stFormSubmitButton"] button {
|
| 295 |
+
background-color: #084C3C !important; /* Dark green background */
|
| 296 |
+
color: white !important; /* White text */
|
| 297 |
+
border-radius: 10px !important; /* Rounded corners */
|
| 298 |
+
padding: 10px 20px !important; /* Padding for the button */
|
| 299 |
+
border: none !important;
|
| 300 |
+
}
|
| 301 |
+
div[data-testid="stFormSubmitButton"] button:hover {
|
| 302 |
+
background-color: #056C4C !important; /* Slightly lighter green on hover */
|
| 303 |
+
color: white !important; /* Keep text white on hover */
|
| 304 |
+
}
|
| 305 |
+
</style>
|
| 306 |
+
""",
|
| 307 |
+
unsafe_allow_html=True
|
| 308 |
+
)
|
| 309 |
|
| 310 |
|
| 311 |
|
| 312 |
if __name__ == "__main__":
|
| 313 |
customize_navigation_menu_dark_green()
|
| 314 |
+
customize_submit_button()
|
| 315 |
main()
|
| 316 |
|