@@ -3,7 +3,6 @@ import React, { Dispatch, SetStateAction, useState } from 'react';
33
44import LinkButton from '../../components/LinkButton' ;
55import { MaterialSymbol } from 'react-material-symbols' ;
6- import NumberInput from '../../components/NumberInput' ;
76
87function Counter ( {
98 value,
@@ -17,12 +16,12 @@ function Counter({
1716 return (
1817 < >
1918 < button
20- className = 'text-md my-2 rounded-l-lg bg-red-400 px-4 py-2 text-zinc-100 active:brightness-75'
19+ className = ' rounded-l-lg bg-red-400 px-4 border py-8 text-zinc-100 active:brightness-75'
2120 onClick = { ( ) => onChange ( value > 0 ? value - 1 : value ) } >
2221 -
2322 </ button >
2423 < button
25- className = 'text-md min-w-55 my-2 rounded-r-lg bg-slate-600 px-3 py-2 text-zinc-100 active:brightness-75'
24+ className = 'rounded-r-lg px-1 text-clip bg-slate-600 border text-zinc-100 active:brightness-75'
2625 onClick = { ( ) => onChange ( value + 1 ) } >
2726 + { children } ({ value } )
2827 </ button >
@@ -48,20 +47,18 @@ function ScoreCalculator() {
4847 const [ Deep , setDeep ] = useState ( 0 ) ;
4948 const [ Shallow , setShallow ] = useState ( 0 ) ;
5049
51- const [ foulPoints , setFoulPoints ] = useState < number | undefined > ( 0 ) ;
52-
5350 const autoPoints = autoLeave * 3 ;
5451 const CoralPoints =
5552 autoCoral1 * 3 + autoCoral2 * 4 + autoCoral3 * 6 + autoCoral4 * 7 + teleCoral1 * 2 + teleCoral2 * 3 + teleCoral3 * 4 + teleCoral4 * 5 ;
56- const AlgaePoints = autoAlgaeProcessor * 6 + teleAlgaeProcessor * 6 + autoAlgaeNet * 4 ; teleAlgaeNet * 4 ;
53+ const AlgaePoints =
54+ autoAlgaeProcessor * 6 + teleAlgaeProcessor * 6 + autoAlgaeNet * 4 + teleAlgaeNet * 4 ;
5755 const cagePoints =
5856 park * 2 + Deep * 12 + Shallow * 6 ;
5957 const totalPoints =
6058 autoPoints +
6159 CoralPoints +
6260 AlgaePoints +
63- cagePoints +
64- ( foulPoints ?? 0 ) ;
61+ cagePoints ;
6562
6663 const handleReset = ( ) => {
6764 setAutoLeave ( 0 ) ;
@@ -80,14 +77,13 @@ function ScoreCalculator() {
8077 setPark ( 0 ) ;
8178 setDeep ( 0 ) ;
8279 setShallow ( 0 ) ;
83- setFoulPoints ( 0 ) ;
8480 } ;
8581
8682 return (
87- < div className = 'flex h-dvh flex-col' >
83+ < div className = 'flex h-dvh flex-col bg-gray-800 ' >
8884 < div className = 'mb-2 bg-gray-800' >
8985 < br />
90- < h1 className = 'mb-4 text-center text-3xl font-bold text-[#48c55c]' >
86+ < h1 className = 'mb-4 text-center text-6xl font-bold text-[#48c55c]' >
9187 Score Calculator
9288 </ h1 >
9389 </ div >
@@ -108,14 +104,14 @@ function ScoreCalculator() {
108104 < div className = 'flex flex-grow flex-col' >
109105 < button
110106 onClick = { handleReset }
111- className = 'text-md col-span-2 mx-2 rounded-md bg-blue-400/70 px-3 py-2 text-black active:brightness-75' >
107+ className = 'text-2xl col-span-2 mx-2 rounded-md bg-blue-400/70 px-3 py-2 text-black active:brightness-75' >
112108 Reset All
113109 </ button >
114- < div className = 'flex flex-grow snap-x snap-mandatory flex-row gap-2 overflow-x-auto p-2 *:flex-shrink-0' >
115- < div className = 'grid w-[calc(100%_-_1rem)] snap-center snap-always auto-rows-fr grid-cols-[auto_1fr] grid-rows-[auto] gap-1 md:w-auto md:flex-grow md:basis-0' >
116- < h2 className = 'col-span-2 text-center text-xl font-bold text-green-600' >
110+ < h2 className = 'text-center text-5xl font-bold text-green-400 my-2' >
117111 Auto
118112 </ h2 >
113+ < >
114+ < div className = 'snap-center flex justify-center gap-2 my-2' >
119115 < Counter value = { autoLeave } onChange = { setAutoLeave } >
120116 Auto Leave
121117 </ Counter >
@@ -131,17 +127,24 @@ function ScoreCalculator() {
131127 < Counter value = { autoCoral4 } onChange = { setAutoCoral4 } >
132128 Auto Coral L4
133129 </ Counter >
134- < Counter value = { autoAlgaeProcessor } onChange = { setAutoAlgaeProcessor } >
130+ </ div >
131+ </ >
132+ < >
133+ < div className = 'snap-center flex justify-center gap-2 my-2' >
134+ < Counter value = { autoAlgaeProcessor } onChange = { setAutoAlgaeProcessor } >
135135 Auto Algae Processor
136136 </ Counter >
137137 < Counter value = { autoAlgaeNet } onChange = { setAutoAlgaeNet } >
138138 Auto Algae Net
139139 </ Counter >
140140 </ div >
141- < div className = 'grid w-[calc(100%_-_2rem)] snap-center snap-always auto-rows-fr grid-cols-[auto_1fr] grid-rows-[auto] gap-1 md:w-auto md:flex-grow md:basis-0' >
142- < h2 className = 'col-span-2 text-center text-xl font-bold text-green-600 ' >
141+ </ >
142+ < h2 className = 'col-span-2 text-center text-5xl font-bold text-green-400 my-2 ' >
143143 Teleop
144- </ h2 >
144+ </ h2 >
145+ < >
146+ < div className = 'snap-center flex justify-center my-2 gap-2' >
147+
145148 < Counter value = { teleCoral1 } onChange = { setTeleCoral1 } >
146149 Tele Coral L1
147150 </ Counter >
@@ -154,22 +157,23 @@ function ScoreCalculator() {
154157 < Counter value = { teleCoral4 } onChange = { setTeleCoral4 } >
155158 Tele Coral L4
156159 </ Counter >
157-
160+ </ div >
161+ </ >
162+ < >
163+ < div className = 'snap-center flex justify-center gap-2 my-2' >
158164 < Counter value = { teleAlgaeProcessor } onChange = { setTeleAlgaeProcessor } >
159165 Tele Algae Processor
160166 </ Counter >
161-
162- < Counter
163- value = { teleAlgaeNet }
164- onChange = { setTeleAlgaeNet } >
167+ < Counter value = { teleAlgaeNet } onChange = { setTeleAlgaeNet } >
165168 Tele Algae Net
166169 </ Counter >
167- </ div >
168-
169- < div className = 'grid w-[calc(100%_-_1rem)] snap-center snap-always auto-rows-fr grid-cols-[auto_1fr] grid-rows-[auto] gap-1 md:w-auto md:flex-grow md:basis-0' >
170- < h2 className = 'col-span-2 text-center text-xl font-bold text-green-600' >
170+ </ div >
171+ </ >
172+ < h2 className = 'col-span-2 my-2 text-center text-5xl font-bold text-green-400' >
171173 Endgame
172- </ h2 >
174+ </ h2 >
175+ < div className = 'snap-center flex justify-center text-3xl my-2 gap-2' >
176+
173177 < Counter value = { park } onChange = { setPark } >
174178 Park
175179 </ Counter >
@@ -183,54 +187,43 @@ function ScoreCalculator() {
183187 </ div >
184188 </ div >
185189
186- < div className = 'col-span-2 grid grid-cols-2 justify-center gap-2 bg-slate-200 p-3 ' >
187- < p className = 'text-black-100 text-md rounded-md border-green-800 bg-green-400/70 px-3 py-2 text-center' >
190+ < div className = 'col-span-2 grid grid-cols-2 justify-center gap-2 py-2 bg-gray-800 ' >
191+ < p className = 'text-black-100 text-md rounded-md border-green-800 bg-green-400 px-3 py-2 text-center' >
188192 Leave:{ ' ' }
189193 < span className = 'rounded-lg bg-black/15 p-2 py-1' >
190194 { autoPoints }
191195 </ span >
192196 </ p >
193197
194198 < p
195- className = { ` text-black-100 text-md rounded-md border-green-800 bg-green-400/70 px-3 py-2 text-center` } >
199+ className = { ` text-black-100 text-md rounded-md border-green-800 bg-green-400 px-3 py-2 text-center` } >
196200 Coral:{ ' ' }
197201 < span className = 'rounded-lg bg-black/15 p-2 py-1' >
198202 { CoralPoints }
199203 </ span >
200204 </ p >
201205
202- < p className = 'text-black-100 text-md rounded-md border-green-800 bg-green-400/70 px-3 py-2 text-center' >
206+ < p className = 'text-black-100 text-md rounded-md border-green-800 bg-green-400 px-3 py-2 text-center' >
203207 Algae:{ ' ' }
204208 < span className = 'rounded-lg bg-black/15 p-2 py-1' >
205209 { AlgaePoints }
206210 </ span >
207211 </ p >
208212
209- < p className = 'text-black-100 text-md rounded-md border-green-800 bg-green-400/70 px-3 py-2 text-center' >
210- Cage :{ ' ' }
211- < span className = 'rounded-lg bg-black/15 p-2 py-1 ' >
213+ < p className = 'text-black-100 text-md rounded-md border-green-800 bg-green-400 px-3 py-2 text-center' >
214+ Barge :{ ' ' }
215+ < span className = 'rounded-lg bg-black/15 p-2 py-2 ' >
212216 { cagePoints }
213217 </ span >
214218 </ p >
215-
216- < p className = 'text-black-100 text-md rounded-md border-green-800 bg-green-400/70 px-3 py-2 text-center' >
217- Foul Points:{ ' ' }
218- < NumberInput
219- className = 'w-16 rounded-lg bg-black/15 p-2 py-1 text-center'
220- value = { foulPoints }
221- onChange = { setFoulPoints }
222- />
223- </ p >
224-
225- < p className = 'text-black-100 text-md rounded-md border-green-800 bg-green-400/70 px-3 py-2 text-center font-black' >
219+ </ div >
220+ < p className = 'text-black-100 text-md rounded-md border-green-800 bg-green-400/70 px-3 py-2 text-center font-black' >
226221 Total:{ ' ' }
227222 < span className = 'rounded-lg bg-black/15 p-2 py-1' >
228223 { totalPoints }
229224 </ span >
230225 </ p >
231- </ div >
232226 </ div >
233- </ div >
234227 ) ;
235228}
236229
0 commit comments