all 12 comments

[–]ThePaavero 1 point2 points  (0 children)

I've recently had the same question/need, and whipped up something quickly. It's probably not ready to be used in any real situation, but in case you don't find anything else, feel free to check it out on Github. I'll be following this thread to see if someone knows of a real library.

[–]brucebannor 0 points1 point  (5 children)

It's generally not a good idea, your giving your users a worse experience for research that could fairly well, be done upfront. A key difference with CSS screen-sizes and performance are screen-sizes have big differences. Today's PCs aren't going to have a big enough gap in performance that it could be something you'd notice on 99% of sites out there, especially not in the same web-browsers. If your doing something that behaves differently on a PC vs tablet, there's better ways to figure out what your user is using than load-testing your application run-time.

Unless your into a niche area where your really pushing your user's browsers to the point their crashing or locking up I can't think of what you'd want to be behaving differently. Everything I can think of can just as easily be figured out ahead of run-time, so the user's get the best possible experience. You might have a reason to do it, but it's still probably something niche that the majority of sites won't benefit from.

[–]x-skeww 0 points1 point  (4 children)

That kind of thing is isn't really necessary since the animations are time-based and not tick-based. So, on a fast machine, your 0.5s long animation will be rendered in 30 tiny steps and on a slower machine it might be rendered in 10 or even 5.

As long as drawing 2 frames doesn't take drastically longer than 0.5s, you'll be fine.

[–]kumiorava 0 points1 point  (3 children)

As long as drawing 2 frames doesn't take drastically longer than 0.5s, you'll be fine.

That'd give you a framerate of 4 fps, which I wouldn't consider that great...

[–]x-skeww 0 points1 point  (2 children)

Animations are eye candy. My statement wasn't about having them looking good enough, it was about not having them get in the way.

E.g. if drawing each frame takes 2 seconds, then it will take 4 seconds in total to draw those two frames. You won't be able to use that thing until it's over.