How can I transition a gradient using css3? - css

I didn't see anything that really hit on what I'm trying to do. I know that animating gradients used to not be possibly but I think that's changed in the last year or so. Does anyone have any advice about how to move four divs with different background gradients through css3 transitions? I'm trying to create a nighttime to dawn to day gradient transition and can't seem to make it work. Ideally I'd love to do it just with css3 but if I have to use JavaScript or jQuery, that's fine. Also, I'd like to make it happen on load and not need a :hover pseudo class.
Thanks in advance!

Related

CSS Linear gradient borders

I am trying to use a CSS3 Border gradient property and using an example from css tricks. I can get it to work using their example but cant seem to get my colours in that i am after and i think it's syntax errors. Is someone able to let me know what i may be missing?
I am after a left and right border on a div with the gradient going from #d1d2cd to #e3e4df 5 pixels wide?
I have mocked up an example in js fiddle: http://jsfiddle.net/DqgPy/
Thanks
I'd recommend checking out a site like:
http://www.colorzilla.com/gradient-editor/
Play around with the gradient settings, and it will auto-generate the CSS you need (including support for older browsers). At the very least, the code provided might help you figure out any of your syntax errors.

Strange behavior with SVG CSS3 animation

I should preface this by saying that I am brand new to the world of SVGs. I'm playing around with a rather simple experiment using SVGs and CSS3 animations.
I have created the SVG in Inkscape and saved it as a plain SVG. I've then put it into HTML to play around with some CSS3 animations.
As you can see from my link below the whole SVG bounces strangely, this can be removed by removing the .arm class from the CSS. (which stops the single red circle group that has an arm class).
The problem is that I want the red circle groups to animate (spin) whilst the entire larger group is also spinning.
Any ideas or blatant things I may be doing wrong? (I do realize it's not the best SVG but I was just experimenting).
http://codepen.io/Fernker/pen/cwvfB
Note 1: After playing around a bit more if I remove either .arm or .center CSS rules then the wobble stops, but together they produce the wobble.
Here I fixed it for you (kind of).
http://codepen.io/anon/pen/unmfE
Basically I hacked it so it works, but you'll need to wrap your SVG in another container and have that rotate from center. If you animate too far down the nest, it will be affected by siblings.
It looks as though the shape is not creating a perfect circle when spinning, therefore shifting the center whilst spinning causing the wobble.

linear gradient with box-shadow on round button

I'm trying to create a button similar to these http://houseofbuttons.tumblr.com/post/16760351131/starred-checked-action-buttons-by-brendon
and was hoping to do it with just css.
I put together a quick jsfiddle page http://jsfiddle.net/ne69E (but I haven't been able to get it to work, though I do see the round element with the same code without jsfiddle).
Before I spend too much time doing this, I wanted to make sure that it is possible to create a linear gradient over a radial gradient. I tried using the background-image: linear gradient, but that only applies to the div, not the borders.
What do you think? is it possible? Or should I just use images?
Your jsfiddle has a couple errors (you wrote webit instead of webkit and you're using numbers like 4 and 7 with no units), check this updated jsfiddle, and it seems you're not so far off from an effect like the ones on the buttons you want.

can you fade gradients in divs?

I was curious if it's possible to fade from one gradient to another inside a div in css3? I would like to be able to have one gradient start fading into another around the center of the div background.
(for instance, a fade like here http://garyoak.com/images/fade.png )
I know how to do the gradients individually, but i have no idea how to do fade 1 gradeint into a another if it's possible. If it's not possible, is there way to accomplish this effect? I was thinking of stacking two divs on top of each other, each one backed with a different gradient and having the top one fade horizontally, but again I'm not really sure how to do that.
I could combine the gradients into one single horizontal gradient, but i already have all the single colour gradients defined and it'd take quite abit of time to correctly combine them together, especially if i decide to change one of the gradients. I basically just want to avoid having to define and update seperate gradients to fade two existing gradients together.
If someone could help me out/point me to a proper resource to figure this out, I'd appreciate it.
thanks
I just answered a similar question, see here for an example of how to do multiple gradients:
Question about a specific gradient with css3

CSS3 transitions not working on button

I have a relatively complex button that I'm styling with CSS3, it looks and behaves as I intended apart from the transitions are not working. It should fade on hover etc but it's just not working, tested in moz opera and chrome, no luck.
Here's a link to a fiddle http://jsfiddle.net/dsyne/DpsuN/1/
Any help would be appreciated, i've tried many different things. Re-ordering the stack for instance. I'm not sure if the ordering is important with transitions ?
edit:wrong link sorry
Gradients don't support transitions directly yet. You should define your background colors then use a pure alpha gradient that is the same across states to add shading.
Use id to specify transition property instead of class. Worked for me!

Resources