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

Rotate and transform paper-fab icon #6

Open
dominik0711 opened this issue Mar 16, 2017 · 6 comments
Open

Rotate and transform paper-fab icon #6

dominik0711 opened this issue Mar 16, 2017 · 6 comments

Comments

@dominik0711
Copy link

It would be nice to transform paper-fab icon from one image (in closed state) to another (in opened state).

So for example from closed state
closed_state

to opened state

opened_state

@pomber
Copy link
Owner

pomber commented Mar 16, 2017

To support this, maybe we could add a class to the trigger element every time the menu is open and remove the class when the menu is closed. That way anyone can add a css transition, for this case a rotate(45deg) should be enough.
What do you think?

@dominik0711
Copy link
Author

This seems to be a good solution for the example above. But how do you support other kind of image/icon animations? Is a css class sufficient for all kind of animations? E.g. morphing, rotating single lines instead of the whole icon etc.?

@dominik0711
Copy link
Author

dominik0711 commented Mar 17, 2017

Could you please expose the animation duration property as well? Thanks

@dominik0711
Copy link
Author

dominik0711 commented Jun 20, 2017

@pomber To add a class to the element seems to be not sufficient to do the CSS rotate transformation due to the fact that there are 3 paper-fab states:

  1. Initial (no transformation needed)
  2. opened (rotate(45deg) animation)
  3. closed (rotate(-45deg) animation back to initial state)

Am I wrong? I'll tried to use the property active in paper-fab-speed-dialg but without success.

This is my CSS transition code:

paper-fab-speed-dial[active] > paper-fab {
        transition:all 400ms ease-in-out;
        -webkit-transition:all 400ms ease-in-out;
        -moz-transition:all 400ms ease-in-out;
        -o-transition:all 400ms ease-in-out;
        transform: rotate(45deg);
        -webkit-transform: rotate(45deg);
        -moz-transform: rotate(45deg);
        -o-transform: rotate(45deg);
        -ms-transform: rotate(45deg);
}

The problem seems to be the close animation where the rotate(-45deg) transition have to be made.

animated_fab

(After the menu hides the paper-fab-speed-dialer returns to the initial state without animation because I have no CSS selector to create a transistion rotation back to the initial state)

I think the best way would be a function trigger/call either on neon-animation-start or on neon-animation-finish to let the user implement additional animations if needed.
What do you think?

@bennypowers
Copy link
Collaborator

take a look at https://www.webcomponents.org/element/Pupix/adaptive-icon for inspiration

@bennypowers
Copy link
Collaborator

sorry wrong repo (although that one is cool too)

look at this: https://www.webcomponents.org/element/hotforfeature/delightful-icons

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

No branches or pull requests

3 participants