Spaces:
Running
Running
import streamlit as st | |
st.set_page_config(layout="wide") | |
for name in dir(): | |
if not name.startswith('_'): | |
del globals()[name] | |
import numpy as np | |
import pandas as pd | |
import streamlit as st | |
import gspread | |
import pymongo | |
def init_conn(): | |
uri = st.secrets['mongo_uri'] | |
client = pymongo.MongoClient(uri, retryWrites=True, serverSelectionTimeoutMS=500000) | |
db = client["MLB_Database"] | |
return db | |
# db = init_conn() | |
player_roo_format = {'Top_finish': '{:.2%}','Top_5_finish': '{:.2%}', 'Top_10_finish': '{:.2%}', '20+%': '{:.2%}', '2x%': '{:.2%}', '3x%': '{:.2%}', | |
'4x%': '{:.2%}'} | |
st.markdown(""" | |
<style> | |
/* Tab styling */ | |
.stTabs [data-baseweb="tab-list"] { | |
gap: 8px; | |
padding: 4px; | |
} | |
.stTabs [data-baseweb="tab"] { | |
height: 50px; | |
white-space: pre-wrap; | |
background-color: #DAA520; | |
color: white; | |
border-radius: 10px; | |
gap: 1px; | |
padding: 10px 20px; | |
font-weight: bold; | |
transition: all 0.3s ease; | |
} | |
.stTabs [aria-selected="true"] { | |
background-color: #DAA520; | |
border: 3px solid #FFD700; | |
color: white; | |
} | |
.stTabs [data-baseweb="tab"]:hover { | |
background-color: #FFD700; | |
cursor: pointer; | |
} | |
</style>""", unsafe_allow_html=True) | |
tab1, tab2, tab3 = st.tabs(["Scoring Percentages", "Player ROO", "Optimals"]) | |
with tab1: | |
st.title("Scoring Percentages") | |
st.write("This is the scoring percentages tab.") | |
with tab2: | |
st.title("Player ROO") | |
st.write("This is the player ROO tab.") | |
with tab3: | |
st.title("Optimals") | |
st.write("This is the optimals tab.") | |