"full" transition behavior on Chrome when using rotate3d - css

.item {
transition: transform 1s linear;
transform: rotate3d(0, 0, 0, 0deg);
}
.item:hover {
transform: rotate3d(0, 0, 1, 450deg);
}
In the above example Chrome rotates .item a full 450 degrees. While Firefox, Edge, and Safari rotate between the beginning and end states resulting in a smaller 90 degree rotation.
This only seems to occur with rotate3d. Using rotateZ makes all browsers rotate the full 450.
Guessing this is a bug within Chrome? Does anyone know the spec well enough to confirm?
Demo on CodePen.

Related

3d cube face rotation transform-origin misplaced

I have this 3d cube:
http://codepen.io/caemostajo/pen/yORNvx/
, the front and left faces open when click on the 2nd button.
As you can see the left face is misplaced, i can't place it where it belongs mantaining its open animation. it should look like this: http://www.f-lohmueller.de/pov_tut/backgrnd/im/CubeMappingWrapping_1d_64.gif
i have been trying with diferent translate3D and transform-origin values but no luck, think the problem is with the transform-origin of that face when the button is clicked.
I hope someone can help... best of bests!
To place the left face in the right position try to change the x-axis to -100% in .left-flip selector.
translate3d(-100%, 0, $cubeHeight / 2);
This will close the cube.
._3dface--left{
transform: rotateY(-270deg) translate3d(0%, 0, 75px);
}
To animate the other way do
._3dface--left{
transform: rotateY(90deg) translate3d(0%, 0, 75px);
}
I have changed:
.left-flip {
transition: all 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275);
transform-style: preserve-3d;
transform-origin: (0px) (0px) (-$cubeHeight / 2);
transform: rotateY(-90deg) translate3d(0%, 0, -$cubeHeight / 2);
}
and
#radio-rotate:checked ~ .space3d .left-flip {
transform: rotateY(-180deg) translate3d(0, 0, -$cubeHeight / 2);
}
The result is this

CSS animation Bug in Firefox

I have a CSS animation on a Website to make a hover effect on a button.
In Chrome and IE it lokes fine but in Firefox I got a ugly issue.
some White pieces still standing after hover.
Animation CSS:
.Hotel:hover{
animation-name: pulse;
animation-duration: 1s;
}
#-webkit-keyframes pulse {
from {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
50% {
-webkit-transform: scale3d(100.10, 10.10, 10.10);
transform: scale3d(100.10, 10.10, 10.10);
}
to {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
#keyframes pulse {
from {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
50% {
-webkit-transform: scale3d(1.80, 1.80, 1.80);
transform: scale3d(1.80, 1.80, 1.80);
}
to {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
Everything Looks fine it might be due to hardware acceleration settings not be on
Use hardware acceleration when available turned on .
Currently, browsers like Chrome, FireFox, Safari, IE9+ and the latest
version of Opera all ship with hardware acceleration; they only use it
when they have an indication that a DOM element would benefit from it.
With CSS, the strongest indication is that a 3D transformation is
being applied to an element.Since you have already that done your
then other than hardware acceleration turned on nothing seems to cause problem
its fine in my browser.
In Chrome and Safari we might see a flickering effect when using CSS transforms or animations. The following declarations can be used to fix the issue:
.className{
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-perspective: 1000;
-moz-perspective: 1000;
perspective: 1000;
/* Other transform properties here */
}
Another method that seems to work well in WebKit-powered desktop and mobile browsers is translate3d:
.className{
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
/* Other transform properties here */
}
Native mobile applications also make good use of the device GPU –– that’s why they’re known to perform slightly better than Web apps. Using hardware acceleration can be especially useful on mobile devices because it helps reduce resource consumption on the device.

Safari CSS Bug: Animation Rotation Direction Incorrect?

I'm writing a custom animation for a project I'm working on. The idea is that the animation is meant to resemble an exclamation mark becoming unhinged from the baseline, swinging for a moment, and then falling off the baseline entirely.
For some reason, only Safari (OSX and iOS) refuses to render the first animation keyframe as a clockwise rotation in a CSS animation I've made. Instead, it renders the keyframe as a counter-clockwise animation, but then works just fine for the following animation keyframes.
Working CodePen example: http://codepen.io/michaelmarcialis/pen/obPYPO
#keyframes unhinged {
0% {
transform: rotate(0deg);
}
15% {
transform: rotate(240deg);
}
30% {
transform: rotate(125deg);
}
45% {
transform: rotate(220deg);
}
60% {
transform: rotate(145deg);
}
75% {
opacity: 1;
transform: rotate(200deg);
}
90% {
opacity: 0;
transform: translate(-0.5rem, 8.57142857142857rem) rotate(215deg);
}
95% {
opacity: 0;
transform: translate(0) rotate(0deg);
}
100% {
opacity: 1;
transform: rotate(0deg);
}
}
All other browsers render the animation as intended, with the first animation keyframe rotating clockwise. Safari is the only one that applies a counter-clockwise rotation in the initial keyframe. I'm assuming Safari is doing this because the distance to travel the rotation is shorter when going counter-clockwise, but it's not honoring the CSS spec properly if that's the case.
Does anyone know a remedy for this?
The problem is that if you try to animate a rotate in safari greater than 180 degrees, it will instead rotate the other way. So if you try to rotate +270 degrees, Safari will animate a rotation of -90 degrees.
The workaround for Safari is to never rotate more than 179 in either direction, then complete the rest of the rotation in another segment.

Apply CSS3 Transition To Some Transforms (translate3d) but Not Others (rotate)

I'd like to define a class whose CSS3 transition is only applied to the translate3d transform, and not any other transform (rotate, translate, etc). Is this possible? If so, what's the syntax? Something like this:
.animatedMarker {
transition: transform:translate3d 1s linear;
/* transition is only applied to translate3d transformation, so rotate, translate, etc. won't be animated */
}
You can not transition only translate3d, however you can keep the rest unaltered:
transform: translate3d(0, 0, 0) skew(45deg) rotate(23deg);
and on hover
transform: translate3d(100px, 0, 0) skew(45deg) rotate(23deg);
http://jsfiddle.net/yeuxQ/1/

CSS 3D animation not working correctly in IE11

This animation does not behave as I'd expect it to in IE11.
It should open like a book.
It was created in Google Web Designer (omitted large portions of the code for brevity).
JSFiddle (open in IE11)
However the following DOES work in Chrome (only difference is I've included the WebKit prefixes).
JSFiddle (open in Chrome)
Points of interest:
#keyframes mykeyframes {
0% { transform: translate3d(0px, 0px, 2px); }
100% { transform: matrix3d(-0.9998476952, 0, 0.0174524064, 0, 0, 1, 0, 0, -0.0174524064, 0, -0.9998476952, 0, 0, 0, 2, 1); }
}
Update
Just noticed that if you don't animate it "fully" (so it only swings open part way) then it works fine in IE11 - http://jsfiddle.net/e45q5/3/
Update2
I believe it's related to this bug: https://groups.google.com/forum/#!newtopic/gwdbeta/gwdbeta/EOKnHw5qXmk
I'm not able to debug a matrix3d value, but I can emulate the effect by editing your animation:
#keyframes mykeyframes {
0% { transform: rotateY(0deg); }
100% { transform: rotateY(-180deg); }
}
http://jsfiddle.net/e45q5/2/

Resources