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

Add Progress Indicators #632

Merged
merged 14 commits into from
May 13, 2015
Merged

Add Progress Indicators #632

merged 14 commits into from
May 13, 2015

Conversation

castrolol
Copy link
Contributor

Added Progress Indicators:

  • Linear Progress
  • Circular Progress

All with determinate and indeterminate mode.

Issue #592


var sheet = createSheet();

var keyframeTags = [ "@keyframes ", "@-webkit-keyframes "];
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you try using the auto-prefixer? I was wrapping up my version of the progress indicators but it looks like you beat me to it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried using the auto-prefixer but part of creating the rules believe he will not put the prefix in keyframes, any ideas?

Copy link
Member

Choose a reason for hiding this comment

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

@castrolol I used to use keyframes to animate focus ripples. As you found out, there's not an inline equivalent to keyframes (that I know of). I ended up just implementing the animation in js. You can check out the current implementation of focus ripple for inspiration. https://github.com/callemall/material-ui/blob/master/src/ripples/focus-ripple.jsx#L61

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hai-cea @jkruder I thought of doing so, but the performance loss worried me, in my test was very slow with setTimeout when had several elements on the screen.
Do you guys believe that the implementation of a handler for animations is not viable?

Copy link
Member

Choose a reason for hiding this comment

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

@castrolol The performance loss is most likely due applying transition to width and not because of setTimeout. I would recommend using transform scale3D instead. See:
http://blogs.adobe.com/webplatform/2014/03/18/css-animations-and-transitions-performance/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hai-cea So you recommend changing to setTimeout rather than using animation and use scale3D right will change later when I leave the office.

But I found it's nice the way to define the animation

castrolol@3ca8578#diff-0c1cb3bd2e3790000eb7598137a363a7R34

Copy link
Contributor

Choose a reason for hiding this comment

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

My implementation relied on transitionend event. Worked pretty well for the linear progress indicator but fell apart when applied to circular. The circular progress was very jumpy; the animations smoothed it out.

I much prefer using animations when I need to repeat something.You can accomplish this using the transitionend event but 'resetting' the element can be tricky. For the circle, you could try rotate 360 and on transitionend set the rotation to 0 outside of the render method and then get the height (I think height will 'redraw' the element).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jkruder thank you.

I'll do it, I believe it is possible with JS, but I'm still worried the complexity of code reading and performance. Today I will send the adjustments. I wanted to work in the AutoComplete but I saw the need for progress bar to stay nice.

@jkruder
Copy link
Contributor

jkruder commented May 11, 2015

@castrolol General comment: I mean this in the most constructive way; my goal is not to offend you. Before starting work on a feature or resolution of an issue, be sure no one else is already working that feature/issue. This is the second time someone else has worked the same effort; now my development time is essentially wasted. This can be quite frustrating/irritating to some individuals and may turn them away from the open source community (or from supporting a repo) and I ask that you confirm no one has explicitly indicated s/he is working a feature/issue. That being said, your overall approach is similar to the one that I took.

@castrolol
Copy link
Contributor Author

@jkruder I apologize for doing it that way, I'm new on github and still do not have this expertise. I'll pay attention to it, I saw that you were working on it but as I was about 12 days believed had redirected their efforts. I will try to be more communicative. Thank you: D

@jkruder
Copy link
Contributor

jkruder commented May 11, 2015

@castrolol Thanks!

@castrolol
Copy link
Contributor Author

@hai-cea @jkruder I made the changes as we talked, the new way was more simple. In the circular I used SVG.

@hai-cea
Copy link
Member

hai-cea commented May 12, 2015

@castrolol It looks like you're still requiring ./styles/animations in your components.

@castrolol
Copy link
Contributor Author

@hai-cea sorry for the mistake, fixed!

@hai-cea
Copy link
Member

hai-cea commented May 13, 2015

@castrolol Can you sync with master please?

Conflicts:
	src/index.js
@castrolol
Copy link
Contributor Author

@hai-cea it's done!

@troutowicz
Copy link
Contributor

@castrolol Just a friendly tip, but when syncing with upstream you should be rebasing instead of merging. That way you avoid ugly merge commits like Merge branch 'callemall/master'

@castrolol
Copy link
Contributor Author

@troutowicz thanks man! I'm new to github, I work with TFS and confuse me by the similarity of the terms. I'll update me about it

hai-cea added a commit that referenced this pull request May 13, 2015
@hai-cea hai-cea merged commit 10fe929 into mui:master May 13, 2015
@hai-cea
Copy link
Member

hai-cea commented May 13, 2015

Thanks @castrolol 👍

@zannager zannager added the component: progress This is the name of the generic UI component, not the React module! label Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: progress This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants