Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navbar enhanced with same color scheme #198

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 11 additions & 38 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import streamlit.components.v1 as components
import os
from dotenv import load_dotenv
from streamlit_navigation_bar import st_navbar
import logging
import sys

Expand All @@ -40,6 +41,7 @@ def global_error_handler(exc_type, exc_value, exc_traceback):
#AI Integration
import anthropic
import datetime

# CSS for Scroll to Top Button
scroll_to_top = """
<style>
Expand Down Expand Up @@ -190,53 +192,24 @@ def load_lottie_url(url: str):

# Main function to control page navigation
def main():
selected = option_menu(
menu_title=None,

options=["Home", "Calm Space", "About & Feedback","FAQs"],
icons=["house-door-fill", "cloud-sun-fill", "chat-dots-fill","question-circle-fill"],

menu_icon="sun",
default_index=0,
orientation="horizontal",
styles={
"container": {
"padding": "0!important",
"background-color": "#333",
"border-radius": "10px",
"box-shadow": "0 4px 6px rgba(0, 0, 0, 0.1)",
"width": "100%", # Increase the width of the menu bar
"max-width": "100%", # Prevent overflow
},
"nav-link": {
"font-size": "18px",
"text-align": "center",
"margin": "0 20px", # Increase left and right margin to expand space between items
"--hover-color": "#ddd",
"border-radius": "10px",
"color": "#fff",
"background-color": "rgba(0, 0, 0, 0.8)", # More opaque background
"transition": "background-color 0.3s ease, transform 0.2s"
},
"nav-link-selected": {
"background-color": "#04AA6D",
"color": "#fff",
"font-size": "14px",
}
}
)

styles = {
"nav": {
"background-color": "rgb(0, 0, 0)",
},
}

selected = st_navbar(["Home", "Calm Space", "About & Feedback", "FAQs"], styles=styles)

if selected == "Home":
show_main_page()
elif selected == "Calm Space":
show_calm_space()
elif selected == "Resources": # Added condition for "Resources"
show_resources() # Call the new function
elif selected == "About & Feedback":
show_about_and_feedback()
elif selected == "FAQs":
show_FAQs_page()


def show_main_page():
st.markdown(
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ streamlit-option-menu==0.3.2
anthropic
python-dotenv
pymongo
streamlit_navigation_bar