Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Matrix animation issue

Tags:

css

matrix

I've tried to create some matrices animation lately. But I noticed something weird. The following code works differently on Firefox, Safari and Chrome :

@-moz-keyframes matrix
{
    from 
    { 
       -moz-transform: matrix(-1.0, 0.0, 0.0, -1.0, 0.0, 0.0);
    }

    to 
    { 
       -moz-transform: matrix(1.0, 2.0, 3.0, 1.0, 0.0, 12.0);
    }
}

@-webkit-keyframes matrix
{
    from 
    { 
        -webkit-transform: matrix(-1.0, 0.0, 0.0, -1.0, 0.0, 0.0);
    }

    to 
    { 
        -webkit-transform: matrix(1.0, 2.0, 3.0, 1.0, 0.0, 12.0);
    }
}

Is there a way to fix this problem ?

like image 429
user2869299 Avatar asked Oct 20 '13 04:10

user2869299


People also ask

What is reverse animation?

The Animation. reverse() method of the Animation Interface reverses the playback direction, meaning the animation ends at its beginning. If called on an unplayed animation, the whole animation is played backwards.

Why is transition property not working?

The reason for this is, display:none property is used for removing block and display:block property is used for displaying block. A block cannot be partly displayed. Either it is available or unavailable. That is why the transition property does not work.

Can you animate transform CSS?

Animating your Transforms When the mouse moves away the animation is reversed, taking each box back to its original state. If you think that's cool, realise that CSS Animation can be applied not just to the transforms, but also to other CSS properties including: opacity, colour and a bunch of others.

Why CSS animation is not working?

Even if you've assigned a keyframes rule to an element, it still may not appear to play if you haven't set an animation-duration. By default, a CSS animation cycle is zero seconds long. To override this, add an animation-duration rule to your targeted element with a seconds value, in the same block as animation-name.


1 Answers

It seems to be just a difference in the way Gecko and Webkit renders the matrix function, which is why they still have the experimental vendor prefixes. I say there is no clean cut way of "fixing" this issue, as it is entirely up to the rendering engine, so you may just have to tinker with the values to get equivalent results.

like image 174
Jace Cotton Avatar answered Sep 29 '22 15:09

Jace Cotton