Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import random | |
| import time | |
| st.set_page_config(page_title="Match Setup", layout="centered") | |
| st.title("π Match Setup") | |
| teams = ["India", "Australia", "England", "South Africa", "New Zealand"] | |
| your_team = st.selectbox("π½ Select Your Team", teams) | |
| opponent = st.selectbox("π§’ Select Opponent", [team for team in teams if team != your_team]) | |
| overs = st.slider("β³ Select Number of Overs", 1, 10, 5) | |
| pitch = st.radio("π§± Pitch Type", ["Flat", "Green", "Dusty"]) | |
| weather = st.radio("π€οΈ Weather Conditions", ["Sunny", "Cloudy", "Rainy"]) | |
| stadiums = ["Wankhede - Mumbai", "MCG - Melbourne", "Lords - London", "Newlands - Cape Town"] | |
| stadium = st.selectbox("ποΈ Select Stadium", stadiums) | |
| bowling_type = st.radio("π― Your Bowling Style", ["Fast", "Medium", "Spin"]) | |
| batting_first = st.radio("π§βπ Who Bats First?", [your_team, opponent]) | |
| st.markdown("---") | |
| with st.expander("ποΈ Preview Match Vibes (Animation Ready)"): | |
| st.info("β‘ Animation Placeholder for a dynamic cricket intro (e.g., stadium flyover)") | |
| st.markdown("## π§Ύ Match Summary") | |
| st.markdown(f""" | |
| - π Teams: **{your_team}** vs **{opponent}** | |
| - π Overs: **{overs}** | |
| - π§± Pitch: **{pitch}** | |
| - π€οΈ Weather: **{weather}** | |
| - ποΈ Stadium: **{stadium}** | |
| - π― Bowling Style: **{bowling_type}** | |
| - π§βπ Batting First: **{batting_first}** | |
| """) | |
| if st.button("β Confirm Match Setup"): | |
| with st.spinner("Locking it in..."): | |
| time.sleep(1.5) | |
| st.session_state["match_ready"] = True | |
| st.session_state["your_team"] = your_team | |
| st.session_state["opponent"] = opponent | |
| st.session_state["overs"] = overs | |
| st.session_state["pitch"] = pitch | |
| st.session_state["weather"] = weather | |
| st.session_state["stadium"] = stadium | |
| st.session_state["bowling_type"] = bowling_type | |
| st.session_state["batting_first"] = batting_first | |
| st.success("π Match is ready! Go to **Live Match** to begin.") | |
| st.balloons() | |