Skip to content

Commit ee55afb

Browse files
fix: coords/files positioning
1 parent a9a0a00 commit ee55afb

File tree

2 files changed

+11
-20
lines changed

2 files changed

+11
-20
lines changed

src/components/Home/Sections/AnalysisSection.tsx

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ const AnalysisChessboard = ({ forceKey }: { forceKey?: number }) => {
7070
ref={containerRef}
7171
className="relative w-full"
7272
style={{
73-
transform: 'translateZ(0)',
7473
aspectRatio: '1/1',
7574
}}
7675
>
@@ -129,16 +128,12 @@ export const AnalysisSection = ({ id }: AnalysisSectionProps) => {
129128
})
130129

131130
const [renderKey, setRenderKey] = useState(0)
132-
const [windowSize, setWindowSize] = useState({ width: 0, height: 0 })
131+
133132
const [currentMaiaModel, setCurrentMaiaModel] = useState('maia_kdd_1500')
134133
const [hoverArrow, setHoverArrow] = useState<DrawShape | null>(null)
135134

136135
useEffect(() => {
137136
const handleResize = () => {
138-
setWindowSize({
139-
width: window.innerWidth,
140-
height: window.innerHeight,
141-
})
142137
setRenderKey((prev) => prev + 1)
143138
}
144139

@@ -239,20 +234,8 @@ export const AnalysisSection = ({ id }: AnalysisSectionProps) => {
239234
<div className="w-full rounded-t-sm bg-background-1/60 p-2 text-left text-sm font-medium text-primary/80">
240235
Spassky, Boris V.
241236
</div>
242-
<div
243-
className="relative w-full"
244-
style={{
245-
aspectRatio: '1/1',
246-
transform: 'translateZ(0)',
247-
}}
248-
>
249-
<div
250-
className="h-full w-full"
251-
style={{
252-
position: 'relative',
253-
transform: 'translateZ(0)',
254-
}}
255-
>
237+
<div className="relative aspect-square w-full">
238+
<div className="aspect-square h-full w-full">
256239
<AnalysisChessboard forceKey={renderKey} />
257240
</div>
258241
</div>

src/styles/tailwind.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,11 @@ svg {
179179
bottom: auto;
180180
height: 0.9rem;
181181
}
182+
183+
.cg-wrap coords.ranks {
184+
top: -4% !important;
185+
}
186+
187+
.cg-wrap coords.files {
188+
left: 4% !important;
189+
}

0 commit comments

Comments
 (0)