Skip to content

Commit e60b155

Browse files
author
raineer
committed
fix center loading status polygon
1 parent 33bf6e4 commit e60b155

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

‎apps/codebility/app/home/_components/PageLoadingAnimation.tsx‎

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// apps/codebility/app/home/_components/PageLoadingAnimation.tsx
12
"use client";
23

34
import { motion } from "framer-motion";
@@ -80,8 +81,14 @@ export default function PageLoadingAnimation() {
8081
}}
8182
/>
8283

83-
{/* Main content container */}
84-
<div className="relative z-10">
84+
{/*
85+
FIX (CBP-131): Changed from `relative` to `relative flex flex-col items-center gap-8`
86+
so the polygon and the status group stack vertically and center naturally.
87+
Previously, the status group was `absolute` positioned relative to this div,
88+
which was only as wide as the hexagon (128px), causing the wider status content
89+
to overflow rightward ("lower-right drift").
90+
*/}
91+
<div className="relative z-10 flex flex-col items-center gap-8">
8592
{/* Hexagonal container */}
8693
<motion.div
8794
className="relative"
@@ -203,7 +210,7 @@ export default function PageLoadingAnimation() {
203210
</div>
204211
</motion.div>
205212

206-
{/* Matrix-style code rain */}
213+
{/* Matrix-style code rain — kept as absolute so it doesn't affect flex layout */}
207214
<div className="absolute -inset-20 pointer-events-none">
208215
{['01010', '11001', '10110', '00111'].map((code, i) => (
209216
<motion.div
@@ -244,9 +251,14 @@ export default function PageLoadingAnimation() {
244251
))}
245252
</div>
246253

247-
{/* Advanced loading text with typewriter effect */}
254+
{/*
255+
FIX (CBP-131): Removed `absolute -bottom-20 left-1/2 transform -translate-x-1/2`.
256+
Now a normal flex child — centers automatically under the polygon via the
257+
parent's `flex flex-col items-center`. `w-full max-w-xs sm:max-w-sm md:max-w-md`
258+
is preserved for responsive width capping.
259+
*/}
248260
<motion.div
249-
className="absolute -bottom-20 left-1/2 transform -translate-x-1/2 w-full max-w-xs sm:max-w-sm md:max-w-md px-4"
261+
className="w-full max-w-xs sm:max-w-sm md:max-w-md px-4"
250262
initial={{ opacity: 0, y: 20 }}
251263
animate={{ opacity: 1, y: 0 }}
252264
transition={{ delay: 1 }}

0 commit comments

Comments
 (0)