@@ -51,156 +51,159 @@ export const CustomAnalysisModal: React.FC<Props> = ({ onSubmit, onClose }) => {
5151 } , [ ] )
5252
5353 return (
54- < div
55- className = "absolute inset-0 z-50 flex items-center justify-center px-4 sm:px-6"
56- onClick = { onClose }
57- >
58- < div className = "absolute inset-0 bg-backdrop/80 backdrop-blur-md" />
59- < motion . div
60- initial = { { y : 20 , opacity : 0 } }
61- animate = { { y : 0 , opacity : 1 } }
62- exit = { { y : 20 , opacity : 0 } }
63- transition = { { duration : 0.2 , ease : 'easeOut' } }
64- className = "relative z-10 flex h-[550px] w-full max-w-[620px] flex-col overflow-hidden rounded-md border border-glassBorder bg-glass backdrop-blur-xl"
65- onClick = { ( e ) => e . stopPropagation ( ) }
54+ < >
55+ { /* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */ }
56+ < div
57+ className = "absolute inset-0 z-50 flex items-center justify-center px-4 sm:px-6"
58+ onClick = { onClose }
6659 >
67- < div
68- className = "pointer-events-none absolute inset-0"
69- style = { {
70- background :
71- 'radial-gradient(ellipse 90% 70% at 50% 0%, rgba(239, 68, 68, 0.12) 0%, transparent 65%)' ,
72- } }
73- />
74- < div className = "relative z-10 flex h-full flex-col" >
75- { /* Header */ }
76- < div className = "relative border-b border-glassBorder px-5 py-4" >
77- < div className = "text-center" >
78- < h2 className = "text-xl font-semibold text-white/95" >
79- Custom Analysis
80- </ h2 >
81- < p className = "text-xs text-white/70" >
82- Import a chess game from PGN notation or analyze a specific
83- position using FEN notation
84- </ p >
60+ < div className = "absolute inset-0 bg-backdrop/80 backdrop-blur-md" />
61+ < motion . div
62+ initial = { { y : 20 , opacity : 0 } }
63+ animate = { { y : 0 , opacity : 1 } }
64+ exit = { { y : 20 , opacity : 0 } }
65+ transition = { { duration : 0.2 , ease : 'easeOut' } }
66+ className = "relative z-10 flex h-[550px] w-full max-w-[620px] flex-col overflow-hidden rounded-md border border-glassBorder bg-glass backdrop-blur-xl"
67+ onClick = { ( e ) => e . stopPropagation ( ) }
68+ >
69+ < div
70+ className = "pointer-events-none absolute inset-0"
71+ style = { {
72+ background :
73+ 'radial-gradient(ellipse 90% 70% at 50% 0%, rgba(239, 68, 68, 0.12) 0%, transparent 65%)' ,
74+ } }
75+ />
76+ < div className = "relative z-10 flex h-full flex-col" >
77+ { /* Header */ }
78+ < div className = "relative border-b border-glassBorder px-5 py-4" >
79+ < div className = "text-center" >
80+ < h2 className = "text-xl font-semibold text-white/95" >
81+ Custom Analysis
82+ </ h2 >
83+ < p className = "text-xs text-white/70" >
84+ Import a chess game from PGN notation or analyze a specific
85+ position using FEN notation
86+ </ p >
87+ </ div >
88+ < button
89+ className = "absolute right-4 top-4 text-white/60 transition-colors hover:text-white"
90+ title = "Close"
91+ onClick = { onClose }
92+ >
93+ < span className = "material-symbols-outlined" > close</ span >
94+ </ button >
8595 </ div >
86- < button
87- className = "absolute right-4 top-4 text-white/60 transition-colors hover:text-white"
88- title = "Close"
89- onClick = { onClose }
90- >
91- < span className = "material-symbols-outlined" > close</ span >
92- </ button >
93- </ div >
9496
95- { /* Content */ }
96- < div className = "flex-1 overflow-y-auto px-5 py-4" >
97- < div className = "space-y-5" >
98- { /* Mode selector */ }
99- < div >
100- < label
101- htmlFor = "import-type-selector"
102- className = "mb-1 block text-sm font-medium text-white/80"
103- >
104- Import Type:
105- </ label >
106- < div id = "import-type-selector" className = "flex gap-2" >
97+ { /* Content */ }
98+ < div className = "flex-1 overflow-y-auto px-5 py-4" >
99+ < div className = "space-y-5" >
100+ { /* Mode selector */ }
101+ < div >
102+ < label
103+ htmlFor = "import-type-selector"
104+ className = "mb-1 block text-sm font-medium text-white/80"
105+ >
106+ Import Type:
107+ </ label >
108+ < div id = "import-type-selector" className = "flex gap-2" >
109+ < button
110+ className = { `flex-1 rounded-md border px-4 py-2 text-sm font-medium transition-all ${
111+ mode === 'pgn'
112+ ? 'hover:bg-glass-stronger border-transparent bg-glass-strong text-white'
113+ : 'border-glassBorder bg-glass text-white/80 hover:bg-glass-hover'
114+ } `}
115+ onClick = { ( ) => setMode ( 'pgn' ) }
116+ >
117+ PGN Game
118+ </ button >
119+ < button
120+ className = { `flex-1 rounded-md border px-4 py-2 text-sm font-medium transition-all ${
121+ mode === 'fen'
122+ ? 'hover:bg-glass-stronger border-transparent bg-glass-strong text-white'
123+ : 'border-glassBorder bg-glass text-white/80 hover:bg-glass-hover'
124+ } `}
125+ onClick = { ( ) => setMode ( 'fen' ) }
126+ >
127+ FEN Position
128+ </ button >
129+ </ div >
130+ </ div >
131+
132+ < div >
133+ < label
134+ htmlFor = "analysis-name"
135+ className = "mb-1 block text-sm font-medium text-white/80"
136+ >
137+ Name (optional):
138+ </ label >
139+ < input
140+ id = "analysis-name"
141+ type = "text"
142+ className = "w-full rounded-md border border-glassBorder bg-glass px-3 py-2 text-sm text-white/90 placeholder-white/40 focus:border-white/40 focus:outline-none"
143+ placeholder = "Enter a name for this analysis"
144+ value = { name }
145+ onChange = { ( e ) => setName ( e . target . value ) }
146+ />
147+ </ div >
148+
149+ < div >
150+ < label
151+ htmlFor = "analysis-data"
152+ className = "mb-1 block text-sm font-medium text-white/80"
153+ >
154+ { mode === 'pgn' ? 'PGN Data:' : 'FEN Position:' }
155+ </ label >
156+ < textarea
157+ id = "analysis-data"
158+ className = "h-32 w-full rounded-md border border-glassBorder bg-glass px-3 py-2 font-mono text-sm text-white/90 placeholder-white/40 focus:border-white/40 focus:outline-none"
159+ placeholder = { mode === 'pgn' ? examplePGN : exampleFEN }
160+ value = { input }
161+ onChange = { ( e ) => setInput ( e . target . value ) }
162+ />
163+ < p className = "mt-1 text-xs text-white/60" >
164+ { mode === 'pgn'
165+ ? 'Paste your PGN game notation here. Headers and variations are supported.'
166+ : 'Enter a valid FEN position string. This will set up the board for analysis.' }
167+ </ p >
168+ </ div >
169+
170+ < div className = "flex gap-2" >
107171 < button
108- className = { `flex-1 rounded-md border px-4 py-2 text-sm font-medium transition-all ${
109- mode === 'pgn'
110- ? 'border-transparent bg-glass-strong text-white hover:bg-glass-stronger'
111- : 'border-glassBorder bg-glass text-white/80 hover:bg-glass-hover'
112- } `}
113- onClick = { ( ) => setMode ( 'pgn' ) }
172+ className = "rounded-md border border-glassBorder bg-glass px-3 py-1.5 text-xs text-white/80 transition-colors hover:bg-glass-hover"
173+ onClick = { ( ) =>
174+ setInput ( mode === 'pgn' ? examplePGN : exampleFEN )
175+ }
114176 >
115- PGN Game
177+ Use Example
116178 </ button >
117179 < button
118- className = { `flex-1 rounded-md border px-4 py-2 text-sm font-medium transition-all ${
119- mode === 'fen'
120- ? 'border-transparent bg-glass-strong text-white hover:bg-glass-stronger'
121- : 'border-glassBorder bg-glass text-white/80 hover:bg-glass-hover'
122- } `}
123- onClick = { ( ) => setMode ( 'fen' ) }
180+ className = "rounded-md border border-glassBorder bg-glass px-3 py-1.5 text-xs text-white/80 transition-colors hover:bg-glass-hover"
181+ onClick = { ( ) => setInput ( '' ) }
124182 >
125- FEN Position
183+ Clear
126184 </ button >
127185 </ div >
128186 </ div >
129-
130- < div >
131- < label
132- htmlFor = "analysis-name"
133- className = "mb-1 block text-sm font-medium text-white/80"
134- >
135- Name (optional):
136- </ label >
137- < input
138- id = "analysis-name"
139- type = "text"
140- className = "w-full rounded-md border border-glassBorder bg-glass px-3 py-2 text-sm text-white/90 placeholder-white/40 focus:border-white/40 focus:outline-none"
141- placeholder = "Enter a name for this analysis"
142- value = { name }
143- onChange = { ( e ) => setName ( e . target . value ) }
144- />
145- </ div >
146-
147- < div >
148- < label
149- htmlFor = "analysis-data"
150- className = "mb-1 block text-sm font-medium text-white/80"
151- >
152- { mode === 'pgn' ? 'PGN Data:' : 'FEN Position:' }
153- </ label >
154- < textarea
155- id = "analysis-data"
156- className = "h-32 w-full rounded-md border border-glassBorder bg-glass px-3 py-2 font-mono text-sm text-white/90 placeholder-white/40 focus:border-white/40 focus:outline-none"
157- placeholder = { mode === 'pgn' ? examplePGN : exampleFEN }
158- value = { input }
159- onChange = { ( e ) => setInput ( e . target . value ) }
160- />
161- < p className = "mt-1 text-xs text-white/60" >
162- { mode === 'pgn'
163- ? 'Paste your PGN game notation here. Headers and variations are supported.'
164- : 'Enter a valid FEN position string. This will set up the board for analysis.' }
165- </ p >
166- </ div >
167-
168- < div className = "flex gap-2" >
169- < button
170- className = "rounded-md border border-glassBorder bg-glass px-3 py-1.5 text-xs text-white/80 transition-colors hover:bg-glass-hover"
171- onClick = { ( ) =>
172- setInput ( mode === 'pgn' ? examplePGN : exampleFEN )
173- }
174- >
175- Use Example
176- </ button >
177- < button
178- className = "rounded-md border border-glassBorder bg-glass px-3 py-1.5 text-xs text-white/80 transition-colors hover:bg-glass-hover"
179- onClick = { ( ) => setInput ( '' ) }
180- >
181- Clear
182- </ button >
183- </ div >
184187 </ div >
185- </ div >
186188
187- { /* Actions */ }
188- < div className = "flex gap-3 border-t border-glassBorder px-5 py-4" >
189- < button
190- className = "flex-1 rounded-md border border-glassBorder bg-glass px-4 py-2 text-sm font-medium text-white/80 transition-colors hover:bg-glass-hover"
191- onClick = { onClose }
192- >
193- Cancel
194- </ button >
195- < button
196- className = "flex-1 rounded-md border border-glassBorder bg-glass-strong px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-glass-stronger"
197- onClick = { validateAndSubmit }
198- >
199- Analyze
200- </ button >
189+ { /* Actions */ }
190+ < div className = "flex gap-3 border-t border-glassBorder px-5 py-4" >
191+ < button
192+ className = "flex-1 rounded-md border border-glassBorder bg-glass px-4 py-2 text-sm font-medium text-white/80 transition-colors hover:bg-glass-hover"
193+ onClick = { onClose }
194+ >
195+ Cancel
196+ </ button >
197+ < button
198+ className = "hover:bg-glass-stronger flex-1 rounded-md border border-glassBorder bg-glass-strong px-4 py-2 text-sm font-medium text-white transition-colors"
199+ onClick = { validateAndSubmit }
200+ >
201+ Analyze
202+ </ button >
203+ </ div >
201204 </ div >
202- </ div >
203- </ motion . div >
204- </ div >
205+ </ motion . div >
206+ </ div >
207+ </ >
205208 )
206209}
0 commit comments