Overview
The Sunflower Capital website is a modern Next.js application featuring a unique full-page scrolling experience powered by ReactPageScroller. The architecture emphasizes performance, responsive design, and smooth animations.Tech Stack
Next.js 14
App Router with React Server Components
TypeScript
Type-safe development throughout
Tailwind CSS
Utility-first styling with custom config
ReactPageScroller
Full-page vertical scrolling
Project Structure
Core Dependencies
- Production
- Development
package.json
Application Flow
The main application (src/app/page.tsx) is a client component that manages six distinct full-page sections:
State Management Architecture
The application uses React hooks for state management, with key state variables controlling scroll behavior and UI:src/app/page.tsx
Scroll Control Pattern: Child components (PortfolioTable, Testimonials) receive setters as props to control parent-level scroll behavior when users interact with scrollable content.
Key State Variables
Scroll State
Scroll State
scrollEnabled: Master control for all scrollingscrollUpEnabled: Allows scrolling to previous pagescrollDownEnabled: Allows scrolling to next page- These are passed to ReactPageScroller via
blockScrollUpandblockScrollDown
UI State
UI State
loaded: Controls initial fade-in animationsbreatheEnabled: Enables/disables breathing animation on center flowercurrentPage: Tracks active page index (0-5)
Responsive State
Responsive State
mobile: Detected viareact-device-detectlibrary’sisMobilelg: Breakpoint tracking for viewport width >= 1024px
Layout and Metadata
The root layout (src/app/layout.tsx) provides SEO optimization and analytics:
src/app/layout.tsx
- SEO Features
- Analytics
- Open Graph meta tags for social sharing
- Twitter Card metadata
- Canonical URL definition
- Structured data (JSON-LD) for organization
- Mobile-optimized viewport settings
Custom Theming
The application uses a custom Tailwind configuration with brand-specific colors and typography:Performance Optimizations
Image Optimization
Next.js
<Image> component with quality= for crisp SVGsFont Loading
Preloaded custom fonts to prevent FOUT
Lazy Rendering
renderAllPagesOnFirstRender={true} for instant navigationAnalytics
Vercel Analytics and Google Analytics integration
Component Communication Pattern
Components communicate primarily through props and callbacks:src/app/page.tsx
This pattern allows child components to temporarily disable page scrolling when users are interacting with internal scrollable areas (like the portfolio table).
Next Steps
Page Scrolling
Learn about ReactPageScroller implementation
Responsive Design
Explore mobile and desktop patterns