Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement optional overlay on top of the spot #135

Closed
wants to merge 1 commit into from
Closed

Implement optional overlay on top of the spot #135

wants to merge 1 commit into from

Conversation

ruibinch
Copy link

Was using this package at work and there was an additional use case to have an overlay on top of the "spotlight area" to improve the contrast with the background - I made a patch file to support this and figured to open a PR here too.

Thanks for this great package!

{spotOverlayProps &&
<ShapeMask
spot={spot}
setReference={refs.setReference}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure on the use case of setReference, maybe could be removed for this overlay

@JoseLion
Copy link
Member

@ruibinch, sorry for the late response. I'm glad you're finding this package helpful!

I'm not sure if I understood the use case correctly. The idea is to have:

a) The backdrop of one color and the spot shape of another color. b) No backdrop and the spot shape of some specific color.

We can easily achieve option b) if we invert the colors of the SVG mask. However, for option a), we have to render and animate an additional shape on top of the mask (current solution).

Let me know if option b) covers your use case. Otherwise, we can go with the current approach, but we'll need to make a few adjustments. Thanks a lot for your contribution 🎉

@ruibinch ruibinch closed this by deleting the head repository Jul 28, 2024
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