Skip to content

Commit e5aad4d

Browse files
feat: clean up analysis hook + implement opening book value head
1 parent 28d963a commit e5aad4d

8 files changed

Lines changed: 838 additions & 761 deletions

File tree

src/components/Home/HomeHero.tsx

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -171,24 +171,14 @@ export const HomeHero: React.FC<Props> = ({ scrollHandler }: Props) => {
171171
transition={{ duration: 0.4, delay: 0.2, ease: 'easeOut' }}
172172
>
173173
<motion.button
174-
className="flex items-center justify-center gap-2 rounded-md bg-human-3 px-6 py-3 text-white hover:bg-opacity-90"
174+
className="flex items-center justify-center gap-2 rounded-md bg-human-4 px-6 py-3 text-white hover:bg-opacity-90"
175175
onClick={scrollHandler}
176176
whileHover={{ scale: 1.05 }}
177177
whileTap={{ scale: 0.98 }}
178178
transition={{ duration: 0.2 }}
179179
>
180180
<p>Learn More</p>
181-
<motion.i
182-
className="h-4"
183-
animate={{ x: [0, 3, 0] }}
184-
transition={{
185-
repeat: Infinity,
186-
duration: 1.5,
187-
ease: 'easeInOut',
188-
}}
189-
>
190-
{ArrowIcon}
191-
</motion.i>
181+
<i className="h-4">{ArrowIcon}</i>
192182
</motion.button>
193183
{!user?.lichessId && (
194184
<motion.button
@@ -251,26 +241,26 @@ export const HomeHero: React.FC<Props> = ({ scrollHandler }: Props) => {
251241
</div>
252242
</div>
253243
<motion.div
254-
className="flex gap-6"
244+
className="grid grid-cols-3 gap-6 px-2 md:flex"
255245
initial={{ opacity: 0, y: 10 }}
256246
animate={{ opacity: 1, y: 0 }}
257247
transition={{ duration: 0.4, delay: 0.3 }}
258248
>
259-
<p className="text-base text-primary/80">
249+
<p className="text-center text-base text-primary/80">
260250
<AnimatedNumber
261251
value={globalStats?.play_moves_total || 0}
262252
className="font-bold"
263253
/>{' '}
264254
moves played
265255
</p>
266-
<p className="text-base text-primary/80">
256+
<p className="text-center text-base text-primary/80">
267257
<AnimatedNumber
268258
value={globalStats?.puzzle_games_total || 0}
269259
className="font-bold"
270260
/>{' '}
271261
puzzle games solved
272262
</p>
273-
<p className="text-base text-primary/80">
263+
<p className="text-center text-base text-primary/80">
274264
<AnimatedNumber
275265
value={globalStats?.turing_games_total || 0}
276266
className="font-bold"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
export const COLORS = {
2+
good: ['#238b45', '#41ab5d', '#74c476', '#a1d99b', '#c7e9c0'],
3+
ok: ['#ec7014', '#feb24c', '#fed976', '#ffeda0', '#ffffcc'].reverse(),
4+
blunder: ['#cb181d', '#ef3b2c', '#fb6a4a', '#fc9272', '#fcbba1'].reverse(),
5+
}
6+
7+
export const MAIA_MODELS = [
8+
'maia_kdd_1100',
9+
'maia_kdd_1200',
10+
'maia_kdd_1300',
11+
'maia_kdd_1400',
12+
'maia_kdd_1500',
13+
'maia_kdd_1600',
14+
'maia_kdd_1700',
15+
'maia_kdd_1800',
16+
'maia_kdd_1900',
17+
]
18+
19+
export const BLUNDER_THRESHOLD = 0.1 // 10% winrate drop
20+
export const INACCURACY_THRESHOLD = 0.05 // 5% winrate drop
21+
export const GOOD_THRESHOLD = -INACCURACY_THRESHOLD // -0.05 (less than 5% winrate loss)
22+
export const OK_THRESHOLD = -BLUNDER_THRESHOLD // -0.1 (between 5% and 10% winrate loss)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
export * from './useAnalysisController'
2+
export * from './constants'
3+
export * from './utils'
4+
export * from './useEngineAnalysis'
5+
export * from './useMoveRecommendations'
6+
export * from './useBoardDescription'

0 commit comments

Comments
 (0)