Cric_Metrics / home.py
Sathwikchowdary's picture
Create home.py
b5734ec verified
raw
history blame
3.5 kB
import streamlit as st
from streamlit_extras.switch_page_button import switch_page
import base64
import webbrowser
# Initialize session state to track which button was clicked
if 'button_clicked' not in st.session_state:
st.session_state.button_clicked = None
# Custom styles
st.markdown(
"""
<style>
.stApp {
background-color: blue;
}
.title {
text-align: center;
color: red;
font-size: 36px;
font-family: 'Times New Roman';
font-weight: bold;
}
.header {
font-size: 28px;
font-family: 'Times New Roman';
color: blue;
font-style: italic;
font-weight: bold;
}
.header1 {
font-size: 24px;
font-family: 'Times New Roman';
color: green;
font-style: italic;
font-weight: bold;
}
.header2 {
font-size: 20px;
font-family: 'Times New Roman';
color: black;
font-style: italic;
font-weight: bold;
}
.content {
font-size: 16px;
font-family: 'Times New Roman';
line-height: 1.6;
color: black;
}
.example {
font-size: 16px;
font-family: 'Times New Roman';
font-style: italic;
color: black;
}
</style>
""",
unsafe_allow_html=True,
)
# Initialize session state variables
for key in ['page', 'jupyter_clicked', 'pdf_clicked', 'excel_clicked']:
if key not in st.session_state:
st.session_state[key] = 'home' if key == 'page' else False
# Page routing
page = st.session_state['page']
if page == 'home':
st.markdown("<div class='title'> Cric Metrics - AI-Powered Cricket Insights </div><br>", unsafe_allow_html=True)
st.markdown("<div class='header'>What is Cric Metrics?</div><br>", unsafe_allow_html=True)
st.markdown(
"""
<div class='content'>
Cric Metrics is an advanced cricket analytics platform designed to provide in-depth insights, player comparisons, score predictions, and team analysis using AI and machine learning.<br><br>
Key Features:<br>
1. **Player Profiles & Comparisons** – Analyze detailed stats and compare players across formats.<br>
2. **Team Analysis** – Head-to-head matchups, recent performance, and winning probabilities.<br>
3. **Score Prediction** – AI-driven forecasts based on historical data and live conditions.<br>
<br>
Whether you're a cricket enthusiast, fantasy league player, or analyst, Cric Metrics gives you the edge with data-driven insights!
</div><br><br>
""",
unsafe_allow_html=True,
)
st.markdown("<div class='header1'>About the Author</div><br>", unsafe_allow_html=True)
st.markdown(
"""
<div class='content'>
**Sai Kalyan Satwik** is a seasoned cricket enthusiast and tech entrepreneur with over 10 years of experience in the field. Passionate about blending technology with sports, he has developed Cric Metrics to bring the power of AI and data science into cricket analytics. His expertise spans machine learning, software development, and cricket analysis, making Cric Metrics a top-tier analytical platform for cricket lovers worldwide.
</div>
""",
unsafe_allow_html=True,
)