Skip to content

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

@Neomas

Description

@Neomas

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

?

Activity

gmrchk

gmrchk commented on Jul 10, 2022

@gmrchk
Owner

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

Neomas commented on Jul 11, 2022

@Neomas
Author

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @gmrchk@Neomas

        Issue actions

          FEAT: The option to add images or videos as a data-attribute · Issue #10 · gmrchk/blobity