Sathwikchowdary commited on
Commit
60c9571
·
verified ·
1 Parent(s): d72db4f

Update Home.py

Browse files
Files changed (1) hide show
  1. Home.py +73 -38
Home.py CHANGED
@@ -1,14 +1,17 @@
1
  import streamlit as st
2
  from streamlit_extras.switch_page_button import switch_page
3
 
4
- # Custom styles
5
  st.markdown(
6
- """
7
  <style>
8
- .stApp {
9
- background-color: #f0f8ff;
10
- }
11
- .header {
 
 
 
12
  text-align: center;
13
  color: red;
14
  font-size: 30px;
@@ -17,30 +20,47 @@ st.markdown(
17
  justify-content: center;
18
  align-items: center;
19
  position: relative;
20
- }
21
- .logo {
 
22
  position: absolute;
23
- right: 10px;
24
- top: 0;
25
  width: 80px;
26
  height: auto;
27
- }
28
- .sub-header {
29
  color: darkorange;
30
- font-size: 24px;
31
  font-weight: bold;
32
- }
33
- .text {
34
- font-size: 16px;
 
35
  color: black;
36
  font-style: italic;
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  </style>
39
  """,
40
  unsafe_allow_html=True,
41
  )
42
 
43
- # App Header with Logo on the Right Corner
44
  st.markdown(
45
  """
46
  <div class='header'>
@@ -51,36 +71,51 @@ st.markdown(
51
  unsafe_allow_html=True
52
  )
53
 
54
- # Cricket Information
55
  st.markdown("<h2 class='sub-header'>Cricket - The Gentleman’s Game 🏆</h2>", unsafe_allow_html=True)
56
  st.markdown(
57
- "<p class='text'>"
58
- "Cricket is one of the most popular sports worldwide, loved by millions. It is played in multiple formats, including Test matches, One Day Internationals (ODIs), and T20s. "
59
- "With legendary players, thrilling rivalries, and unforgettable moments, cricket has become more than just a game—it's an emotion for fans around the globe. 🏏🔥"
60
- "</p>",
61
- unsafe_allow_html=True
 
62
  )
63
 
64
- # About Cric Metrics
65
  st.markdown("<h2 class='sub-header'>What is Cric Metrics? 📊</h2>", unsafe_allow_html=True)
66
  st.markdown(
67
- "<p class='text'>"
68
- "Cric Metrics is an advanced cricket analytics platform designed to provide in-depth insights, player comparisons, "
69
- "score predictions, and team analysis using AI and machine learning. 📈🤖"
70
- "</p>",
71
- unsafe_allow_html=True
 
 
 
 
 
 
 
72
  )
73
 
74
- # Player Information Button
75
- if st.button("📊 Player Information"):
76
- st.switch_page("pages/1player_information.py")
 
 
77
 
78
- # Author Section
79
  st.markdown("<h2 class='sub-header'>About the Author 👨‍💻</h2>", unsafe_allow_html=True)
80
  st.markdown(
81
- "<p class='text'>"
82
- "<b>Sai Kalyan Satwik</b> is a seasoned cricket enthusiast and tech entrepreneur. "
83
- "He specializes in data science, Python programming, and Exploratory Data Analysis (EDA). 🏏📊"
84
- "</p>",
 
 
85
  unsafe_allow_html=True
86
  )
 
 
 
 
1
  import streamlit as st
2
  from streamlit_extras.switch_page_button import switch_page
3
 
4
+ # Background Image Styling
5
  st.markdown(
6
+ f"""
7
  <style>
8
+ .stApp {{
9
+ background-image: url("background.jpg");
10
+ background-size: cover;
11
+ background-repeat: no-repeat;
12
+ background-attachment: fixed;
13
+ }}
14
+ .header {{
15
  text-align: center;
16
  color: red;
17
  font-size: 30px;
 
20
  justify-content: center;
21
  align-items: center;
22
  position: relative;
23
+ padding-top: 20px;
24
+ }}
25
+ .logo {{
26
  position: absolute;
27
+ right: 20px;
28
+ top: 10px;
29
  width: 80px;
30
  height: auto;
31
+ }}
32
+ .sub-header {{
33
  color: darkorange;
34
+ font-size: 26px;
35
  font-weight: bold;
36
+ margin-top: 30px;
37
+ }}
38
+ .text {{
39
+ font-size: 17px;
40
  color: black;
41
  font-style: italic;
42
+ background-color: rgba(255, 255, 255, 0.75);
43
+ padding: 15px;
44
+ border-radius: 10px;
45
+ margin-bottom: 20px;
46
+ }}
47
+ .button-container {{
48
+ text-align: center;
49
+ margin-top: 20px;
50
+ }}
51
+ .footer {{
52
+ font-size: 14px;
53
+ color: #333;
54
+ margin-top: 50px;
55
+ text-align: center;
56
+ font-style: italic;
57
+ }}
58
  </style>
59
  """,
60
  unsafe_allow_html=True,
61
  )
62
 
63
+ # Header with Logo
64
  st.markdown(
65
  """
66
  <div class='header'>
 
71
  unsafe_allow_html=True
72
  )
73
 
74
+ # Intro to Cricket
75
  st.markdown("<h2 class='sub-header'>Cricket - The Gentleman’s Game 🏆</h2>", unsafe_allow_html=True)
76
  st.markdown(
77
+ """
78
+ <div class='text'>
79
+ Cricket is not just a sport—it's a passion that unites nations. From the roar of the stadium to the precision of a last-ball thriller, cricket teaches discipline, strategy, and the spirit of sportsmanship.<br><br>
80
+ Whether it's Test cricket’s grind, ODI’s balance, or T20’s thrill—each format brings unique excitement. Players like Sachin Tendulkar, MS Dhoni, and Virat Kohli have inspired generations across the globe.
81
+ </div>
82
+ """, unsafe_allow_html=True
83
  )
84
 
85
+ # What is Cric Metrics?
86
  st.markdown("<h2 class='sub-header'>What is Cric Metrics? 📊</h2>", unsafe_allow_html=True)
87
  st.markdown(
88
+ """
89
+ <div class='text'>
90
+ <b>Cric Metrics</b> is a smart analytics platform built using Python and Machine Learning. It helps cricket fans and analysts:
91
+ <ul>
92
+ <li>⚡ Compare players based on batting, bowling, and fielding metrics</li>
93
+ <li>📈 Predict match outcomes and player performances</li>
94
+ <li>📊 Visualize data using advanced graphs and charts</li>
95
+ <li>💡 Make informed decisions using AI-powered insights</li>
96
+ </ul>
97
+ Whether you're a fan, coach, or data nerd—Cric Metrics is your playground for cricket analytics.
98
+ </div>
99
+ """, unsafe_allow_html=True
100
  )
101
 
102
+ # Player Info Button
103
+ st.markdown("<div class='button-container'>", unsafe_allow_html=True)
104
+ if st.button("📊 Explore Player Information"):
105
+ switch_page("pages/1player_information.py")
106
+ st.markdown("</div>", unsafe_allow_html=True)
107
 
108
+ # About Author
109
  st.markdown("<h2 class='sub-header'>About the Author 👨‍💻</h2>", unsafe_allow_html=True)
110
  st.markdown(
111
+ """
112
+ <div class='text'>
113
+ <b>Sai Kalyan Satwik</b> is a seasoned cricket enthusiast and tech entrepreneur with over 10 years of experience in data science and software development. <br><br>
114
+ His passion for cricket meets his technical expertise in this app, blending numbers with narratives for fans and analysts alike.
115
+ </div>
116
+ """,
117
  unsafe_allow_html=True
118
  )
119
+
120
+ # Footer
121
+ st.markdown("<div class='footer'>Built with ❤️ using Streamlit | © 2025 Cric Metrics</div>", unsafe_allow_html=True)