Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,8 +16,11 @@ st.set_page_config(page_title="Moodboard AI", layout="wide")
|
|
| 16 |
# -- Dark Mode Toggle --
|
| 17 |
if 'dark_mode' not in st.session_state:
|
| 18 |
st.session_state.dark_mode = False
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
# -- Apply Dark Mode Styling --
|
| 23 |
if st.session_state.dark_mode:
|
|
@@ -30,10 +33,23 @@ if st.session_state.dark_mode:
|
|
| 30 |
h1, h2, h3, h4, h5, h6 {
|
| 31 |
color: #ffffff !important;
|
| 32 |
}
|
| 33 |
-
.stTextInput > div > div > input
|
|
|
|
| 34 |
background-color: #222222;
|
| 35 |
color: #ffffff;
|
| 36 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
</style>
|
| 38 |
""", unsafe_allow_html=True)
|
| 39 |
|
|
@@ -139,7 +155,7 @@ if st.session_state.get("generate"):
|
|
| 139 |
fonts = fetch_google_fonts()
|
| 140 |
for font in fonts:
|
| 141 |
st.markdown(
|
| 142 |
-
f"<p style='font-family:{font};font-size:24px;color
|
| 143 |
unsafe_allow_html=True
|
| 144 |
)
|
| 145 |
|
|
|
|
| 16 |
# -- Dark Mode Toggle --
|
| 17 |
if 'dark_mode' not in st.session_state:
|
| 18 |
st.session_state.dark_mode = False
|
| 19 |
+
|
| 20 |
+
dark_mode_toggle = st.toggle("🌙 Toggle Dark Mode", value=st.session_state.dark_mode)
|
| 21 |
+
if dark_mode_toggle != st.session_state.dark_mode:
|
| 22 |
+
st.session_state.dark_mode = dark_mode_toggle
|
| 23 |
+
st.rerun()
|
| 24 |
|
| 25 |
# -- Apply Dark Mode Styling --
|
| 26 |
if st.session_state.dark_mode:
|
|
|
|
| 33 |
h1, h2, h3, h4, h5, h6 {
|
| 34 |
color: #ffffff !important;
|
| 35 |
}
|
| 36 |
+
.stTextInput > div > div > input,
|
| 37 |
+
.stTextArea > div > textarea {
|
| 38 |
background-color: #222222;
|
| 39 |
color: #ffffff;
|
| 40 |
}
|
| 41 |
+
.stButton>button {
|
| 42 |
+
background-color: #333333;
|
| 43 |
+
color: #ffffff;
|
| 44 |
+
}
|
| 45 |
+
</style>
|
| 46 |
+
""", unsafe_allow_html=True)
|
| 47 |
+
else:
|
| 48 |
+
st.markdown("""
|
| 49 |
+
<style>
|
| 50 |
+
h1, h2, h3, h4, h5, h6 {
|
| 51 |
+
color: #000000 !important;
|
| 52 |
+
}
|
| 53 |
</style>
|
| 54 |
""", unsafe_allow_html=True)
|
| 55 |
|
|
|
|
| 155 |
fonts = fetch_google_fonts()
|
| 156 |
for font in fonts:
|
| 157 |
st.markdown(
|
| 158 |
+
f"<p style='font-family:{font};font-size:24px;color:{'#ffffff' if st.session_state.dark_mode else '#000000'}'>{font}</p>",
|
| 159 |
unsafe_allow_html=True
|
| 160 |
)
|
| 161 |
|