Understanding the Section Pattern
All sections in the portfolio follow a consistent structure:- Component file in
src/components/(e.g.,AboutSection.tsx) - Section wrapper with proper spacing and id
- Motion animations for scroll-based reveals
- Responsive layout using Tailwind CSS
- Integration in
src/pages/Index.tsx
Creating a Projects Section
Let’s create a complete Projects section from scratch.Create the Component File
Create
src/components/ProjectsSection.tsx:src/components/ProjectsSection.tsx
Creating a Testimonials Section
Here’s another example showing a testimonials section:Section Design Patterns
Follow these patterns to maintain consistency:Section Container
Every section should follow this structure:Section Header
Use this pattern for section titles:Card Grid
For grid layouts of cards:Animation Consistency
Stagger Animations
Use staggered delays for lists and grids:i is the item index. This creates a cascading effect.
Scroll-Based Reveals
UsewhileInView for scroll-triggered animations:
Common Animation Patterns
Background Variations
Alternate background colors for visual hierarchy:Adding Section Dividers
The portfolio uses gradient dividers between sections (defined in src/index.css:80-83):src/pages/Index.tsx
Section dividers are optional and should be used between major sections for visual separation.
Complex Layout Example: Services Grid
Here’s a more complex example with a different layout:src/components/ServicesSection.tsx
Best Practices
Do’s
- Use semantic HTML (
<section>,<article>, etc.) - Include unique
idattributes for anchor linking - Follow existing spacing patterns (
py-24 md:py-32) - Use motion animations for scroll reveals
- Keep content width consistent (
max-w-5xlormax-w-6xl) - Use Lucide React icons for consistency
- Include hover states on interactive elements
Don’ts
- Don’t mix different animation styles
- Don’t use arbitrary spacing values
- Don’t skip responsive classes
- Don’t forget accessibility (alt text, ARIA labels)
- Don’t hardcode colors (use theme variables)
Next Steps
Content Customization
Update text, skills, and personal information
Styling
Customize colors, fonts, and visual design