mobify / stencil

DEPRECIATED - The latest Stencil development is currently taking place in the Adaptive.js repo.
MIT License
4 stars 0 forks source link

Loader component #116

Closed avelinet closed 9 years ago

avelinet commented 9 years ago

Another variation of a CSS loader. This one is four horizontal dots that animate. Made with multiple elements.

Status: Ready for review

Reviewers: @nastiatikk @cole-sanderson @mlworks @jeffkamo @ry5n @kpeatt

Minor work todo

jeffkamo commented 9 years ago

Would be great, for added customization, to be able to set how many dots there are.

That way you could use a for loop to generate all the classes, delays and build the animation keyframes.

$loading__numberOfDots: 4 !default;

Note that using the animation-delay does not work as expected (buggy) on older Android devices. On one project, we had to ditch it and resort to building new sets of animation keyframes to simulate the effect. You may want to look into that too.

ry5n commented 9 years ago

I think we can do the number of dots as a different variation. This is a great start. Two little things and this is good to merge:

  1. In visual test index.html, the body needs class="c-fixture-body" otherwise it’s 100% of the viewport.
  2. I think we should remove the unused modifier and sub-component classes.

+1

jeffkamo commented 9 years ago

Oh, I just realized you're using animation delay to achieve your pulsating effect... (oh I forgot I mentioned this earlier above...) this is actually broken on older Android devices. For example, the animation delays actually fire completely at random, and desync across each other.

So instead of having a nice smooth pulsing animation from left to right, you get dots growing and shrinking at the correct rate, but starting at different times from each other.

At the very least, Android 4.1.2 and under.

The solution is very unsatisfying, unfortunately... you have to not use animation delay, and instead create unique keyframes that are basically the same animation, but with the timings shifted to simulate the delay effect...

We've had a few projects that have had to do this already.

ry5n commented 9 years ago

So, this still needs work?

jeffkamo commented 9 years ago

if we want to support 4.1.2 and under, yes. If not, then no.

Thoughts on what platforms we support on Stencil? @ry5n @avelinet @kpeatt

ry5n commented 9 years ago

Gotta be what we support for Adaptive sites. Usually that’s Android 4.0+, iOS 6+ unless I’m mistaken.

avelinet commented 9 years ago

@jeffkamo did you have a project with an example of the keyframes approach?

jeffkamo commented 9 years ago

@avelinet, will send you a PM

yourpalsonja commented 9 years ago

Hey @jeffkamo and @ry5n , @avelinet and I removed the delay and have the dots running on separate animations.

Tested on Android 4.1.1 and it's running well.

avelinet commented 9 years ago

+1 🌟

ry5n commented 9 years ago

@yourpalsonja @avelinet That’s awesome, well done! Can we add a comment explaining why the animation is implemented the way it is (because Android)? Then we’re good to merge!

yourpalsonja commented 9 years ago

@ry5n done!

yourpalsonja commented 9 years ago

Hey all, at the suggestion of @avelinet , I also removed the attribution to https://github.com/tobiasahlin/SpinKit, since our new animation doesn't build on that at all.

ry5n commented 9 years ago

Yay!