Feature Box Component
The feature box component displays key product features with gradient icons, centered text, and subtle hover animations. It’s used in the Features section to highlight the four main benefits of the tour experience.Overview
The feature box (.feature-box) provides:
- Semi-transparent white background
- Large gradient-colored icon
- Centered text layout
- Lift-on-hover animation
- Consistent shadow and border radius
HTML Structure
index.html:95
Sass Implementation
sass/components/_feature-box.scss
Component Elements
Container (.feature-box)
Styling:
- Background: Semi-transparent white (
rgba(white, .8)) to blend with the skewed background - Padding: 2.4rem for comfortable spacing
- Border radius: 4px for subtle rounded corners
- Box shadow: Soft shadow for depth
- Text align: Center for icon and text
- Cursor: Default (not clickable)
- Transition: 0.3s ease transform for smooth hover
Icon (.feature-box__icon)
Styling:
- Size: 6rem (large, prominent icon)
- Margin: 0.5rem bottom spacing
- Display: Inline-block for proper sizing
- Gradient effect: Linear gradient from light to dark green
- Creates a gradient background
- Clips the background to the text shape
- Makes the text color transparent
- Result: The gradient shows through the text
Text (.feature-box__text)
Standard paragraph text inheriting the component’s center alignment and 1.5rem font size.
Four Feature Boxes
The Features section displays four feature boxes in a row:index.html:94
Hover Effect
When you hover over a feature box:- Translate Y: Lifts the box up by 6px
- Scale: Slightly enlarges to 103% of original size
- Duration: 0.3s ease transition
Icon Font
The icons use a custom icon font (icon-font.css):
icon-basic-world- Globe iconicon-basic-compass- Compass iconicon-basic-map- Map iconicon-basic-heart- Heart icon
Section Context
The feature boxes are displayed on a skewed background section:sass/components/pages/_home.scss
Key CSS Techniques
Gradient Text
Uses background-clip to create gradient-filled text/icons
Semi-transparent BG
rgba() with alpha channel creates glass-like effect
Transform Hover
Combined translateY and scale for engaging interaction
Icon Fonts
Vector icons as fonts for scalability and styling flexibility
Browser Compatibility
The
-webkit-background-clip: text property requires vendor prefix for Safari and older browsers. The code includes both the prefixed and standard versions for maximum compatibility.Design Principles
- Visual hierarchy: Large icons draw attention first
- Readability: Center alignment and generous padding
- Consistency: All four boxes have identical styling
- Feedback: Hover effect provides visual response
- Brand colors: Gradient uses the primary color palette
Customization
To customize feature boxes: Change icon color:Related Components
Cards
Similar hover transforms with scale and translate
Typography
Uses heading-tertiary for the feature titles