@@ -73,6 +73,51 @@ export default function HeroSection() {
7373 } ;
7474 } , [ problems , projects ] ) ;
7575
76+ const prefersReducedMotion =
77+ typeof window !== "undefined" &&
78+ typeof window . matchMedia === "function" &&
79+ window . matchMedia ( "(prefers-reduced-motion: reduce)" ) . matches ;
80+
81+ const [ metricDisplay , setMetricDisplay ] = useState ( {
82+ repositories : prefersReducedMotion ? summary . repositories : 0 ,
83+ problems : prefersReducedMotion ? summary . problems : 0 ,
84+ verified : prefersReducedMotion ? summary . verified : 0 ,
85+ } ) ;
86+
87+ useEffect ( ( ) => {
88+ if ( prefersReducedMotion ) {
89+ setMetricDisplay ( {
90+ repositories : summary . repositories ,
91+ problems : summary . problems ,
92+ verified : summary . verified ,
93+ } ) ;
94+ return undefined ;
95+ }
96+
97+ let frameId = 0 ;
98+ const duration = 950 ;
99+ const start = performance . now ( ) ;
100+
101+ const step = ( now ) => {
102+ const progress = Math . min ( 1 , ( now - start ) / duration ) ;
103+ const eased = 1 - Math . pow ( 1 - progress , 3 ) ;
104+
105+ setMetricDisplay ( {
106+ repositories : Math . round ( summary . repositories * eased ) ,
107+ problems : Math . round ( summary . problems * eased ) ,
108+ verified : Math . round ( summary . verified * eased ) ,
109+ } ) ;
110+
111+ if ( progress < 1 ) {
112+ frameId = window . requestAnimationFrame ( step ) ;
113+ }
114+ } ;
115+
116+ frameId = window . requestAnimationFrame ( step ) ;
117+
118+ return ( ) => window . cancelAnimationFrame ( frameId ) ;
119+ } , [ prefersReducedMotion , summary . problems , summary . repositories , summary . verified ] ) ;
120+
76121 return (
77122 < main className = "home-shell" >
78123 < section className = "hero" id = "home" >
@@ -86,24 +131,41 @@ export default function HeroSection() {
86131 < h4 className = "hero-subtitle" > { profile . name } </ h4 >
87132 < h1 className = "hero-title" > I build web apps that turn learning, coding, and workflows into usable products.</ h1 >
88133 < p className = "hero-description" >
89- I'm a full-stack focused developer building SunilCraft, coding-journal, and
90- product-style tools with React, Node.js, GitHub workflows, and real project systems.
134+ MCA student at Bangalore University building developer tools, portfolio systems, coding workflows, and product-focused web applications with React and Node.js.
91135 </ p >
92- < div className = "hero-actions" >
93- < Link to = "/projects" className = "hero-button" > Explore Work</ Link >
94- < Link to = "/dashboard" className = "hero-button secondary" > Open Dashboard</ Link >
95- < a href = { profile . github } className = "hero-button secondary" target = "_blank" rel = "noreferrer" > GitHub</ a >
136+
137+ < div className = "hero-trust" >
138+ < Badge tone = "accent" > GitHub synced</ Badge >
139+ < Badge tone = "success" > Verified solutions</ Badge >
140+ < Badge > Live coding journal</ Badge >
96141 </ div >
97142
98143 < div className = "hero-stats" aria-label = "Portfolio stats" >
99- < span > < strong > { summary . repositories || "--" } </ strong > Live Repos</ span >
100- < span > < strong > { summary . problems || "--" } </ strong > Problems</ span >
101- < span > < strong > { summary . verified || "--" } </ strong > Verified</ span >
144+ < article className = "hero-stat-card" >
145+ < strong > { metricDisplay . repositories || 0 } </ strong >
146+ < span > Repositories</ span >
147+ </ article >
148+ < article className = "hero-stat-card" >
149+ < strong > { metricDisplay . problems || 0 } </ strong >
150+ < span > Problems Solved</ span >
151+ </ article >
152+ < article className = "hero-stat-card" >
153+ < strong > { metricDisplay . verified || 0 } </ strong >
154+ < span > Verified Solutions</ span >
155+ </ article >
102156 </ div >
103157 </ motion . div >
104158
105159 < div className = "hero-image" >
106- < img src = { HeroPic } alt = "Sunil Kumar K V profile" loading = "eager" />
160+ < div className = "hero-image-card" >
161+ < img src = { HeroPic } alt = "Sunil Kumar K V profile" loading = "eager" />
162+ </ div >
163+ </ div >
164+
165+ < div className = "hero-actions hero-actions-stage" aria-label = "Primary actions" >
166+ < Link to = "/projects" className = "hero-button" > Explore Work</ Link >
167+ < Link to = "/dashboard" className = "hero-button secondary" > Open Dashboard</ Link >
168+ < a href = { profile . github } className = "hero-button secondary" target = "_blank" rel = "noreferrer" > GitHub</ a >
107169 </ div >
108170 </ section >
109171
0 commit comments