Story Component
The story component displays customer testimonials with circular profile images, text content, and sophisticated hover effects. It’s used in the Stories section to showcase customer experiences with the tour company.Overview
The story component (.story) features:
- Skewed card design for visual interest
- Circular profile image using CSS clip-path
- Shape-outside for text wrapping
- Hover effects revealing name captions
- Image blur and zoom on interaction
HTML Structure
index.html:255
Sass Implementation
sass/components/_story.scss
Component Structure
Container (.story)
Styling:
- Width: 75% of container, centered with
margin: 0 auto - Background: Semi-transparent white (
rgba(white, .6)) - Padding: 6rem on all sides, 9rem on left to accommodate image
- Shadow: Large, soft shadow for depth
- Transform: Skewed -12deg on X-axis for dynamic appearance
Shape Container (.story__shape)
Dimensions:
- Size: 15rem × 15rem square container
- Float: Left to allow text wrapping
shape-outside: Makes text wrap around a circular boundaryclip-path: Clips the image to a circular shape- Result: Perfect circular image with text flowing around it
Image (.story__img)
Default state:
- Scaled to 140% and shifted left for better framing
backface-visibility: hiddenprevents flicker during animation- 0.5s transition for smooth effects
- Zooms out to 100% scale
- Applies 3px blur
- Reduces brightness to 80%
- Creates a “defocus” effect while caption appears
Caption (.story__caption)
Styling:
- Position: Absolutely centered using
absCentermixin - Color: White text
- Transform: Uppercase
- Size: 1.7rem
- Default opacity: 0 (invisible)
Text Content (.story__text)
Counter-skew:
Advanced CSS Techniques
shape-outside
Makes inline text wrap around the circular image shape
clip-path
Clips the rectangular image to a perfect circle
Transform Skew
Skews parent, then counter-skews children for dynamic layout
Filter Effects
Applies blur and brightness for hover interaction
The absCenter Mixin
The caption uses theabsCenter mixin for perfect centering:
sass/abstracts/_mixins.scss
Hover Interaction Timeline
Initial State
- Image is zoomed in (140%) and positioned left
- Caption is invisible (opacity: 0)
- Image is clear and full brightness
User Hovers
- Image zooms out to 100% scale
- Image blurs (3px) and darkens (80% brightness)
- Caption fades in (opacity: 0 → 1)
- All transitions occur over 0.5 seconds
Section Context
The stories section includes a background video layer:index.html:240
Browser Compatibility
Two Story Cards
The section displays two story cards with different customers: Story 1 - Mary Smith:Design Principles
- Skewed aesthetics: Creates visual interest and movement
- Circular imagery: Softens the design, focuses on faces
- Interactive revelation: Caption appears on hover for discovery
- Text wrapping: shape-outside creates natural text flow
- Blur effect: Draws attention to the name when revealed
Performance Considerations
Accessibility
Semantic HTML:- Uses
<figure>and<figcaption>for proper image-caption relationship - Descriptive alt text on images
- Heading hierarchy maintained with
h3
- Caption is hidden by default; ensure critical information isn’t only in caption
- Test with screen readers to ensure caption is announced
Customization Examples
Change skew angle:Related Components
Background Video
Provides animated background for stories section
Composition
Another component using advanced image techniques
absCenter Mixin
Learn about the centering technique used for captions