Skip to content

Conversation

@CySSoO
Copy link
Contributor

@CySSoO CySSoO commented Jan 29, 2026

Motivation

  • Ensure arrow clicks shift the heroe carousel by exactly one slide instead of centering math that could cause multi-slide jumps.
  • Respect the block data-loop setting and surface arrow availability for predictable non-loop behavior.

Description

  • Change slide translation math in updateSlides() to align to index * slideWidth and clamp it with maxOffset so each arrow click moves one slide width.
  • Introduce loop = carousel.dataset.loop !== '0' and add updateNavState() to enable/disable previous/next buttons and set aria-disabled appropriately when not looping.
  • Prevent wrapping in goNext()/goPrev() when loop is false and compute .is-prev/.is-next classes separately for loop vs non-loop modes.
  • Templating and style tweaks: remove a redundant inline background from the block template and make arrow icon color use currentColor while removing some hardcoded background/colors in the carousel CSS.

Testing

  • Started a local PHP dev server with php -S 0.0.0.0:8000 -t ., which started successfully.
  • Attempted a Playwright screenshot to verify rendering, but the headless Chromium process crashed in this environment and the screenshot run failed.
  • No other automated tests were executed in this rollout.

Codex Task

@CySSoO CySSoO merged commit 8e40b5a into master Jan 29, 2026
2 of 6 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.

2 participants