style(hero): adjust spacing between title, subtitle, and abacus

Reduce gap between title and subtitle from 4 to 2, and add margin
below subtitle to increase space before the abacus for better visual
hierarchy.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock 2025-10-20 14:02:43 -05:00
parent 721dfe426d
commit 3a3706cc6f
1 changed files with 77 additions and 99 deletions

View File

@ -6,32 +6,22 @@ import { css } from '../../styled-system/css'
import { useHomeHero } from '../contexts/HomeHeroContext' import { useHomeHero } from '../contexts/HomeHeroContext'
export function HeroAbacus() { export function HeroAbacus() {
const { subtitle, abacusValue, setAbacusValue, setIsHeroVisible } = useHomeHero() const { subtitle, abacusValue, setAbacusValue, setIsHeroVisible, isAbacusLoaded } = useHomeHero()
const appConfig = useAbacusConfig() const appConfig = useAbacusConfig()
const heroRef = useRef<HTMLDivElement>(null) const heroRef = useRef<HTMLDivElement>(null)
// Dark theme styles for the abacus (matching the mini abacus on homepage) // Styling for structural elements (solid, no translucency)
const darkStyles = { const structuralStyles = {
columnPosts: { columnPosts: {
fill: 'rgba(255, 255, 255, 0.3)', fill: 'rgb(255, 255, 255)',
stroke: 'rgba(255, 255, 255, 0.2)', stroke: 'rgb(200, 200, 200)',
strokeWidth: 2, strokeWidth: 2,
}, },
reckoningBar: { reckoningBar: {
fill: 'rgba(255, 255, 255, 0.4)', fill: 'rgb(255, 255, 255)',
stroke: 'rgba(255, 255, 255, 0.25)', stroke: 'rgb(200, 200, 200)',
strokeWidth: 3, strokeWidth: 3,
}, },
heavenBeads: {
fill: 'rgba(196, 181, 253, 0.8)',
stroke: 'rgba(167, 139, 250, 0.9)',
strokeWidth: 2,
},
earthBeads: {
fill: 'rgba(167, 139, 250, 0.7)',
stroke: 'rgba(139, 92, 246, 0.9)',
strokeWidth: 2,
},
} }
// Detect when hero scrolls out of view // Detect when hero scrolls out of view
@ -53,30 +43,21 @@ export function HeroAbacus() {
return () => observer.disconnect() return () => observer.disconnect()
}, [setIsHeroVisible]) }, [setIsHeroVisible])
// Auto-cycle through random numbers (optional - user can also interact)
useEffect(() => {
const interval = setInterval(() => {
const randomNum = Math.floor(Math.random() * 10000) // 0-9999
setAbacusValue(randomNum)
}, 4000)
return () => clearInterval(interval)
}, [setAbacusValue])
return ( return (
<div <div
ref={heroRef} ref={heroRef}
className={css({ className={css({
minHeight: '100vh', height: '100vh',
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'space-between',
background: background:
'linear-gradient(135deg, rgba(17, 24, 39, 1) 0%, rgba(88, 28, 135, 0.3) 50%, rgba(17, 24, 39, 1) 100%)', 'linear-gradient(135deg, rgba(17, 24, 39, 1) 0%, rgba(88, 28, 135, 0.3) 50%, rgba(17, 24, 39, 1) 100%)',
position: 'relative', position: 'relative',
overflow: 'hidden', overflow: 'hidden',
px: '4', px: '4',
py: '12',
})} })}
> >
{/* Background pattern */} {/* Background pattern */}
@ -91,94 +72,91 @@ export function HeroAbacus() {
})} })}
/> />
{/* Content */} {/* Title and Subtitle Section - DIRECT CHILD */}
<div <div
className={css({ className={css({
position: 'relative', position: 'relative',
textAlign: 'center',
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
alignItems: 'center', alignItems: 'center',
justifyContent: 'space-between', gap: '2',
height: '100%', zIndex: 10,
py: '12',
})} })}
> >
{/* Title and Subtitle Section */} <h1
<div
className={css({ className={css({
display: 'flex', fontSize: { base: '4xl', md: '6xl', lg: '7xl' },
flexDirection: 'column', fontWeight: 'bold',
alignItems: 'center', background: 'linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #fbbf24 100%)',
gap: '4', backgroundClip: 'text',
color: 'transparent',
})} })}
> >
<h1 Abaci One
className={css({ </h1>
fontSize: { base: '4xl', md: '6xl', lg: '7xl' }, <p
fontWeight: 'bold', className={css({
background: 'linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #fbbf24 100%)', fontSize: { base: 'xl', md: '2xl' },
backgroundClip: 'text', fontWeight: 'medium',
color: 'transparent', color: 'purple.300',
})} fontStyle: 'italic',
> marginBottom: '8',
Abaci One })}
</h1> >
<p {subtitle.text}
className={css({ </p>
fontSize: { base: 'xl', md: '2xl' }, </div>
fontWeight: 'medium',
color: 'purple.300',
fontStyle: 'italic',
})}
>
{subtitle.text}
</p>
</div>
{/* Large Interactive Abacus - centered in remaining space */} {/* Large Interactive Abacus - DIRECT CHILD */}
<div
className={css({
position: 'relative',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flex: '1',
width: '100%',
zIndex: 10,
opacity: isAbacusLoaded ? 1 : 0,
transition: 'opacity 0.5s ease-in-out',
})}
>
<div <div
className={css({ className={css({
display: 'flex', transform: { base: 'scale(2)', md: 'scale(3)', lg: 'scale(4)' },
alignItems: 'center', transformOrigin: 'center center',
justifyContent: 'center', transition: 'all 0.5s cubic-bezier(0.4, 0, 0.2, 1)',
flex: '1',
width: '100%',
py: { base: '12', md: '16', lg: '20' },
})} })}
> >
<div <AbacusReact
className={css({ value={abacusValue}
transform: { base: 'scale(2)', md: 'scale(3)', lg: 'scale(4)' }, columns={4}
transformOrigin: 'center center', beadShape={appConfig.beadShape}
transition: 'all 0.5s cubic-bezier(0.4, 0, 0.2, 1)', showNumbers={true}
})} interactive={true}
> animated={true}
<AbacusReact customStyles={structuralStyles}
value={abacusValue} onValueChange={setAbacusValue}
columns={4} />
beadShape={appConfig.beadShape}
showNumbers={true}
customStyles={darkStyles}
/>
</div>
</div> </div>
</div>
{/* Subtle hint to scroll */} {/* Subtle hint to scroll - DIRECT CHILD */}
<div <div
className={css({ className={css({
fontSize: 'sm', position: 'relative',
color: 'gray.400', fontSize: 'sm',
display: 'flex', color: 'gray.400',
flexDirection: 'column', display: 'flex',
alignItems: 'center', flexDirection: 'column',
gap: '2', alignItems: 'center',
animation: 'bounce 2s ease-in-out infinite', gap: '2',
})} animation: 'bounce 2s ease-in-out infinite',
> zIndex: 10,
<span>Scroll to explore</span> })}
<span></span> >
</div> <span>Scroll to explore</span>
<span></span>
</div> </div>
{/* Keyframes for bounce animation */} {/* Keyframes for bounce animation */}