html - Perspective 3D animation flickering in Firefox -
i'm trying create 3d css effect of door swinging opening , shutting. have codepen animation work it:
http://codepen.io/caleuanhopkins/pen/dslpv
here's css:
.frame--realistic { perspective: 20em; } .door { height: inherit; background: darksalmon; } .frame { margin: .5em auto; border: solid 1em saddlebrown; width: 500px; height: 6.5em; } .door--open { -webkit-transform-origin: 0 0 /*whatever y value wish*/; -moz-transform-origin: 0 0 /*whatever y value wish*/; -ms-transform-origin: 0 0 /*whatever y value wish*/; -o-transform-origin: 0 0 /*whatever y value wish*/; transform-origin: 0 0 /*whatever y value wish*/; -webkit-transform: rotatey(-45deg); -moz-transform: rotatey(-45deg); -ms-transform: rotatey(-45deg); -o-transform: rotatey(-45deg); transform: rotatey(-45deg); } @-webkit-keyframes doorani { { -webkit-transform: rotatey(0deg); } { -webkit-transform: rotatey(20deg); } } .frame:hover .door--ani { -webkit-transform-origin: 0 0; -moz-transform-origin: 0 0; -ms-transform-origin: 0 0; -o-transform-origin: 0 0; transform-origin: 0 0; -moz-animation: doorani 1s 1 normal forwards; -webkit-animation: doorani 1s 1 normal forwards; -ms-animation: doorani 1s 1 normal forwards; -o-animation: doorani 1s 1 normal forwards; animation: doorani 1s 1 normal forwards; } @-webkit-keyframes doorout { { -webkit-transform: rotatey(20deg); } { -webkit-transform: rotatey(0deg); } } @keyframes doorani { { -moz-transform: rotatey(0deg); -ms-transform: rotatey(0deg); -o-transform: rotatey(0deg); transform: rotatey(0deg); } { -moz-transform: rotatey(20deg); -ms-transform: rotatey(20deg); -o-transform: rotatey(20deg); transform: rotatey(20deg); } } @keyframes doorout { { -moz-transform: rotatey(20deg); -ms-transform: rotatey(20deg); -o-transform: rotatey(20deg); transform: rotatey(20deg); } { -moz-transform: rotatey(0deg); -ms-transform: rotatey(0deg); -o-transform: rotatey(0deg); transform: rotatey(0deg); } } .door--ani { -webkit-transform-origin: 0 0; -moz-transform-origin: 0 0; -ms-transform-origin: 0 0; -o-transform-origin: 0 0; transform-origin: 0 0; -moz-animation: doorout 1s 1 normal forwards; -webkit-animation: doorout 1s 1 normal forwards; -ms-animation: doorout 1s 1 normal forwards; -o-animation: doorout 1s 1 normal forwards; animation: doorout 1s 1 normal forwards; }
and html:
<div class='container'> <div class='frame frame--realistic'> <div class='door door--ani'> </div> </div> </div>
however, main issue when door swings after have hovered on door. there slight flicker before animation finishes. have idea why doing , if there's can change/add fix issue?
update: code not running webkit browsers, have updated code issues of flickering still appears in firefox.
Comments
Post a Comment