Skip to content

Fix spoiler animation overlay and wrapped-line clipping#5

Open
Bharathboy1 wants to merge 1 commit into
shajidhasan:mainfrom
Bharathboy1:main
Open

Fix spoiler animation overlay and wrapped-line clipping#5
Bharathboy1 wants to merge 1 commit into
shajidhasan:mainfrom
Bharathboy1:main

Conversation

@Bharathboy1
Copy link
Copy Markdown

Canvas positioning and DOM management:

  • Particle canvases are now positioned relative to the SpoilerSpan container rather than absolutely on the page, ensuring correct alignment regardless of page scroll or layout changes. All calculations for canvas placement and bounding boxes have been updated to use the container's coordinates. [1] [2] [3] [4] [5]
  • Canvases are now appended to the container div instead of the document body, keeping the DOM cleaner and encapsulating the effect within the component. [1] [2]

TypeScript and code quality improvements:

  • Added non-null assertions (!) to various class properties (such as el, slotElement, containerDiv, etc.) to satisfy TypeScript strict property initialization checks. [1] [2]
  • Improved the type assertion for the container div reference in the JSX render method.

Styling improvements:

  • Added overflow: hidden to the container's CSS to prevent particle effects from spilling outside the spoiler span.
    Improved bounding-box measurement so the effect tracks actual text fragments rather than treating wrapper elements as a full block.
    Updated canvas repositioning logic to stay aligned with the spoiler text during scroll and layout updates.
    Added overflow: hidden to the spoiler host so the effect is clipped to the spoiler’s own inline area.

Note: This is ai fix

Co-authored-by: Copilot <copilot@github.com>
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