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

Adding different type of emoji as well? #29

Open
subhendukundu opened this issue May 29, 2020 · 14 comments
Open

Adding different type of emoji as well? #29

subhendukundu opened this issue May 29, 2020 · 14 comments
Labels
good first issue Good for newcomers

Comments

@subhendukundu
Copy link

Hey,
This is a great plug in. I was wondering if we can pass different type of svg or images.
For example hats, circles, emoji etc?
Would this something possible at the moment?

@VincentCATILLON VincentCATILLON added the good first issue Good for newcomers label Jun 1, 2020
@VincentCATILLON
Copy link
Owner

Hi @subhendukundu, thanks for your kind feedback :)
it's a good idea, we could give the assets through a prop called assets for example which can be images or svg.

At this time, it's not developed for, but it could be easy to do it, feel free if you want to contribute. If i have some time, i could propose something that will fit to your needs

@subhendukundu
Copy link
Author

For sure!
I am trying to come up with an architectural design, how to do this.
Also, I was thinking to add something like, Instagram live has, more of an emoji fountain. That would be something amazing to add as well.
What are your thoughts?

@VincentCATILLON
Copy link
Owner

VincentCATILLON commented Jun 1, 2020

I agree it could be nice for users that want to do that.
At this time we got a Confetti component that draws a particle (rounded, or squared, automatic width and height, etc), but position is set into the Cannon component (the main one), that can uses another particle than a confetti, like an asset (image or svg).
So the solution, imho, should be an assets prop than can be fulfilled with images (logos, emojis, etc) or svg as well with the same way, that uses confetti particles drawed by default (like colors prop btw)

@subhendukundu
Copy link
Author

It sounds like a neat solution. Let me play around with it a bit. If I am able to do it, I will create PR :)

@VincentCATILLON
Copy link
Owner

The interface i see for this feature looks like:

import Emoji from 'react-native-emoji';

const Cannon = () => {
  const assets = [
    <Emoji name="coffee" style={styles.emoji} />,
    <Emoji name="smile" style={styles.emoji} />,
    [...]
  ];
  return (
    <ConfettiCannon assets={assets} />
  );
};

@subhendukundu
Copy link
Author

Yup, something like that. But we gotta see, it shouldn’t slow down the app.

@VincentCATILLON
Copy link
Owner

VincentCATILLON commented Jun 1, 2020

yes, and it should not be a dep to the package to be flexible with assets we are using (and not pollute the user project with deps it doesn't need)

@subhendukundu
Copy link
Author

How would you make it as fountain-like Instagram has for live video?

@VincentCATILLON
Copy link
Owner

Do you have a gif or anything else describing what is a fountain like animation ?

@subhendukundu
Copy link
Author

Couldn't find the right one but this would give you an idea.
https://youtu.be/ysdbr5bvZaI

You will see the emojis from down to up.

@VincentCATILLON
Copy link
Owner

VincentCATILLON commented Jun 1, 2020

Thanks for your example 👍

I'm sorry but I think this kind of animation should be done in a dedicated package as it's not the purpose of this one, which is supposed to make an explosion like a confetti cannon does.
But, if your aim is to be able to replace confettis particles by other assets (like we said: images, svg, etc), keeping the same animation flow (explosion like a cannon), it can be done in this repository with pleasure (that I think is a good idea btw)

@subhendukundu
Copy link
Author

Oh yes! That was the goal. Adding images, svg, etc as confetti. I figured it out, will create a PR over this weekend. Also, I was thinking about what else features we can add. Then I remembered this Instagram feature. Let me know if you want to work on this kind of packages as well. I can start working on this, feels a cool thing to start with. Tho kinda confuse how to go about this.

@VincentCATILLON
Copy link
Owner

VincentCATILLON commented Jun 1, 2020

What a cool thing, tell me if you need some help on this idea, or open a draft PR to share comments, or to ask help, i'll try to make the best i can to help you :)

For the other package, yes we can think about it if you want, as it's a good idea (if it's not already done by another package, of course). How i made this one, I put on a paper the animation graphs, separated by steps reached (start, top, and fall) and I chose which easing (react-native documentation) was the best to have a curve representing the best the explosion/fall animation in real life.

For this one, it could be different than it's not separated by steps, but only a kind of inverse rain (which is imo easier than explosion and fall), and should be fulfilled with emojis, programmatically like a timeline can have. On Facebook, if you come after the start, you have a short brief of all emojis that has been sent before, so imo it should be done like this, to be flexible, but it's only my opinion :) maybe we can talk about this in private in a dedicated thread ?

EDIT: We have to make it scalable and virtualize or unmount items which are not displayed (once the item leaves the screen area)

@subhendukundu
Copy link
Author

Umm I did a bit of research. Looks like we can use this and modify to get something like the behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants