Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| def main(): | |
| # Set page configuration | |
| st.set_page_config( | |
| page_title="Flashlight App", | |
| page_icon="π¦", | |
| layout="centered", | |
| initial_sidebar_state="collapsed" | |
| ) | |
| # Add some styling to simulate a flashlight effect | |
| st.markdown( | |
| """ | |
| <style> | |
| .light-mode { | |
| background-color: white; | |
| color: black; | |
| height: 100vh; | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| } | |
| .dark-mode { | |
| background-color: black; | |
| color: white; | |
| height: 100vh; | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| } | |
| </style> | |
| """, | |
| unsafe_allow_html=True | |
| ) | |
| # Sidebar toggle | |
| mode = st.sidebar.radio("Toggle Mode", ["Light", "Dark"]) | |
| if mode == "Light": | |
| st.markdown('<div class="light-mode"><h1>π¦ Flashlight is ON</h1></div>', unsafe_allow_html=True) | |
| else: | |
| st.markdown('<div class="dark-mode"><h1>π Flashlight is OFF</h1></div>', unsafe_allow_html=True) | |
| if __name__ == "__main__": | |
| main() | |