Spaces:
Configuration error
Configuration error
Download streamlit_app/app.py from rockysreenivasa/MathTutor: direct link, hf CLI and curl.
- Browser
- Download file 2.51 kB
-
https://huggingface.co/spaces/rockysreenivasa/MathTutor/resolve/main/streamlit_app/app.py
- Command line
-
hf download hf://spaces/rockysreenivasa/MathTutor/streamlit_app/app.py
-
curl -L -o app.py https://huggingface.co/spaces/rockysreenivasa/MathTutor/resolve/main/streamlit_app/app.py
2.51 kB
| import streamlit as st | |
| import sys, os | |
| sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) | |
| st.set_page_config( | |
| page_title="MathMind AI", | |
| page_icon="๐งฎ", | |
| layout="centered", | |
| initial_sidebar_state="auto", | |
| ) | |
| from streamlit_app.utils.auth import is_logged_in | |
| from streamlit_app.utils.ui import apply_theme | |
| apply_theme() | |
| # โโ Landing page โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| st.markdown(""" | |
| <style> | |
| .hero { text-align: left; padding: 0.2rem 0.1rem 0.6rem; } | |
| .hero h1 { font-size: 2.4rem; margin-bottom: 0.3rem; } | |
| .hero p { font-size: 1rem; color: #475569; margin-bottom: 0.7rem; } | |
| </style> | |
| <div class="mm-hero hero"> | |
| <h1>๐งฎ MathMind AI</h1> | |
| <p>Your personal AI math tutor for Grades 6 โ 12</p> | |
| </div> | |
| """, unsafe_allow_html=True) | |
| st.markdown('<div class="mm-section-title">What you get</div>', unsafe_allow_html=True) | |
| col1, col2, col3 = st.columns(3) | |
| with col1: | |
| st.markdown( | |
| """ | |
| <div class="mm-card"> | |
| <div class="mm-feature-title">๐ง Adaptive Explanations</div> | |
| <div class="mm-feature-text">Grade-calibrated, step-by-step answers to any math question.</div> | |
| </div> | |
| """, | |
| unsafe_allow_html=True, | |
| ) | |
| with col2: | |
| st.markdown( | |
| """ | |
| <div class="mm-card"> | |
| <div class="mm-feature-title">๐ Mini-Tests</div> | |
| <div class="mm-feature-text">Prove your understanding with 5 questions and instant feedback.</div> | |
| </div> | |
| """, | |
| unsafe_allow_html=True, | |
| ) | |
| with col3: | |
| st.markdown( | |
| """ | |
| <div class="mm-card"> | |
| <div class="mm-feature-title">๐ Badges & Streaks</div> | |
| <div class="mm-feature-text">Earn rewards and track your daily learning consistency.</div> | |
| </div> | |
| """, | |
| unsafe_allow_html=True, | |
| ) | |
| st.divider() | |
| if is_logged_in(): | |
| st.success(f"Welcome back! You're logged in as **{st.session_state.get('user_email', '')}**") | |
| col_a, col_b = st.columns(2) | |
| with col_a: | |
| st.page_link("pages/2_Tutor.py", label="โถ๏ธ Start Learning", use_container_width=True) | |
| with col_b: | |
| st.page_link("pages/3_Dashboard.py", label="๐ My Dashboard", use_container_width=True) | |
| else: | |
| st.page_link("pages/1_Login.py", label="๐ Get Started โ Login or Sign Up", use_container_width=True) | |