Trinay16's picture
Upload 9 files
7f3833a verified
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()