Giter Site home page Giter Site logo

Animate between two colors about spin.js HOT 2 CLOSED

glennfu avatar glennfu commented on June 11, 2024
Animate between two colors

from spin.js.

Comments (2)

fgnass avatar fgnass commented on June 11, 2024

Unfortunately rgba() colors are not supported in VML and (in contrast to opacity changes) color animations are not hardware-accelerated in current browsers. Anyway, I'll keep your feature request in mind for the next version. In the meantime: What about using {shadow: true, color: '#fff'} as workaround?

from spin.js.

glennfu avatar glennfu commented on June 11, 2024

With shadow, it just looks blurry and then lags like crazy. However, I figured since I'm already manually choosing whether or not to use my dark or light .gif files, I thought I'd just see what it takes to make this work for me.

http://s241.photobucket.com/albums/ff255/Malohkan/Private/?action=view&current=spinners.jpg

You can see that by passing in white or black color at the right time, I can perfectly replicate the effect of the images I'm used to. The only downside is on non-white-or-black backgrounds, but to be honest, for those it's not about replicating the .gif look, because those always looked a bit funny the way they are. So now I think with a bit of tinkering and some input from my design peeps, I might get a nice effect. Just for kicks, I tried white and black with the opposition black and white 1px borders. Not a bad look!

I'm hopeful I'll be able to get this working in a happy way all over my site soon. I'll give it my best shot :) If color animations can't be hardware accelerated, it's probably not even worth bothering considering how much these spinners already tax the CPU. Sure my test has 8 of them running at the same time, and hopefully I'll only ever at most use 2 on a page at once, but still it's a noticeable difference so to lose any more performance might not be worth the bother.

from spin.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.