Skip to content

fix: overlay now renders above animation canvas for proper text contrast#93

Open
DennisGaida wants to merge 1 commit into
teuchezh:devfrom
DennisGaida:fix/overlay-z-index-layering
Open

fix: overlay now renders above animation canvas for proper text contrast#93
DennisGaida wants to merge 1 commit into
teuchezh:devfrom
DennisGaida:fix/overlay-z-index-layering

Conversation

@DennisGaida
Copy link
Copy Markdown
Contributor

The overlay_opacity config option had no visible effect on the weather animation. Setting it to 1.0 would darken the background gradient but leave the animated canvas completely unaffected, making text just as hard to read as without any overlay.

Description

The dark overlay is implemented as a ::before pseudo-element on .weather-card. It was assigned z-index: 0, but .canvas-container (the animation canvas) had no explicit z-index set hence having both at the same level and pretty much no overlay. Overlay was actually behind the animation.

Adjusted the stacking order so the overlay sits between the animation canvas and the text content.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Translation

Related Issues

Fixes #

Checklist

  • Code follows project style
  • Self-reviewed code
  • Tested locally
  • bun run lint passed
  • bun run typecheck passed
  • bun run build successful
  • Commits follow Conventional Commits

The ::before overlay pseudo-element was at z-index 0 with no explicit
z-index on .canvas-container, causing the canvas to paint on top of the
overlay in DOM order. Setting canvas-container to z-index 0, overlay to
z-index 1, and content to z-index 2 ensures the dark overlay sits between
the animation and the text, making overlay_opacity actually affect text
readability.
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.

1 participant