Skip to content

Commit a1bf9db

Browse files
feat: experiment with new design language on home hero
1 parent 50e17e2 commit a1bf9db

6 files changed

Lines changed: 52 additions & 42 deletions

File tree

src/components/Board/BoardController.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const BoardController: React.FC<Props> = ({
6767

6868
const getLast = useCallback(() => {
6969
if (!currentNode) return
70-
70+
7171
let lastNode = currentNode
7272
while (lastNode?.mainChild) {
7373
lastNode = lastNode.mainChild

src/components/Home/HomeHero.tsx

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,17 @@ const FeatureCard: React.FC<FeatureCardProps> = ({
9797

9898
return (
9999
<CardWrapper>
100-
<motion.div
101-
className="flex h-full cursor-pointer select-none flex-row items-center justify-start gap-4 rounded-md border-none bg-background-2 p-4 text-center hover:bg-human-4/20 md:min-h-[140px] md:flex-col md:justify-center md:gap-3"
102-
whileHover={{
103-
scale: 1.03,
104-
boxShadow: '0 4px 12px rgba(0,0,0,0.1)',
105-
transition: { duration: 0.2 },
106-
}}
107-
>
108-
<motion.div className="w-10">{icon}</motion.div>
100+
<div className="group relative flex h-full cursor-pointer select-none flex-row items-center justify-start gap-4 overflow-hidden rounded-xl border border-white/10 bg-black/20 p-4 text-center backdrop-blur-sm transition-all duration-200 hover:border-white/15 hover:bg-black/30 md:min-h-[140px] md:flex-col md:justify-center md:gap-3">
101+
<div className="w-10 text-white/90 group-hover:text-white">{icon}</div>
109102
<div className="flex flex-col items-start md:items-center">
110-
<motion.h2 className="text-lg font-bold">{title}</motion.h2>
111-
<motion.p className="text-xs">{description}</motion.p>
103+
<h2 className="text-lg font-bold text-white/95 group-hover:text-white">
104+
{title}
105+
</h2>
106+
<p className="text-xs text-white/70 group-hover:text-white/80">
107+
{description}
108+
</p>
112109
</div>
113-
</motion.div>
110+
</div>
114111
</CardWrapper>
115112
)
116113
}
@@ -166,33 +163,40 @@ export const HomeHero: React.FC<Props> = ({ scrollHandler }: Props) => {
166163

167164
return (
168165
<Fragment>
166+
<div
167+
className="pointer-events-none absolute inset-0"
168+
style={{
169+
background:
170+
'radial-gradient(ellipse 75% 60% at center top, rgba(239, 68, 68, 0.08) 0%, transparent 60%)',
171+
}}
172+
/>
169173
<BetaBlurb />
170174
<div className="relative flex flex-col items-center justify-center gap-4 overflow-hidden pb-12 pt-4 md:gap-14 md:pb-16 md:pt-20">
171175
<div className="z-10 flex w-full max-w-[1200px] flex-col items-center justify-center gap-10 p-4 text-left md:flex-row md:gap-20">
172176
<div className="flex w-full flex-col items-start justify-center gap-6 md:w-[45%] md:gap-8">
173177
<div className="flex flex-col gap-3 md:gap-4">
174-
<motion.h1 className="whitespace-nowrap text-4xl font-bold leading-tight md:text-5xl">
178+
<motion.h1 className="whitespace-nowrap text-4xl font-bold leading-tight text-white md:text-5xl">
175179
The human chess AI
176180
</motion.h1>
177-
<motion.p className="text-xl text-primary/80 md:text-2xl">
181+
<motion.p className="text-xl text-white/80 md:text-2xl">
178182
Maia is a neural network chess model that captures human style.
179183
Enjoy realistic games, insightful analysis, and a new way of
180184
seeing chess.
181185
</motion.p>
182186
</div>
183187
<motion.div className="flex flex-col gap-4 sm:flex-row">
184188
<motion.button
185-
className="flex items-center justify-center gap-2 rounded-md border border-human-4 bg-human-4/80 px-6 py-3 text-white transition duration-200 hover:bg-human-4"
189+
className="flex items-center justify-center gap-2 rounded-xl border border-white/15 bg-black/30 px-6 py-3 text-white backdrop-blur-sm transition-all duration-200 hover:border-white/25 hover:bg-black/40"
186190
onClick={scrollHandler}
187191
>
188192
<p>Learn More</p>
189-
<span className="material-symbols-outlined text-base text-primary">
193+
<span className="material-symbols-outlined text-base text-white">
190194
keyboard_double_arrow_down
191195
</span>
192196
</motion.button>
193197
{!user?.lichessId && (
194198
<motion.button
195-
className="flex items-center justify-center gap-2 rounded-md border border-background-2 bg-background-1/60 px-6 py-3 transition duration-200 hover:bg-background-1"
199+
className="flex items-center justify-center gap-2 rounded-xl border border-white/10 bg-white/5 px-6 py-3 text-white/90 backdrop-blur-sm transition-all duration-200 hover:border-white/15 hover:bg-white/10 hover:text-white"
196200
onClick={() => {
197201
trackLichessConnectionInitiated('homepage')
198202
connectLichess()
@@ -256,35 +260,35 @@ export const HomeHero: React.FC<Props> = ({ scrollHandler }: Props) => {
256260
</div>
257261
<motion.div className="grid grid-cols-2 gap-6 px-2 md:flex md:gap-6">
258262
{activeUsers > 0 ? (
259-
<p className="text-center text-base text-primary/80">
263+
<p className="text-center text-base text-white/80">
260264
<AnimatedNumber
261265
value={activeUsers}
262-
className="font-bold text-human-2"
266+
className="font-bold text-white"
263267
/>{' '}
264268
recent users
265269
</p>
266270
) : (
267271
<></>
268272
)}
269-
<p className="text-center text-base text-primary/80">
273+
<p className="text-center text-base text-white/80">
270274
<AnimatedNumber
271275
value={globalStats?.play_moves_total || 0}
272-
className="font-bold text-human-2"
276+
className="font-bold text-white"
273277
/>{' '}
274278
moves played
275279
</p>
276-
<p className="text-center text-base text-primary/80">
280+
<p className="text-center text-base text-white/80">
277281
<AnimatedNumber
278282
value={globalStats?.puzzle_games_total || 0}
279-
className="font-bold text-human-2"
283+
className="font-bold text-white"
280284
/>{' '}
281285
puzzles solved
282286
</p>
283287
{activeUsers <= 0 ? (
284-
<p className="text-center text-base text-primary/80">
288+
<p className="text-center text-base text-white/80">
285289
<AnimatedNumber
286290
value={globalStats?.turing_games_total || 0}
287-
className="font-bold text-human-2"
291+
className="font-bold text-white"
288292
/>{' '}
289293
turing games played
290294
</p>
@@ -301,14 +305,17 @@ export const HomeHero: React.FC<Props> = ({ scrollHandler }: Props) => {
301305
function BetaBlurb() {
302306
return (
303307
<div className="mt-2 flex items-center justify-center md:mt-8">
304-
<motion.div className="flex flex-row items-center gap-3 bg-engine-3 p-2 px-6 transition md:mt-0 md:rounded-full">
305-
<span className="material-symbols-outlined material-symbols-filled text-lg">
306-
favorite
307-
</span>
308-
<p>
309-
Maia Chess is in open beta. You now have full access to the platform!
310-
</p>
311-
</motion.div>
308+
<div className="rounded-full border border-white/10 bg-black/20 px-6 py-3 backdrop-blur-sm transition-all duration-200 hover:border-white/15">
309+
<div className="flex flex-row items-center gap-3">
310+
<span className="material-symbols-outlined material-symbols-filled text-lg text-white/90">
311+
favorite
312+
</span>
313+
<p className="text-white/90">
314+
Maia Chess is in open beta. You now have full access to the
315+
platform!
316+
</p>
317+
</div>
318+
</div>
312319
</div>
313320
)
314321
}

src/hooks/useTreeController/useTreeController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const useTreeController = (
66
initialOrientation: Color = 'white',
77
) => {
88
const [currentNode, setCurrentNode] = useState<GameNode | null>(
9-
gameTree?.getRoot() || null
9+
gameTree?.getRoot() || null,
1010
)
1111
const [orientation, setOrientation] = useState<Color>(initialOrientation)
1212

src/pages/turing.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ const Turing: React.FC<Props> = (props: Props) => {
189189
id="turing-page"
190190
className="relative flex aspect-square w-full max-w-[75vh] flex-shrink-0"
191191
>
192-
<GameBoard
193-
game={game}
194-
currentNode={controller.currentNode}
192+
<GameBoard
193+
game={game}
194+
currentNode={controller.currentNode}
195195
orientation={controller.orientation}
196196
/>
197197
</motion.div>
@@ -248,9 +248,9 @@ const Turing: React.FC<Props> = (props: Props) => {
248248
id="turing-page"
249249
className="relative flex aspect-square h-[100vw] w-screen"
250250
>
251-
<GameBoard
252-
game={game}
253-
currentNode={controller.currentNode}
251+
<GameBoard
252+
game={game}
253+
currentNode={controller.currentNode}
254254
orientation={controller.orientation}
255255
/>
256256
</div>

src/styles/tailwind.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ h5 {
4848
flex-direction: column;
4949
width: 100%;
5050
min-height: 100vh;
51-
background-color: rgb(var(--color-backdrop));
51+
background: linear-gradient(135deg, rgb(18, 17, 21) 0%, rgb(22, 21, 25) 50%, rgb(18, 17, 21) 100%);
5252
color: rgb(var(--color-text-primary));
5353
}
5454

tailwind.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ module.exports = {
3939
fontSize: {
4040
xxs: ['0.625rem', { lineHeight: '0.875rem' }],
4141
},
42+
backgroundImage: {
43+
'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
44+
},
4245
},
4346
},
4447
plugins: [require('@tailwindcss/typography')],

0 commit comments

Comments
 (0)