Overview
TheFlipScienceCard component displays a science project preview in an interactive card format. It features:
- Hover animations with glow effects and image scaling
- Project title, description, and cover image
- Action buttons for favorite and share functionality
- “Ver más” (View More) button with gradient styling
- Responsive design with Material-UI components
- Color scheme matching the School Science brand (#15F5BA, #836FFF, #211951)
Props
The project title displayed in the card header
The project description. Automatically truncated to 3 lines with ellipsis overflow
URL or path to the project cover image. Displayed at 200px height with hover zoom effect
Callback function triggered when the favorite (heart) icon is clicked
Callback function triggered when the share icon is clicked
Callback function triggered when the “Ver más” button is clicked. Typically used for navigation to project details
Usage Example
Here’s howFlipScienceCard is used in the Home page to display all science projects:
Component Structure
The component consists of several layers:1. Outer Box (Glow Container)
- Fixed dimensions: 300px width × 420px height
- Default glow:
box-shadow: 0 0 18px rgba(21, 245, 186, 0.35) - Hover glow:
box-shadow: 0 0 28px rgba(21, 245, 186, 0.6) - Hover lift:
transform: translateY(-6px)
2. Card Component
- Background:
#0a192f(dark blue) - Border radius: 16px
- Flex layout with space-between for vertical alignment
3. Image Section
CardMediacomponent with 200px height- Hover zoom:
transform: scale(1.07) - Overlay appears on hover with
#211951background at 35% opacity
4. Content Section
- Title: h5 variant,
#15F5BAcolor, bold - Description: body2 variant, 3-line clamp with 60px fixed height
5. Action Buttons
- “Ver más” button with gradient:
linear-gradient(135deg, #15F5BA, #64ffda) - Hover gradient:
linear-gradient(135deg, #836FFF, #15F5BA) - Icon buttons for favorite (pink) and share (cyan)
Styling Details
Color Palette
| Element | Color | Hex Code |
|---|---|---|
| Card Background | Dark Navy | #0a192f |
| Primary Accent | Cyan | #15F5BA |
| Secondary Accent | Purple | #836FFF |
| Text | Off-white | #F0F3FF |
| Overlay | Deep Purple | #211951 |
| Favorite Icon | Pink | #ff6b81 |
Transitions
All interactive elements use smooth transitions:Customization Tips
The card dimensions (300×420px) are fixed. For responsive behavior, wrap multiple cards in a flex container with
flex-wrap: wrap like the GrupoCartas component in Home.jsx.Material-UI Components Used
Box- Container with hover effectsCard- Main card structureCardContent- Content wrapperCardMedia- Image displayTypography- Text elementsButton- “Ver más” actionIconButton- Favorite and share icons
Icons
Related Components
- ImageCarousel - Used in project detail pages
- TarjetasContenido - Additional content display