Skip to content

fix(home): animate the why/flow diagram wire vertically on mobile - #50

Merged
cevheri merged 3 commits into
libredb:mainfrom
silv4b:fix/mobile-diagram-wire
Sep 20, 2026
Merged

cevheri merged 3 commits into
libredb:mainfrom
silv4b:fix/mobile-diagram-wire

Conversation

@silv4b

@silv4b silv4b commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

At widths <=560px the diagram nodes stack vertically, but the connecting diag__wire/diag__line kept animating horizontally. This makes the dashed wire run vertically to match the stacked layout.

Changes

  • src/styles/diagram.css — in the existing max-width: 560px block, restyle .diag__line as a vertical dashed line (lbDashY animation, 180deg gradient).
  • src/components/home/WhySection.astro — success (green) gradient override for .why__card[data-switch-active='3'] .diag__line on mobile.
  • src/components/home/FlowBand.astro — same green override for .flow__card[data-switch-active='in'] .diag__line on mobile.

Also adds .gitattributes to enforce LF line endings across the repo (Windows checkouts were CRLF, which made \prettier --check\ fail in the commit hook).

silv4b and others added 3 commits September 10, 2026 00:18
The mobile rule in diagram.css sets animation-name: lbDashY on a bare
.diag__line. FlowBand's own .flow__card[data-switch-active='in'] .diag__line
outranks it and had already claimed animation-name: lbDashXR for the
right-to-left desktop direction, so in the 'in' state the wire stacked
vertically while its dashes still travelled along X. On a 2px-wide line that
reads as a wire that has stopped.

Restating the axis next to the background-image the same rule already
overrides puts the fix at the specificity it has to win at. WhySection never
set animation-name, so it inherited the vertical one correctly and is
unchanged.

Measured at 390px: all four card states now compute lbDashY and
background-position advances on Y. At 1280px the lines are still horizontal,
lbDashX and lbDashXR as before.
@cevheri

cevheri commented Sep 20, 2026

Copy link
Copy Markdown
Member

Thanks, the stacking fix is right, and I pushed one commit on top of it.

@cevheri
cevheri merged commit 6dea4c7 into libredb:main Sep 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants