Spaces:
Sleeping
Sleeping
File size: 2,783 Bytes
c77627c 37c163b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 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 |
import streamlit as st
# App title
st.title("π Student Mood Grade Tracker")
st.write("*How does your grade affect your mood? Let's find out!*")
# Grade slider
grade = st.slider("Select your grade:", 0, 100, 85, help="Move the slider to see how your mood changes!")
# Define mood mappings
def get_mood_data(grade):
if grade >= 95:
return "π€©", "ECSTATIC", "#00ff00", "I'm basically a genius!"
elif grade >= 90:
return "π", "THRILLED", "#32cd32", "Time to celebrate!"
elif grade >= 85:
return "π", "HAPPY", "#90ee90", "Pretty good, I'm satisfied!"
elif grade >= 80:
return "π", "CONTENT", "#ffff99", "Not bad, could be worse"
elif grade >= 75:
return "π", "MEH", "#ffa500", "It's... acceptable I guess"
elif grade >= 70:
return "π", "DISAPPOINTED", "#ff6347", "Ugh, I expected better"
elif grade >= 65:
return "π", "WORRIED", "#ff4500", "This is concerning..."
elif grade >= 60:
return "π¨", "PANICKED", "#ff0000", "I need to study MORE!"
else:
return "π", "DEAD INSIDE", "#8b0000", "Time to change majors"
# Get current mood data
emoji, mood, color, message = get_mood_data(grade)
# Display the result with styling
st.markdown("---")
# Create columns for better layout
col1, col2, col3 = st.columns([1, 2, 1])
with col2:
# Large emoji display
st.markdown(f"<div style='text-align: center; font-size: 100px;'>{emoji}</div>",
unsafe_allow_html=True)
# Mood text with color
st.markdown(f"<h2 style='text-align: center; color: {color};'>{mood}</h2>",
unsafe_allow_html=True)
# Grade display
st.markdown(f"<h3 style='text-align: center;'>Grade: {grade}%</h3>",
unsafe_allow_html=True)
# Mood message
st.markdown(f"<p style='text-align: center; font-style: italic; font-size: 18px;'>'{message}'</p>",
unsafe_allow_html=True)
# Add some fun statistics
st.markdown("---")
st.subheader("π Mood Statistics")
col1, col2, col3 = st.columns(3)
with col1:
st.metric("Happiness Level", f"{min(grade, 100)}%")
with col2:
stress_level = max(0, 100 - grade)
st.metric("Stress Level", f"{stress_level}%")
with col3:
coffee_needed = max(0, (100 - grade) // 10)
st.metric("Coffees Needed", f"{coffee_needed} β")
# Motivational section
st.markdown("---")
if grade < 70:
st.warning("π― **Study Tip**: Remember, every expert was once a beginner. You've got this!")
elif grade < 85:
st.info("πͺ **Keep Going**: You're doing well! A little more effort can make a big difference.")
else:
st.success("π **Amazing Work**: You're crushing it! Keep up the excellent work!")
# Fun footer
st.markdown("---")
|