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

FEAT: The option to add images or videos as a data-attribute #10

Open
Neomas opened this issue May 19, 2022 · 2 comments
Open

FEAT: The option to add images or videos as a data-attribute #10

Neomas opened this issue May 19, 2022 · 2 comments

Comments

@Neomas
Copy link

Neomas commented May 19, 2022

I'm looking for the option to add images or videos inside the blob. This way they could show on hover in a similar way as the tooltips do. Is this something that might be possible

Screenshot 2022-05-19 at 10 22 45

?
@gmrchk
Copy link
Owner

gmrchk commented Jul 10, 2022

Super interesting use case! I think that should be possible to add. Could you clarify how would you like such a feature to work, and what would be the appropriate API for you?

I think the best would be to use Blobity's JS API to achieve such behavior, where you could set a specific image/video on the blob by calling something like below when you enter specific element, or whenever really:

blobity.setMedia([url here, or maybe some better reference to the media]);

and later

blobity.resetMedia();

to get rid of the image and fall back to the original color.

It could also be done with the data attributes like data-blobity-media, but there is much less space for any additional settings like the positioning of the image/video, or stuff like that.

Would that work, or do you have some more requirements in mind for this feature?

@Neomas
Copy link
Author

Neomas commented Jul 11, 2022

I think using setMedia() and resetMedia() would be a clean way to implement it.
It would be handy to be able to use setMedia() for setting the media and only showing it when there's a 'data-blobity-media' tag on an element, similar to data-blobity-magnetic.

Having separate options for when the media shows might be interesting too. (size, blending mode, object positioning, object fit, ...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants