Overview
The Catalogo component displays a responsive grid of candle products with images, names, and prices. Each product card features intersection-based animations that trigger when products scroll into view. The grid automatically adjusts from 1 to 4 columns based on screen size.Component code
Props
This component does not accept any props. All products are hardcoded within the component structure.Usage example
Product catalog
The component showcases 10 different candle products:Product list with pricing
Product list with pricing
- Bubbles (chico) - $20.00 MXN
- Bubbles - $45.00 MXN
- Bubbles (con margarita encima) - $50.00 MXN
- Geometric - $40.00 MXN
- Spiral - $40.00 MXN
- Rosa - $35.00 MXN
- Envasada decorada - $85.00 MXN
- Envasada sencilla - $75.00 MXN
- Pino - $50.00 MXN
- Ramo de margarita - 15.00 por margarita extra)
Styling details
Grid layout
Grid layout
The catalog uses CSS Grid with responsive breakpoints:
- Mobile (default): 1 column
- Small screens (sm): 2 columns
- Large screens (lg): 3 columns
- Extra large (xl): 4 columns
- Horizontal gap: 1.5rem (gap-x-6)
- Vertical gap: 2.5rem (gap-y-10)
- XL horizontal gap increases to 2rem (xl:gap-x-8)
Image styling
Image styling
Product images feature:
- Square aspect ratio (
aspect-square) for consistency - Full width within their container
- Rounded corners (
rounded-lg) - Gray background color for loading states
- Object-cover to maintain aspect ratio
- XL screens use 7:8 aspect ratio for taller display
Intersection animations
Intersection animations
Each product card animates into view using intersection observers:
- Initial state: 50% scale and invisible
- When in viewport: Scales to 100% and becomes fully visible
- Transition duration: 500ms to 900ms
- Staggered delays create a cascade effect (delay-200, delay-300, etc.)
Typography
Typography
- Product name (h3): Small text (text-sm), gray-700 color
- Price (p): Large text (text-lg), medium font weight, gray-900 color
- Top margin spacing: 1rem for name, 0.25rem for price
The component includes a visually hidden h2 heading (“Productos”) with
sr-only class for screen reader accessibility.Container structure
- White background (
bg-white) - Centered with auto margins
- Max-width: 672px (max-w-2xl) on mobile, 1280px (max-w-7xl) on large screens
- Responsive padding: 1rem/1.5rem on mobile, increases to 2rem on larger screens
- Vertical padding: 4rem (py-16) on mobile, 6rem (py-24) on small screens and up
Dependencies
- astro:assets: Image component for optimized image loading
- Tailwind CSS: Grid layout, responsive design, and utility classes
- Intersection Observer API: Powers the
intersect:prefix animations - Vercel Blob Storage: Hosts all product images
