Component overview
TheCatalogo component renders the main product showcase on the homepage. It uses Astro’s built-in Image component for optimized image loading and Tailwind CSS for responsive layouts.
Location: src/components/Catalogo.astro
Product data structure
The catalog features 10 unique handcrafted candles:Bubbles collection
Three size variants with prices ranging from 50 MXN
- Bubbles (chico) - $20.00 MXN
- Bubbles (standard) - $45.00 MXN
- Bubbles (con margarita encima) - $50.00 MXN
Decorative candles
Geometric and spiral designs at $40.00 MXN each
- Geometric - $40.00 MXN
- Spiral - $40.00 MXN
Image handling
All product images are hosted on Vercel Blob Storage for optimal performance:The
Image component from astro:assets automatically optimizes images for different screen sizes and formats.Image configuration
- Width/Height: Fixed at 200x300px for consistency
- Aspect ratio: Square on mobile, 7:8 on extra-large screens
- Object fit:
coverensures images fill the container - Background: Gray placeholder while loading
Layout structure
The catalog uses a responsive CSS Grid:| Breakpoint | Columns | Gap |
|---|---|---|
| Mobile | 1 | 6x (horizontal), 10y (vertical) |
| Small (sm) | 2 | 6x, 10y |
| Large (lg) | 3 | 6x, 10y |
| XL (xl) | 4 | 8x, 10y |
Intersection observer animations
Each product card animates into view when it enters the viewport:Animation breakdown
Initial state
Initial state
scale-50: Product starts at 50% sizeopacity-0: Completely transparent
Animated state (on intersect)
Animated state (on intersect)
intersect:scale-100: Scales to full sizeintersect:opacity-100: Fades to fully visibletransition: Smooth animation
Staggered delays
Staggered delays
Different products have different animation delays for a cascade effect:
Product card structure
Each product card contains:Styling details
- Product name: Small gray text with top margin
- Price: Larger, bold, dark gray text
- Special pricing: Some products use
<b><small>for additional pricing info
Complete component code
Usage in pages
Import and use the catalog component in any Astro page:src/pages/index.astro
Accessibility considerations
- Screen reader only heading: The
sr-onlyclass hides “Productos” visually but keeps it accessible - Alt text: Each image has descriptive alt text for screen readers
- Semantic HTML: Uses proper heading hierarchy (h2, h3) and list structure
Related components
Fragancias
View available fragrance options for all candles
Animations
Learn more about intersection observer animations
