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"
'{message}'
", 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("---")