From 176f335da0e8ca2c4ed333dc1f11890cdae14223 Mon Sep 17 00:00:00 2001 From: Anthony Correa Date: Thu, 12 Dec 2024 17:05:16 -0600 Subject: [PATCH] Enhance UI - Updated lineup data with new player names. - Added `ButtonGroup` for better organization of game controls. - Modified `GameStateDisplay` to use a `
` for better semantic structure. - Adjusted table sizes and lineup section styling for a more compact display. - Improved button styles, including specialized buttons for unique actions (e.g., home run, double play). - Updated CSS variables for color values and added layout refinements for better responsiveness. - Modified `index.html` theme color to match app's new design scheme. --- public/index.html | 2 +- src/App.js | 48 ++++++++++++++++------ src/App.scss | 65 ++++++++++++++++++++++-------- src/components/GameStateDisplay.js | 8 ++-- 4 files changed, 89 insertions(+), 34 deletions(-) diff --git a/public/index.html b/public/index.html index aa069f2..60c6e38 100644 --- a/public/index.html +++ b/public/index.html @@ -4,7 +4,7 @@ - + ( // Simulate an API call or database query { - away: ["Player A1", "Player A2", "Player A3", "Player A4", "Player A5"], - home: ["Player H1", "Player H2", "Player H3", "Player H4", "Player H5"], + "away": [ + "Jessica Telephone", + "Nagomi Mcdaniel", + "York Silk", + "Tillman Henderson", + "Moody Cookbook", + "Zion Aliciakeyes", + "Jaylen Hotdogfingers" + ], + "home": [ + "Paula Turnip", + "Bees Taswell", + "Sexton Wheerer", + "Milo Brown", + "Eugenia Garbage", + "Justice Spoon", + "Velasquez Alstott" + ] } ); @@ -282,7 +299,7 @@ function App() { const {players, currentBatterIndex} = lineupState[home_or_away]; return ( - +
{players.map((player, index) => ( @@ -405,11 +422,9 @@ function App() { return (
-

Dartball Scorecard

- -
+
Lineup
handleUndo()} disabled={isUndoDisabled}> - - - - + + + + + - - - + + + + + + + + +
diff --git a/src/App.scss b/src/App.scss index 10714a8..879d1c3 100644 --- a/src/App.scss +++ b/src/App.scss @@ -6,18 +6,17 @@ body { } .App { - --dartball-blue: #20438cff; - --dartball-green: #118b48ff; - --dartball-black: #343a39ff; - --dartball-white: #f6fafdff; - --dartball-red: #c63d4eff; - --dartball-gray: #b2aba8ff; - --dartball-orange: #ed5a2eff; - + --dartball-blue: #20438c; + --dartball-green: #118b48; + --dartball-black: #343a39; + --dartball-white: #f6fafd; + --dartball-red: #c63d4e; + --dartball-gray: #b2aba8; + --dartball-orange: #ed5a2e; font-family: 'Oswald'; font-size: 18px; text-align: center; - section, div.gameState { + section { /* padding: 0.5rem; */ margin: 0.5rem; border: black solid; @@ -25,13 +24,32 @@ body { background-color: white; overflow: hidden; header { - font-size: 1.8rem; + font-size: 1.1rem; font-weight: bolder; text-transform: uppercase; border-bottom: black solid; background-color: lightblue; min-height: 1rem; } + &#scoreboard { + header { + display:None; + } + } + &#lineup { + + header { + display: none; + } + .nav-item button{ + @extend .p-1; + @extend .fs-6; + text-transform: uppercase; + } + td { + @extend .p-1; + } + } } .gameLog { @@ -50,25 +68,30 @@ body { } section.play { - background-color: var(--dartball-green); + } .base { - @extend .m-1; + margin:.1rem; border: black solid; - padding: 0.2rem; - width: 1rem; - height: 1rem; + padding: 0.1rem; + width: 0.7rem; + height: 0.7rem; &.occupied { color: white; background-color: red; }} + .btn-group { + @extend .m-1 + } + button.play, div.dropdown { @extend .btn; @extend .btn-lg; @extend .btn-light; - @extend .m-2; + @extend .border; + @extend .border-dark; text-transform: uppercase; font-weight: 800; color: var(--dartball-black); @@ -91,9 +114,19 @@ body { } &.hit{ @extend .btn-light; + @extend .px-3; background-color: var(--dartball-white); border: solid var(--dartball-white); } + &.hit.hr{ + @extend .px-2; + } + &.hit-special{ + @extend .px-1; + background-color: var(--dartball-red); + color: white + + } border: none; } .lineups.nav { diff --git a/src/components/GameStateDisplay.js b/src/components/GameStateDisplay.js index da35032..34eab12 100644 --- a/src/components/GameStateDisplay.js +++ b/src/components/GameStateDisplay.js @@ -15,14 +15,14 @@ function Inning({inning, isTopHalf}){ function GameStateDisplay({inning, bases, isTopHalf, outs, count, score, isFinal }){ return ( -
+
Scoreboard
{!isFinal && (
- {count.balls}-{count.strikes} - {outs} outs + {count.balls}-{count.strikes} + {outs} outs @@ -38,7 +38,7 @@ function GameStateDisplay({inning, bases, isTopHalf, outs, count, score, isFina Away Score: {score.away} Home Score: {score.home} - + ); }