Skip to content

Heroe carousel: real horizontal track with translateX, index and swipe navigation#884

Merged
CySSoO merged 1 commit intomasterfrom
cyssoo/fix-hero-carousel-implementation
Jan 29, 2026
Merged

Heroe carousel: real horizontal track with translateX, index and swipe navigation#884
CySSoO merged 1 commit intomasterfrom
cyssoo/fix-hero-carousel-implementation

Conversation

@CySSoO
Copy link
Contributor

@CySSoO CySSoO commented Jan 29, 2026

Motivation

  • The existing Heroe carousel behaved like a static/vertical section and lacked a real horizontal track, index, translate-based movement and proper swipe/trackpad navigation.
  • The goal was to convert the current implementation into a true, controlled horizontal carousel with visible adjacent slides and a prominent central slide.
  • Ensure navigation works via prev/next buttons, touch swipes and trackpad gestures without relying on page vertical scroll.

Description

  • CSS: updated views/css/everblock.css to use a real horizontal track by making .heroe-carousel-track display: flex and adding transition: transform 0.8s ... and will-change: transform, changed .heroe-slide from position: absolute to position: relative with flex: 0 0 100%, and set container overflow to visible to allow adjacent slides to be visible.
  • JS: updated views/js/everblock.js to wire a real index/track movement by selecting the track and applying track.style.transform = 'translateX(-' + (index * 100) + '%)', preserved the is-active/is-next/is-prev state logic, and added guards for missing track.
  • Interaction: added pointer/touch and wheel handlers to support tactile swipes and trackpad horizontal gestures, plus preserved prev/next button behavior and loop handling; the carousel now advances using the index and transform rather than any vertical scroll or absolute-position illusion.

Testing

  • No automated tests were executed for this change.

Codex Task

@CySSoO CySSoO merged commit bb72076 into master Jan 29, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant