SHERLOCK / app.py
Johan713's picture
Upload 2 files
33dcba3 verified
raw
history blame
4.54 kB
import streamlit as st
from pages import (
chatbot, notes_generation, exam_preparation, mnemonics_generation,
study_roadmap, interview_preparation, ai_buddy, meditation,
mind_palace, sherlock_observation
)
# Custom CSS for improved styling
def local_css(file_name):
with open(file_name, "r") as f:
st.markdown(f'<style>{f.read()}</style>', unsafe_allow_html=True)
# Load custom CSS
local_css("style.css")
st.set_page_config(
page_title="S.H.E.R.L.O.C.K.",
page_icon="πŸ•΅οΈ",
layout="wide",
initial_sidebar_state="expanded"
)
# Define the pages with icons
PAGES = {
"Web RAG Powered Chatbot": {"icon": "πŸ’¬", "function": chatbot},
"Notes Generation": {"icon": "πŸ“", "function": notes_generation},
"Exam Preparation": {"icon": "πŸ“š", "function": exam_preparation},
"Mnemonics Generation": {"icon": "🧠", "function": mnemonics_generation},
"Study Roadmap": {"icon": "πŸ—ΊοΈ", "function": study_roadmap},
"Interview Preparation": {"icon": "🎀", "function": interview_preparation},
"AI Buddy": {"icon": "πŸ€–", "function": ai_buddy},
"Meditation & Mindfulness": {"icon": "🧘", "function": meditation},
"Mind Palace Builder": {"icon": "πŸ›οΈ", "function": mind_palace},
"Sherlock Style Observation": {"icon": "πŸ”", "function": sherlock_observation}
}
def main():
st.sidebar.image("logo.png", use_column_width=True)
st.sidebar.title("S.H.E.R.L.O.C.K. πŸ•΅οΈ")
st.sidebar.markdown("*Study Helper & Educational Resource for Learning & Observational Knowledge*")
st.markdown("""
<style>
body {
font-family: 'Roboto', sans-serif;
background-color: #f0f2f6;
}
.stButton button {
background-color: #0e1117;
color: white;
border-radius: 20px;
padding: 10px 20px;
font-weight: bold;
transition: all 0.3s ease;
}
.stButton button:hover {
background-color: #2e7d32;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.sidebar .sidebar-content {
background-color: #0e1117;
color: white;
}
h1, h2, h3 {
color: #1e3a8a;
}
.stRadio > label {
font-weight: bold;
color: #333;
}
</style>
""")
selection = st.sidebar.radio(
"Navigate",
list(PAGES.keys()),
format_func=lambda x: f"{PAGES[x]['icon']} {x}"
)
st.sidebar.markdown("---")
st.sidebar.info(
"This app is part of the S.H.E.R.L.O.C.K. project. "
"For more information, visit [our website](https://example.com)."
)
st.sidebar.text("Version 1.0")
# Main content area
st.title(f"{PAGES[selection]['icon']} {selection}")
# Display a brief description of the selected feature
feature_descriptions = {
"Web RAG Powered Chatbot": "Engage with our AI-powered chatbot for interactive learning and web-based information retrieval.",
"Notes Generation": "Transform complex documents into concise, easy-to-understand notes.",
"Exam Preparation": "Generate custom question papers and practice tests to ace your exams.",
"Mnemonics Generation": "Create personalized memory aids to boost your retention of key information.",
"Study Roadmap": "Get a tailored learning path to achieve your educational goals efficiently.",
"Interview Preparation": "Simulate interview scenarios and receive feedback to improve your performance.",
"AI Buddy": "Chat with a personalized AI companion for support and therapy sessions.",
"Meditation & Mindfulness": "Access resources for relaxation, focus, and mental well-being.",
"Mind Palace Builder": "Construct mental frameworks to enhance your memory and learning capabilities.",
"Sherlock Style Observation": "Develop critical thinking skills and learn to approach subjects from unique perspectives."
}
st.markdown(f"*{feature_descriptions[selection]}*")
st.markdown("---")
# Load the selected page
with st.spinner(f"Loading {selection} ..."):
PAGES[selection]["function"].main()
if __name__ == "__main__":
main()