Update app.py
Browse files
app.py
CHANGED
|
@@ -1,82 +1,114 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import requests
|
| 3 |
|
| 4 |
-
# Define the CSS style for the UI
|
| 5 |
st.markdown("""
|
| 6 |
<style>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
.main {
|
| 8 |
-
background-color:
|
| 9 |
}
|
| 10 |
.stButton>button {
|
| 11 |
background-color: #ff4d94;
|
| 12 |
color: white;
|
|
|
|
| 13 |
}
|
| 14 |
.stSelectbox>div>div {
|
| 15 |
background-color: #ff99c2;
|
| 16 |
color: white;
|
| 17 |
}
|
| 18 |
-
.stSubheader, .stText, .stHeader {
|
| 19 |
color: #b30047;
|
| 20 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
</style>
|
| 22 |
""", unsafe_allow_html=True)
|
| 23 |
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
-
st.header("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
-
|
| 29 |
-
ausgewählte_phase = st.selectbox("Wähle deine aktuelle Phase", phasen)
|
| 30 |
|
| 31 |
-
# Stress
|
| 32 |
stress_management_tipps = {
|
| 33 |
-
"Menstruation (Winter)
|
| 34 |
-
"
|
| 35 |
-
"
|
| 36 |
-
"
|
| 37 |
}
|
| 38 |
|
| 39 |
-
# Energy management tips
|
| 40 |
energie_management_tipps = {
|
| 41 |
-
"Menstruation (Winter)
|
| 42 |
-
"
|
| 43 |
-
"
|
| 44 |
-
"
|
| 45 |
}
|
| 46 |
|
| 47 |
# Detailed information about the phases
|
| 48 |
phaseninformationen = {
|
| 49 |
-
"Menstruation (Winter)
|
| 50 |
-
"beschreibung": "
|
| 51 |
-
"körperliche_veränderungen": "
|
| 52 |
-
"emotionale_veränderungen": "
|
| 53 |
},
|
| 54 |
-
"
|
| 55 |
-
"beschreibung": "
|
| 56 |
-
"körperliche_veränderungen": "
|
| 57 |
-
"emotionale_veränderungen": "
|
| 58 |
},
|
| 59 |
-
"
|
| 60 |
-
"beschreibung": "
|
| 61 |
-
"körperliche_veränderungen": "
|
| 62 |
-
"emotionale_veränderungen": "
|
| 63 |
},
|
| 64 |
-
"
|
| 65 |
-
"beschreibung": "
|
| 66 |
-
"körperliche_veränderungen": "
|
| 67 |
-
"emotionale_veränderungen": "
|
| 68 |
}
|
| 69 |
}
|
| 70 |
|
| 71 |
selected_phase_info = phaseninformationen[ausgewählte_phase]
|
| 72 |
|
| 73 |
# Display selected phase information
|
| 74 |
-
st.subheader(f"
|
| 75 |
-
st.write("**
|
| 76 |
-
st.write("**
|
| 77 |
-
st.write("**
|
| 78 |
|
| 79 |
# Display stress and energy management tips
|
| 80 |
-
st.subheader(f"
|
| 81 |
-
st.write("**Stress
|
| 82 |
-
st.write("**
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import requests
|
| 3 |
|
| 4 |
+
# Define the CSS style for the UI with a mobile-friendly design
|
| 5 |
st.markdown("""
|
| 6 |
<style>
|
| 7 |
+
body {
|
| 8 |
+
font-family: 'Satoshi', sans-serif;
|
| 9 |
+
background-color: white;
|
| 10 |
+
}
|
| 11 |
.main {
|
| 12 |
+
background-color: white;
|
| 13 |
}
|
| 14 |
.stButton>button {
|
| 15 |
background-color: #ff4d94;
|
| 16 |
color: white;
|
| 17 |
+
width: 100%;
|
| 18 |
}
|
| 19 |
.stSelectbox>div>div {
|
| 20 |
background-color: #ff99c2;
|
| 21 |
color: white;
|
| 22 |
}
|
| 23 |
+
.stSubheader, .stText, .stHeader, h1, h2 {
|
| 24 |
color: #b30047;
|
| 25 |
}
|
| 26 |
+
@media (max-width: 768px) {
|
| 27 |
+
.stApp {
|
| 28 |
+
padding: 1rem;
|
| 29 |
+
}
|
| 30 |
+
.stSelectbox>div>div {
|
| 31 |
+
width: 100%;
|
| 32 |
+
}
|
| 33 |
+
.stButton>button {
|
| 34 |
+
font-size: 1rem;
|
| 35 |
+
padding: 0.75rem 1.5rem;
|
| 36 |
+
}
|
| 37 |
+
.stHeader, .stSubheader {
|
| 38 |
+
font-size: 1.25rem;
|
| 39 |
+
}
|
| 40 |
+
.stText {
|
| 41 |
+
font-size: 1rem;
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
</style>
|
| 45 |
""", unsafe_allow_html=True)
|
| 46 |
|
| 47 |
+
# Language selection in the sidebar
|
| 48 |
+
selected_language = st.sidebar.selectbox("Choose Language", ["English", "French", "German"], index=0)
|
| 49 |
+
|
| 50 |
+
# Set title and subtitle
|
| 51 |
+
st.title("Menstrual Cycle")
|
| 52 |
+
st.subheader("Role of Hormones in Menstrual Cycle")
|
| 53 |
|
| 54 |
+
st.header("Select Your Current Phase")
|
| 55 |
+
|
| 56 |
+
phasen = {
|
| 57 |
+
"English": ["Menstruation (Winter)", "Follicular Phase (Spring)", "Ovulation Phase (Summer)", "Luteal Phase (Autumn)"],
|
| 58 |
+
"French": ["Menstruation (Hiver)", "Phase Folliculaire (Printemps)", "Phase d'Ovulation (Été)", "Phase Lutéale (Automne)"],
|
| 59 |
+
"German": ["Menstruation (Winter)", "Follikelphase (Frühling)", "Ovulationsphase (Sommer)", "Lutealphase (Herbst)"]
|
| 60 |
+
}
|
| 61 |
|
| 62 |
+
ausgewählte_phase = st.selectbox("Select Your Current Phase", phasen[selected_language])
|
|
|
|
| 63 |
|
| 64 |
+
# Tips for Stress and Energy Management
|
| 65 |
stress_management_tipps = {
|
| 66 |
+
"Menstruation (Winter)": "Rest. Engage in gentle activities like reading or journaling.",
|
| 67 |
+
"Follicular Phase (Spring)": "Plan new projects. Gradually increase your activity.",
|
| 68 |
+
"Ovulation Phase (Summer)": "Use your high energy for social and professional networking.",
|
| 69 |
+
"Luteal Phase (Autumn)": "Focus on completing tasks. Integrate stress-reducing activities like yoga."
|
| 70 |
}
|
| 71 |
|
|
|
|
| 72 |
energie_management_tipps = {
|
| 73 |
+
"Menstruation (Winter)": "Conserve your energy and avoid strenuous activities.",
|
| 74 |
+
"Follicular Phase (Spring)": "Gradually increase your energy expenditure. Focus on creative projects.",
|
| 75 |
+
"Ovulation Phase (Summer)": "Use your high energy for important tasks and social interactions.",
|
| 76 |
+
"Luteal Phase (Autumn)": "Watch out for energy dips. Prioritize important tasks and self-care."
|
| 77 |
}
|
| 78 |
|
| 79 |
# Detailed information about the phases
|
| 80 |
phaseninformationen = {
|
| 81 |
+
"Menstruation (Winter)": {
|
| 82 |
+
"beschreibung": "This is the rest phase where the body sheds the uterine lining.",
|
| 83 |
+
"körperliche_veränderungen": "Fatigue, cramps, back pain.",
|
| 84 |
+
"emotionale_veränderungen": "Introspection, low energy, need for rest."
|
| 85 |
},
|
| 86 |
+
"Follicular Phase (Spring)": {
|
| 87 |
+
"beschreibung": "The body prepares for ovulation by growing follicles in the ovaries.",
|
| 88 |
+
"körperliche_veränderungen": "Increased energy, clearer skin, higher libido.",
|
| 89 |
+
"emotionale_veränderungen": "Optimism, creativity, motivation."
|
| 90 |
},
|
| 91 |
+
"Ovulation Phase (Summer)": {
|
| 92 |
+
"beschreibung": "The most fertile phase where an egg is released from the ovary.",
|
| 93 |
+
"körperliche_veränderungen": "Peak energy, heightened senses, possible mild cramps.",
|
| 94 |
+
"emotionale_veränderungen": "High self-confidence, sociability, sexual desire."
|
| 95 |
},
|
| 96 |
+
"Luteal Phase (Autumn)": {
|
| 97 |
+
"beschreibung": "The body prepares for a possible pregnancy or the next menstrual cycle.",
|
| 98 |
+
"körperliche_veränderungen": "Bloating, breast tenderness, cravings.",
|
| 99 |
+
"emotionale_veränderungen": "Irritability, mood swings, increased stress."
|
| 100 |
}
|
| 101 |
}
|
| 102 |
|
| 103 |
selected_phase_info = phaseninformationen[ausgewählte_phase]
|
| 104 |
|
| 105 |
# Display selected phase information
|
| 106 |
+
st.subheader(f"Information about {ausgewählte_phase}")
|
| 107 |
+
st.write("**Description:**", selected_phase_info["beschreibung"])
|
| 108 |
+
st.write("**Physical Changes:**", selected_phase_info["körperliche_veränderungen"])
|
| 109 |
+
st.write("**Emotional Changes:**", selected_phase_info["emotionale_veränderungen"])
|
| 110 |
|
| 111 |
# Display stress and energy management tips
|
| 112 |
+
st.subheader(f"Tips for Stress and Energy Management in the {ausgewählte_phase}")
|
| 113 |
+
st.write("**Stress Management Tips:**", stress_management_tipps[ausgewählte_phase])
|
| 114 |
+
st.write("**Energy Management Tips:**", energie_management_tipps[ausgewählte_phase])
|