diff --git a/src/App.tsx b/src/App.tsx index a678edb..802086a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -98,7 +98,7 @@ function NumberSlider({ value={Number.isFinite(value) ? value : 0} onChange={(e) => onChange(clamp(parseFloat(e.target.value || "0"), min, max))} /> - {help &&

{help}

} + {help &&

{help}

} ); } @@ -118,17 +118,21 @@ interface PlayoffRound { export default function BaseballLeagueCostEstimator() { const [fixedCosts, setFixedCosts] = useState>([ { id: crypto.randomUUID(), name: "Insurance", amount: 1500 }, - { id: crypto.randomUUID(), name: "Commissioner", amount: 2000 }, + { id: crypto.randomUUID(), name: "Commissioner", amount: 0 }, + { id: crypto.randomUUID(), name: "Umpire Admin", amount: 2000 }, + { id: crypto.randomUUID(), name: "Digital", amount: 500 }, + { id: crypto.randomUUID(), name: "Reserve", amount: 3000 }, + { id: crypto.randomUUID(), name: "Trophies", amount: 500 }, ]); - const [teams, setTeams] = useState(12); - const [gamesPerTeam, setGamesPerTeam] = useState(10); - const [umpiresPerGame, setUmpiresPerGame] = useState(2); - const [costPerUmpPerGame, setCostPerUmpPerGame] = useState(70); - const [avgTeamSize, setAvgTeamSize] = useState(12); + const [teams, setTeams] = useState(5); + const [gamesPerTeam, setGamesPerTeam] = useState(28); + const [umpiresPerGame, setUmpiresPerGame] = useState(1); + const [costPerUmpPerGame, setCostPerUmpPerGame] = useState(90); + const [avgTeamSize, setAvgTeamSize] = useState(22); - const [ballsPerGame, setBallsPerGame] = useState(4); - const [costPerDozenBalls, setCostPerDozenBalls] = useState(60); + const [ballsPerGame, setBallsPerGame] = useState(5); + const [costPerDozenBalls, setCostPerDozenBalls] = useState(80); const [startMonth, setStartMonth] = useState(4); const [startWeek, setStartWeek] = useState(1); @@ -136,8 +140,7 @@ export default function BaseballLeagueCostEstimator() { const [endWeek, setEndWeek] = useState(4); const [fields, setFields] = useState([ - { id: crypto.randomUUID(), name: "Main Park #1", pct: 60, costPerGame: 40 }, - { id: crypto.randomUUID(), name: "Riverside #2", pct: 40, costPerGame: 25 }, + { id: crypto.randomUUID(), name: "Field #1", pct: 100, costPerGame: 212 }, ]); const newRound = (i: number): PlayoffRound => ({ @@ -149,8 +152,7 @@ export default function BaseballLeagueCostEstimator() { ballsPerGame: 5, costPerDozenBalls: 70, fields: [ - { id: crypto.randomUUID(), name: "Stadium A", pct: 70, costPerGame: 100 }, - { id: crypto.randomUUID(), name: "Stadium B", pct: 30, costPerGame: 80 }, + { id: crypto.randomUUID(), name: "Field #1", pct: 100, costPerGame: 0 }, ], }); const [playoffRounds, setPlayoffRounds] = useState([newRound(1)]); @@ -444,14 +446,14 @@ export default function BaseballLeagueCostEstimator() { if (f) importFromFile(f); }} /> - - + +
-
+

League Basics

@@ -475,7 +477,7 @@ export default function BaseballLeagueCostEstimator() {
-
+
Opponents per team: {opponentsPerTeam}
Games per opponent (avg): {gamesPerOpponentExact.toFixed(2)}
@@ -485,11 +487,11 @@ export default function BaseballLeagueCostEstimator() { Distribution (as even as possible): each team plays {remainderOpponents} opponents {gamesPerOpponentFloor + 1}× and {opponentsPerTeam - remainderOpponents} opponents {gamesPerOpponentFloor}×.
)} -
Total league games computed as teams × gamesPerTeam ÷ 2.
+
Total league games computed as teams × gamesPerTeam ÷ 2.
-
+

Season Window

@@ -518,22 +520,22 @@ export default function BaseballLeagueCostEstimator() {
-
Approx. season length: {approxWeeks} weeks
-
Games/week per team: {gamesPerWeekPerTeam.toFixed(2)}
-
Games/week league-wide: {gamesPerWeekLeague.toFixed(2)}
-
Games vs each opponent/team: {gamesVsEachOther.toFixed(2)}
+
Approx. season length: {approxWeeks} weeks
+
Games/week per team: {gamesPerWeekPerTeam.toFixed(2)}
+
Games/week league-wide: {gamesPerWeekLeague.toFixed(2)}
+
Games vs each opponent/team: {gamesVsEachOther.toFixed(2)}
-
+

Fields & Game Allocation (Regular Season)

- +
- + @@ -570,7 +572,7 @@ export default function BaseballLeagueCostEstimator() {

Playoffs

- +
@@ -622,7 +624,7 @@ export default function BaseballLeagueCostEstimator() {
- +
Field name % of games Cost per game ($)Totals {totalPct}%
@@ -637,7 +639,7 @@ export default function BaseballLeagueCostEstimator() { })}
-
+
Playoff games (total){playoffTotals.games}
Playoff field costs{currency(playoffTotals.field)}
Playoff baseballs{currency(playoffTotals.balls)}
@@ -647,10 +649,10 @@ export default function BaseballLeagueCostEstimator() {
-
+

Fixed Costs

- +
{fixedCosts.map((fc) => ( @@ -667,8 +669,15 @@ export default function BaseballLeagueCostEstimator() {
-
+

Summary

+
+
Games Per Team{gamesPerTeam}
+
Total League Games{totalGames}
+
Average Games/Week/Team{gamesPerWeekPerTeam.toFixed(2)}
+
League Games/Week{gamesPerWeekLeague.toFixed(2)}
+
League Total Games{totalGames}
+
Umpire costs (regular){currency(umpireCostTotal)}
Umpire costs (playoffs){currency(playoffUmpireCostTotal)}
@@ -680,27 +689,17 @@ export default function BaseballLeagueCostEstimator() {
League costs subtotal{currency(leagueCostsTotal)}
Grand total{currency(grandTotal)}
-
+
Per team to league{currency(costPerTeamLeague)}
Per team to umpires{currency(costPerTeamUmpires)}
Per team (total){currency(costPerTeam)}
Per player (avg team size {avgTeamSize}){currency(costPerPlayer)}
- -
- Notes: -
    -
  • Regular-season league games = teams × games per team ÷ 2.
  • -
  • Field cost = total games × % allocation × per-field cost per game (normalized to 100%).
  • -
  • Playoff rounds accept total games per round. Costs are computed per round then summed.
  • -
  • Autosaves to your browser (localStorage). Use Export for backups or sharing.
  • -
-
-
Built for quick budgeting. Adjust anything and the math updates instantly.
+ ); } diff --git a/src/index.css b/src/index.css index 0b2e018..0514302 100644 --- a/src/index.css +++ b/src/index.css @@ -5,8 +5,6 @@ font-weight: 400; color-scheme: light dark; - color: rgba(255, 255, 255, 0.87); - background-color: #242424; font-synthesis: none; text-rendering: optimizeLegibility; @@ -37,13 +35,14 @@ h1 { } button { + @apply text-white; border-radius: 8px; border: 1px solid transparent; padding: 0.6em 1.2em; font-size: 1em; font-weight: 500; font-family: inherit; - background-color: #1a1a1a; + cursor: pointer; transition: border-color 0.25s; } @@ -53,17 +52,4 @@ button:hover { button:focus, button:focus-visible { outline: 4px auto -webkit-focus-ring-color; -} - -@media (prefers-color-scheme: light) { - :root { - color: #213547; - background-color: #ffffff; - } - a:hover { - color: #747bff; - } - button { - background-color: #f9f9f9; - } -} +} \ No newline at end of file