GlassCard
A versatile card component with glassmorphism styling and optional hover effects.Features
- Semi-transparent background with backdrop blur
- Optional hover animations (scale, translate, shadow)
- Flexible children composition
- Custom className support
- Consistent rounded corners and padding
Usage
Props
The content to be rendered inside the card
Additional CSS classes to apply to the card. These will be merged with the base classes.
Enable hover animations including scale, translate, and shadow effects
TypeScript Interface
Styling
The GlassCard applies the following base styles:Hover Effect
WhenhoverEffect={true}, the card will:
- Increase background opacity slightly
- Translate upward by 4px (-translate-y-1)
- Add a large shadow with green tint
Examples
Basic Card
Card with Hover Effect
Card with Custom Classes
Real-World Usage from Home Page
Component Location
components/ui/GlassCard.tsx:9
BackgroundBlobs
Decorative background component that adds animated gradient blobs for visual interest.Features
- Fixed positioning covering entire viewport
- Non-interactive (pointer-events-none)
- Multiple colored gradient spheres
- Mix-blend modes for visual effects
- Pulse animation on one blob
- z-index 0 to stay behind content
Usage
Props
This component does not accept any props.Implementation
Blob Details
The component renders three gradient blobs:Blob 1 (Top-Left)
- Color: Zinc gray with 20% opacity
- Size: 384px × 384px (w-96 h-96)
- Position: Top-left corner, offset by -50% in both directions
- Effect:
mix-blend-screenwith 10-second pulse animation
Blob 2 (Bottom-Right)
- Color: Brand green with 10% opacity
- Size: 500px × 500px
- Position: Bottom-right corner, offset by +33% in both directions
- Effect:
mix-blend-screen
Blob 3 (Center)
- Color: Gray with 10% opacity
- Size: 320px × 320px (w-80 h-80)
- Position: Perfectly centered
- Effect:
mix-blend-overlay
Styling Classes
Custom class for styling individual blobs. Should be defined in your CSS with
position: absolute and filter: blur().CSS Requirements
You’ll need to define the.blob class in your global CSS:
Mix Blend Modes
- mix-blend-screen: Brightens the background, useful for light-colored blobs
- mix-blend-overlay: Combines multiply and screen based on background color
Z-Index Layering
The component usesz-0 to ensure it stays behind all content. Make sure your content has a higher z-index:
Pointer Events
Thepointer-events-none class ensures the blobs don’t interfere with user interactions like clicking or hovering.
Animation
The first blob uses Tailwind’sanimate-pulse with a custom duration:
Component Location
components/ui/BackgroundBlobs.tsx:3
Design System Integration
Both UI components follow the VENCOL design system:Color Palette
brand-green: Primary accent color (green)brand-dark: Dark background colorglass-muted: Muted text color for secondary contentwhite/[opacity]: White with various opacity levels
Glass Effects
Theglass-panel class provides the glassmorphism effect:
Common Patterns
- Responsive Spacing: Use Tailwind’s responsive utilities
- Smooth Transitions:
transition-all duration-300 - Rounded Corners:
rounded-2xlorrounded-3xl - Subtle Borders:
border-white/5orborder-white/10
Best Practices
- Use GlassCard for content containers - Provides consistent styling
- Enable hoverEffect on interactive cards - Improves user experience
- Place BackgroundBlobs at app root - Ensures consistent background
- Layer content with z-index - Keep content above decorative elements
- Combine with custom classes - GlassCard’s className prop allows customization