Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -83,53 +83,58 @@ if 'responses' not in st.session_state:
|
|
| 83 |
"mental_health_check_in": ""
|
| 84 |
}
|
| 85 |
|
| 86 |
-
|
| 87 |
st.set_page_config(page_title="EduNexus", page_icon=":book:", layout="wide")
|
| 88 |
|
| 89 |
# Add custom styling using Streamlit
|
| 90 |
st.markdown("""
|
| 91 |
<style>
|
| 92 |
.css-1o7k8tt {
|
| 93 |
-
background-color: #
|
| 94 |
-
color:
|
| 95 |
}
|
| 96 |
.css-1o7k8tt h1 {
|
| 97 |
-
color: #
|
| 98 |
}
|
| 99 |
.stButton {
|
| 100 |
-
background-color: #
|
| 101 |
-
color: #
|
| 102 |
border-radius: 8px;
|
| 103 |
padding: 10px 20px;
|
| 104 |
font-size: 14px;
|
|
|
|
| 105 |
}
|
| 106 |
.stButton:hover {
|
| 107 |
-
background-color: #
|
|
|
|
| 108 |
}
|
| 109 |
.stTextInput, .stTextArea {
|
| 110 |
-
border: 1px solid #
|
| 111 |
border-radius: 8px;
|
| 112 |
-
background-color: #
|
| 113 |
color: #ffffff;
|
| 114 |
}
|
| 115 |
.stTextInput::placeholder, .stTextArea::placeholder {
|
| 116 |
-
color: #
|
| 117 |
}
|
| 118 |
.stSidebar {
|
| 119 |
-
background-color: #
|
| 120 |
}
|
| 121 |
.stSidebar .stMarkdown {
|
| 122 |
color: #ffffff;
|
| 123 |
}
|
| 124 |
.footer {
|
| 125 |
-
background-color: #
|
| 126 |
padding: 10px;
|
| 127 |
text-align: center;
|
| 128 |
color: #ffffff;
|
| 129 |
-
border-top: 1px solid #
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
}
|
| 131 |
.footer a {
|
| 132 |
-
color: #
|
| 133 |
margin: 0 10px;
|
| 134 |
text-decoration: none;
|
| 135 |
font-size: 18px;
|
|
@@ -183,81 +188,40 @@ def display_tool_form(tool_key, submit_function, placeholder):
|
|
| 183 |
if clear_button:
|
| 184 |
st.session_state['responses'][tool_key] = ""
|
| 185 |
|
| 186 |
-
|
| 187 |
-
st.sidebar.title("EduNexus Tools")
|
| 188 |
-
selected_tool = st.sidebar.radio(
|
| 189 |
-
"Select a tool",
|
| 190 |
-
("personalized_learning_assistant", "ai_coding_mentor", "smart_document_summarizer",
|
| 191 |
-
"interactive_study_planner", "real_time_qa_support", "mental_health_check_in")
|
| 192 |
-
)
|
| 193 |
|
| 194 |
-
#
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
display_tool_form(
|
| 198 |
-
"personalized_learning_assistant",
|
| 199 |
-
personalized_learning_assistant,
|
| 200 |
-
"e.g., Explain quantum mechanics with a real-world example."
|
| 201 |
-
)
|
| 202 |
-
if st.session_state['responses']['personalized_learning_assistant']:
|
| 203 |
-
display_response("personalized_learning_assistant", st.session_state['responses']['personalized_learning_assistant'])
|
| 204 |
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
display_tool_form(
|
| 208 |
-
"ai_coding_mentor",
|
| 209 |
-
ai_coding_mentor,
|
| 210 |
-
"e.g., for i in range(10): print(i)"
|
| 211 |
-
)
|
| 212 |
-
if st.session_state['responses']['ai_coding_mentor']:
|
| 213 |
-
display_response("ai_coding_mentor", st.session_state['responses']['ai_coding_mentor'])
|
| 214 |
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
display_tool_form(
|
| 218 |
-
"smart_document_summarizer",
|
| 219 |
-
smart_document_summarizer,
|
| 220 |
-
"e.g., The rise of electric vehicles..."
|
| 221 |
-
)
|
| 222 |
-
if st.session_state['responses']['smart_document_summarizer']:
|
| 223 |
-
display_response("smart_document_summarizer", st.session_state['responses']['smart_document_summarizer'])
|
| 224 |
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
display_tool_form(
|
| 228 |
-
"interactive_study_planner",
|
| 229 |
-
interactive_study_planner,
|
| 230 |
-
"e.g., 3 exams in one week"
|
| 231 |
-
)
|
| 232 |
-
if st.session_state['responses']['interactive_study_planner']:
|
| 233 |
-
display_response("interactive_study_planner", st.session_state['responses']['interactive_study_planner'])
|
| 234 |
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
display_tool_form(
|
| 238 |
-
"real_time_qa_support",
|
| 239 |
-
real_time_qa_support,
|
| 240 |
-
"e.g., What is Newton's third law?"
|
| 241 |
-
)
|
| 242 |
-
if st.session_state['responses']['real_time_qa_support']:
|
| 243 |
-
display_response("real_time_qa_support", st.session_state['responses']['real_time_qa_support'])
|
| 244 |
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
display_tool_form(
|
| 248 |
-
"mental_health_check_in",
|
| 249 |
-
mental_health_check_in,
|
| 250 |
-
"e.g., Stressed about exams"
|
| 251 |
-
)
|
| 252 |
-
if st.session_state['responses']['mental_health_check_in']:
|
| 253 |
-
display_response("mental_health_check_in", st.session_state['responses']['mental_health_check_in'])
|
| 254 |
|
| 255 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
st.markdown("""
|
| 257 |
<div class="footer">
|
| 258 |
-
<
|
| 259 |
-
<a href="https://twitter.com/
|
| 260 |
-
<a href="https://linkedin.com/in/
|
| 261 |
-
<
|
|
|
|
| 262 |
</div>
|
| 263 |
-
""", unsafe_allow_html=True)
|
|
|
|
| 83 |
"mental_health_check_in": ""
|
| 84 |
}
|
| 85 |
|
|
|
|
| 86 |
st.set_page_config(page_title="EduNexus", page_icon=":book:", layout="wide")
|
| 87 |
|
| 88 |
# Add custom styling using Streamlit
|
| 89 |
st.markdown("""
|
| 90 |
<style>
|
| 91 |
.css-1o7k8tt {
|
| 92 |
+
background-color: #2f2f6f;
|
| 93 |
+
color: #ffffff;
|
| 94 |
}
|
| 95 |
.css-1o7k8tt h1 {
|
| 96 |
+
color: #d6a4a0;
|
| 97 |
}
|
| 98 |
.stButton {
|
| 99 |
+
background-color: #d6a4a0;
|
| 100 |
+
color: #ffffff;
|
| 101 |
border-radius: 8px;
|
| 102 |
padding: 10px 20px;
|
| 103 |
font-size: 14px;
|
| 104 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
|
| 105 |
}
|
| 106 |
.stButton:hover {
|
| 107 |
+
background-color: #b35b5b;
|
| 108 |
+
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
|
| 109 |
}
|
| 110 |
.stTextInput, .stTextArea {
|
| 111 |
+
border: 1px solid #d6a4a0;
|
| 112 |
border-radius: 8px;
|
| 113 |
+
background-color: #1f1f2f;
|
| 114 |
color: #ffffff;
|
| 115 |
}
|
| 116 |
.stTextInput::placeholder, .stTextArea::placeholder {
|
| 117 |
+
color: #a0a0a0;
|
| 118 |
}
|
| 119 |
.stSidebar {
|
| 120 |
+
background-color: #3e3e5f;
|
| 121 |
}
|
| 122 |
.stSidebar .stMarkdown {
|
| 123 |
color: #ffffff;
|
| 124 |
}
|
| 125 |
.footer {
|
| 126 |
+
background-color: #2e2e3e;
|
| 127 |
padding: 10px;
|
| 128 |
text-align: center;
|
| 129 |
color: #ffffff;
|
| 130 |
+
border-top: 1px solid #d6a4a0;
|
| 131 |
+
position: fixed;
|
| 132 |
+
bottom: 0;
|
| 133 |
+
width: 100%;
|
| 134 |
+
box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.3);
|
| 135 |
}
|
| 136 |
.footer a {
|
| 137 |
+
color: #d6a4a0;
|
| 138 |
margin: 0 10px;
|
| 139 |
text-decoration: none;
|
| 140 |
font-size: 18px;
|
|
|
|
| 188 |
if clear_button:
|
| 189 |
st.session_state['responses'][tool_key] = ""
|
| 190 |
|
| 191 |
+
st.title("EduNexus: Your Academic Assistant")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
|
| 193 |
+
# Display forms for each tool
|
| 194 |
+
st.header("1. Personalized Learning Assistant")
|
| 195 |
+
display_tool_form("personalized_learning_assistant", personalized_learning_assistant, "Enter the topic you want to learn about...")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
|
| 197 |
+
st.header("2. AI Coding Mentor")
|
| 198 |
+
display_tool_form("ai_coding_mentor", ai_coding_mentor, "Paste your code snippet here...")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
|
| 200 |
+
st.header("3. Smart Document Summarizer")
|
| 201 |
+
display_tool_form("smart_document_summarizer", smart_document_summarizer, "Paste your document text here...")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
|
| 203 |
+
st.header("4. Interactive Study Planner")
|
| 204 |
+
display_tool_form("interactive_study_planner", interactive_study_planner, "Enter your exam schedule here...")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
|
| 206 |
+
st.header("5. Real-Time Q&A Support")
|
| 207 |
+
display_tool_form("real_time_qa_support", real_time_qa_support, "Ask your academic question here...")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
|
| 209 |
+
st.header("6. Mental Health Check-In")
|
| 210 |
+
display_tool_form("mental_health_check_in", mental_health_check_in, "Share how you are feeling today...")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 211 |
|
| 212 |
+
# Display responses
|
| 213 |
+
st.write("### Responses")
|
| 214 |
+
for key, response in st.session_state['responses'].items():
|
| 215 |
+
if response:
|
| 216 |
+
display_response(key, response)
|
| 217 |
+
|
| 218 |
+
# Footer
|
| 219 |
st.markdown("""
|
| 220 |
<div class="footer">
|
| 221 |
+
<a href="https://github.com/your-repo">GitHub</a> |
|
| 222 |
+
<a href="https://twitter.com/your-profile">Twitter</a> |
|
| 223 |
+
<a href="https://linkedin.com/in/your-profile">LinkedIn</a>
|
| 224 |
+
<br>
|
| 225 |
+
<i>EduNexus © 2024</i>
|
| 226 |
</div>
|
| 227 |
+
""", unsafe_allow_html=True)
|