Skip to content

Commit 2191291

Browse files
adamintCopilot
andcommitted
Fix worlds section: horizontal scroll with compact cards matching mockup
- Replace Card.Root with plain Box (Card component overrode flex behavior) - Add flexWrap=nowrap, custom scrollbar styling - Compact cards: 140px wide, 1-line truncated text, smaller icons - Reduced heading-to-cards gap Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e6cde94 commit 2191291

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

AspireAcademy.Web/src/pages/HomePage.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ export default function HomePage() {
732732
>
733733
🗺️ Choose Your World
734734
</Heading>
735-
<Text textAlign="center" color="dark.muted" mb="10" maxW="600px" mx="auto">
735+
<Text textAlign="center" color="dark.muted" mb="6" maxW="600px" mx="auto">
736736
{worlds ? `${worlds.length} themed worlds` : 'Themed worlds'} take you from cloud fundamentals to production-ready distributed apps
737737
</Text>
738738

@@ -741,49 +741,51 @@ export default function HomePage() {
741741
gap="3"
742742
overflowX="auto"
743743
pb="2"
744-
maxW="1000px"
745-
mx="auto"
744+
flexWrap="nowrap"
745+
css={{ '&::-webkit-scrollbar': { height: '4px' }, '&::-webkit-scrollbar-thumb': { background: '#2B1260', borderRadius: '2px' } }}
746746
>
747747
{(worlds ?? []).map((w, i) => {
748748
const worldAccents = ['#2DD4BF', '#FBBF24', '#FB7185', '#34D399', '#38BDF8', '#FB923C', '#A78BFA', '#F472B6'];
749749
const accent = worldAccents[i % worldAccents.length];
750750
return (
751-
<Card.Root
751+
<Box
752752
key={w.id}
753753
bg="dark.card"
754754
border="1px solid"
755755
borderColor={accent}
756756
borderRadius="lg"
757757
p="3"
758-
minW="155px"
759-
maxW="155px"
758+
minW="140px"
759+
maxW="140px"
760760
flexShrink={0}
761761
textAlign="center"
762762
cursor="pointer"
763763
transition="all 0.25s"
764764
role="link"
765765
tabIndex={0}
766766
_hover={{
767-
transform: 'scale(1.05) translateY(-4px)',
768-
boxShadow: `0 0 20px ${accent}33`,
767+
transform: 'translateY(-4px)',
768+
boxShadow: `0 0 16px ${accent}33`,
769769
}}
770770
onClick={() => navigate(`/worlds/${w.id}`)}
771771
onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); navigate(`/worlds/${w.id}`); } }}
772772
>
773-
<Text fontSize="28px" mb="1">{w.icon}</Text>
773+
<Text fontSize="24px" mb="1">{w.icon}</Text>
774774
<Text
775775
{...pixelFontProps}
776-
fontSize="8px"
776+
fontSize="7px"
777777
color={accent}
778778
mb="1"
779-
noOfLines={1}
779+
overflow="hidden"
780+
textOverflow="ellipsis"
781+
whiteSpace="nowrap"
780782
>
781783
{w.name}
782784
</Text>
783-
<Text fontSize="9px" color="dark.muted" lineHeight="1.4" noOfLines={1}>
785+
<Text fontSize="9px" color="dark.muted" lineHeight="1.3" overflow="hidden" textOverflow="ellipsis" whiteSpace="nowrap">
784786
{w.description}
785787
</Text>
786-
</Card.Root>
788+
</Box>
787789
);
788790
})}
789791
</Flex>

0 commit comments

Comments
 (0)