Eyeva Hero Carousel Widget¶
Description¶
The Eyeva Hero Carousel Widget is a hero banner carousel for the Eyeva theme, using Blaze Slider with video support, random order option, and intersection observer for auto-pause videos.
Page Builder Name: Hero Carousel | PapaThemes Eyeva
Version: 1.0.3
Features¶
- ✅ Blaze Slider (lightweight, no jQuery required)
- ✅ Video support in slides
- ✅ Auto-pause video when out of viewport
- ✅ Random banner order option
- ✅ Pause/play button
- ✅ Responsive breakpoints
- ✅ SVG icon sprites
How to Use¶
1. Add Widget¶
- Open Page Builder
- Drag Hero Carousel | PapaThemes Eyeva widget to the page
- Widget displays carousel
2. Configuration¶
Carousel Settings¶
| Option | Description | Default |
|---|---|---|
| Random Banner Order | Shuffle slide order | false |
| Enable Pagination | Show dots | true |
| Enable Autoplay | Auto-advance | false |
| Autoplay Interval | Time per slide (ms) | 5000 |
| Stop on Interaction | Stop when user interacts | true |
| Transition Duration | Animation time (ms) | 800 |
| Slides to Show | Number of slides visible | 1 |
Blaze Slider Configuration¶
Default Config¶
{
"all": {
"enablePagination": true,
"enableAutoplay": false,
"autoplayInterval": 5000,
"stopAutoplayOnInteraction": true,
"transitionDuration": 800,
"slidesToShow": 1,
"slidesToScroll": 1,
"slideGap": "0px"
},
"(max-width: 800px)": {
"slidesToShow": 1
},
"(max-width: 550px)": {
"slidesToShow": 1
}
}
Video Support¶
Videos in Slides¶
Widget automatically manages video playback:
// Pause all videos on slide change
slider.onSlide(() => {
slider.slides.forEach(slide => {
slide.querySelectorAll('video').forEach(video => video.pause());
});
// Play current slide's video
slider.slides[0].querySelectorAll('video').forEach(video => {
if ($(video).is(':visible')) {
video.play();
}
});
});
Intersection Observer¶
Videos auto-pause when out of viewport:
const observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
if (!entry.isIntersecting) {
entry.target.pause();
} else {
// Play if current slide
video.play();
}
});
});
Random Banner Order¶
When Random Banner Order is enabled:
function shuffleSlides(widgetElement) {
const trackContainer = widgetElement.querySelector('.blaze-track');
const slides = Array.from(trackContainer.children);
// Fisher-Yates shuffle
for (let i = slides.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[slides[i], slides[j]] = [slides[j], slides[i]];
}
slides.forEach(slide => trackContainer.appendChild(slide));
}
- Shuffles on each page load
- Content unchanged, only order
Pause/Play Button¶
$scope.find('.blaze-pause').on('click', (event) => {
if (slider.config.enableAutoplay) {
slider.stopAutoplay();
$scope.addClass('paused');
} else {
slider.startAutoplay();
$scope.removeClass('paused');
}
});
Navigation¶
Navigation Buttons¶
<button class="blaze-prev" aria-label="Previous">
<span class="icon">
<svg><use href="#icon-arrow-left"></use></svg>
</span>
</button>
<button class="blaze-next" aria-label="Next">
<span class="icon">
<svg><use href="#icon-arrow-right"></use></svg>
</span>
</button>
Pagination Dots¶
- Auto-generated by Blaze Slider
- Number of dots = number of slides
Click-to-Navigate Links¶
widgetElement.querySelectorAll('[data-href]').forEach((el) => {
el.addEventListener('click', () => {
if (!editMode) {
window.location = el.dataset.href;
}
});
});
Edit Mode Features¶
In Page Builder Edit Mode: - Video events logged to console - MutationObserver cleanup when widget removed - IntersectionObserver disconnect
Responsive Breakpoints¶
| Breakpoint | Slides | Behavior |
|---|---|---|
| Desktop (>800px) | 1 | Full features |
| Tablet (551-800px) | 1 | Touch swipe |
| Mobile (<550px) | 1 | Optimized touch |
Usage Examples¶
Homepage Hero¶
Promo Carousel with Videos¶
Performance¶
Blaze Slider Benefits¶
- Lightweight (~3KB)
- No jQuery dependency (optional)
- CSS-based animations
- Lazy loading support
Video Optimization¶
- Videos pause when not visible
- Reduces bandwidth usage
- Better battery life on mobile
SVG Icons¶
Widget injects icon sprites:
Icons available: - #icon-arrow-left-long - #icon-arrow-right-long - #icon-pause - #icon-play
Notes¶
- Video formats: Use MP4 with H.264
- Video size: Optimize for web
- Autoplay policies: Browsers may block autoplay
- Random order: Different order each page load
- Mobile: Test video playback on mobile
- Accessibility: Ensure alt text for images