CSS3 Transform Translate3D IE10 - css

according to IE 10's supported technologies what I am trying to accomplish should be working, but I cannot figure out what is going on. in firefox and chrome it works just like it should, but in IE10 it is rendered incorrectly.
I have exhausted IE's support doc's, and like I said, this should be working.
here is the JS Fiddle [JSFiddle]: http://jsfiddle.net/qzDV3/1/
body
{
background-color:Blue;
overflow:hidden;
}
#tumble
{
position:absolute;
top:70%;
left:5%;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transition: all 1s;
-moz-transition: all 1s;
transition: all 1s;
}
#tumble.tumble
{
left:100%;
top:85%;
-webkit-transform:rotate3d(1, -1, 1, 256deg);
-moz-transform:rotate3d(1, -1, 1, 256deg);
transform:rotate3d(1, -1, 1, 256deg);
}
.box
{
position:absolute;
top:0%;
left:0%;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transform:rotate3d(1, 1, 1, -30deg);
-moz-transform:rotate3d(1, 1, 1, -30deg);
transform:rotate3d(1, 1, 1, -30deg);
-webkit-transition: all .5s;
-moz-transition: all .5s;
transition: all .5s;
}
.box.rotate
{
-webkit-transform:rotate3d(1, -1, 1, 256deg);
-moz-transform:rotate3d(1, -1, 1, 256deg);
transform:rotate3d(1, -1, 1, 256deg);
}
.front, .back
{
top:0;
left:0;
}
.front
{
-webkit-transform: translate3d(0,0,100px);
-moz-transform: translate3d(0,0,100px);
transform: translate3d(0,0,100px);
}
.back
{
-webkit-transform: translate3d(0,0,-100px);
-moz-transform: translate3d(0,0,-100px);
transform: translate3d(0,0,-100px);
}
.left, .right
{
top:0;
-webkit-transform: rotateY(90deg);
-moz-transform: rotateY(90deg);
transform: rotateY(90deg);
}
.left
{
left:-100px;
}
.right
{
left:100px;
}
.front, .back, .left, .right, .bottom
{
position:absolute;
border:2px solid #CF985D;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
transform-style: preserve-3d;
background-image:url(SRC/Images/cardboard_texture_02.jpg);
width:200px;
height:200px;
}
.bottom
{
top:100px;
-webkit-transform: rotateX(90deg);
-moz-transform: rotateX(90deg);
transform: rotateX(90deg);
}
.top1, .top2
{
position:absolute;
border:2px solid #CF985D;
background-image:url(SRC/Images/cardboard_texture_02.jpg);
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.top1, .top2
{
top:0px;
left:0;
width:100px;
height:200px;
}
.top2
{
right:0;
}
.outer1, .outer2
{
position:absolute;
width:200px;
height:200px;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.outer1
{
-webkit-transition: all 1s;
-moz-transition: all 1s;
transition: all 1s;
-webkit-transform: rotateX(90deg);
-moz-transform: rotateX(90deg);
transform: rotateX(90deg);
}
.outer2
{
-webkit-transition: all 2s bounce;
-moz-transition: all 2s bounce;
transition: all 2s bounce;
-webkit-transform: rotateX(90deg) rotateY(180deg);
-moz-transform: rotateX(90deg) rotateY(180deg);
transform: rotateX(90deg) rotateY(180deg);
}
.outer1:hover
{
-webkit-transform: rotateX(90deg) rotateY(180deg);
-moz-transform: rotateX(90deg) rotateY(180deg);
transform: rotateX(90deg) rotateY(180deg);
}
.outer2:hover
{
-webkit-transform: rotateX(90deg) rotateY(0deg);
-moz-transform: rotateX(90deg) rotateY(0deg);
transform: rotateX(90deg) rotateY(0deg);
}
.outer1
{
left:-100px;
top:-100px;
}
.outer2
{
right:-300px;
top:-100px;
}
.outer1.close
{
-webkit-transform: rotateX(90deg) rotateY(180deg);
-moz-transform: rotateX(90deg) rotateY(180deg);
transform: rotateX(90deg) rotateY(180deg);
}
.outer2.close
{
-webkit-transform: rotateX(90deg) rotateY(0deg);
-moz-transform: rotateX(90deg) rotateY(0deg);
transform: rotateX(90deg) rotateY(0deg);
}
any suggestions?

IE10 does not support preserve-3d option for transform-style.
CSS3 - 3D Flip Animation - IE10 transform-origin: preserve-3d workaround
Why doesn't IE10 display nested CSS3 3D transformed elements?

Related

Css transform perspective compatibility

I recently came across this pen on codepen https://codepen.io/joshnh/pen/paxbE
I have been playing around with this animation but am unable to get it working on any other browser other than chrome. I have tried all prefixes with transform and transitions. when I remove the perspective(500) property the animation works in firefox but not with the desired results. From what I've read it is something to do with the way chrome applies the perspective property to child elements differently than other browsers. Is there any work around to getting this type of animation working across all browsers?
This is what I have changed the css to in order to get it working in other browsers but nothing seems to help.
html {
height: 100%;
}
body {
position: absolute;
width: 100%;
height: 100%;
-moz-animation: myfade 5s;
-webkit-animation: myfade 5s;
animation: myfade 5s;
background: url("../img/screenbackground.jpg");
}
button {
position: absolute;
top: 0.6%;
margin-left: 2%;;
border: none;
background: #3a7999;
color: #f2f2f2;
padding: 10px;
font-size: 14px;
border-radius: 5px;
opacity: 0;
box-sizing: border-box;
-webkit-transition: all 500ms ease;
-moz-transition: all 500ms ease;
transition: all 500ms ease;
}
button:hover {
background: #000000;
color: #3a7999;
box-shadow: inset 0 0 0 3px #3a7999;
}
.imageWrapper {
background-color:transparent;
font-family: sans-serif;
font-size: 100%;
line-height: 20%;
margin: 0 auto;
padding: 1em;
width: 80%;
height: 60%;
margin-top: 3%;
}
figure {
float: left;
height: 12em;
margin: 3em;
margin-top: 1em;
margin-bottom: 0.5em;
width: 24em;
-webkit-transform: perspective(500);
-webkit-transform-style: preserve-3d;
-webkit-transition: .5s;
-moz-transform: perspective(500);
-moz-transform-style: preserve-3d;
-moz-transition: .5s;
transform: perspective(500);
transform-style: preserve-3d;
transition: .5s;
border-radius: 5px;
-webkit-animation: myflip;
-moz-animation: myflip;
-ms-animation: myflip;
animation: myflip 5s;
}
figure:hover {
-webkit-transform: perspective(500) rotateX(90deg) translateY(-48px)
translateZ(60px);
-moz-transform: perspective(500) rotateX(90deg) translateY(-48px)
translateZ(60px);
-ms-transform: perspective(500) rotateX(90deg) translateY(-48px)
translateZ(60px);
transform: perspective(500) rotateX(90deg) translateY(-48px)
translateZ(60px);
}
img {
background-color: #222;
box-shadow: 0 40px 30px -20px hsla(0,0%,0%,.25);
display: block;
height: 100%;
-webkit-transition: .5s;
-moz-transition: .5s;
transition: .5s;
}
figure:hover img {
box-shadow: none;
}
figcaption {
background-color: #222;
color: #fff;
padding: 1.5em;
-webkit-transform: rotateX(-90deg);
-webkit-transform-origin: 100% 0;
-webkit-transition: .5s;
-moz-transform: rotateX(-90deg);
-moz-transform-origin: 100% 0;
-moz-transition: .5s;
transform: rotateX(-90deg);
transform-origin: 100% 0;
transition: .5s;
}
figure:hover figcaption {
box-shadow: 0 20px 15px -10px hsla(0,0%,0%,.25);
}
h3 {
font-weight: bold;
}
#-webkit-keyframes myflip {
0% {
-webkit-transform: perspective(500) rotateX(90deg) translateZ(60px);
-moz-transform: perspective(500) rotateX(90deg) translateZ(60px);
-ms-transform: perspective(500) rotateX(90deg) translateZ(60px);
transform: perspective(500) rotateX(90deg) translateZ(60px);
}
50% {
-webkit-transform: perspective(500) rotateX(90deg) translateZ(60px);
-moz-transform: perspective(500) rotateX(90deg) translateZ(60px);
-ms-transform: perspective(500) rotateX(90deg) translateZ(60px);
transform: perspective(500) rotateX(90deg) translateZ(60px);
}
80% {
-webkit-transform: perspective(500) rotateX(90deg)
translateZ(60px);
-moz-transform: perspective(500) rotateX(90deg) translateZ(60px);
-ms-transform: perspective(500) rotateX(90deg) translateZ(60px);
transform: perspective(500) rotateX(90deg) translateZ(60px);
}
100% {
}
}
#-moz-keyframes myflip {
0% {
-webkit-transform: perspective(500) rotateX(90deg) translateZ(60px);
-moz-transform: perspective(500) rotateX(90deg) translateZ(60px);
-ms-transform: perspective(500) rotateX(90deg) translateZ(60px);
transform: perspective(500) rotateX(90deg) translateZ(60px);
}
50% {
-webkit-transform: perspective(500) rotateX(90deg) translateZ(60px);
-moz-transform: perspective(500) rotateX(90deg) translateZ(60px);
-ms-transform: perspective(500) rotateX(90deg) translateZ(60px);
transform: perspective(500) rotateX(90deg) translateZ(60px);
}
80% {
-webkit-transform: perspective(500) rotateX(90deg)
translateZ(60px);
-moz-transform: perspective(500) rotateX(90deg) translateZ(60px);
-ms-transform: perspective(500) rotateX(90deg) translateZ(60px);
transform: perspective(500) rotateX(90deg) translateZ(60px);
}
100% {
}
}
#keyframes myflip {
0% {
-webkit-transform: perspective(500) rotateX(90deg) translateZ(60px);
-moz-transform: perspective(500) rotateX(90deg) translateZ(60px);
-ms-transform: perspective(500) rotateX(90deg) translateZ(60px);
transform: perspective(500) rotateX(90deg) translateZ(60px);
}
50% {
-webkit-transform: perspective(500) rotateX(90deg) translateZ(60px);
-moz-transform: perspective(500) rotateX(90deg) translateZ(60px);
-ms-transform: perspective(500) rotateX(90deg) translateZ(60px);
transform: perspective(500) rotateX(90deg) translateZ(60px);
}
80% {
-webkit-transform: perspective(500) rotateX(90deg)
translateZ(60px);
-moz-transform: perspective(500) rotateX(90deg) translateZ(60px);
-ms-transform: perspective(500) rotateX(90deg) translateZ(60px);
transform: perspective(500) rotateX(90deg) translateZ(60px);
}
100% {
}
}
#-ms-keyframes myflip {
0% {
-webkit-transform: perspective(500) rotateX(90deg) translateZ(60px);
-moz-transform: perspective(500) rotateX(90deg) translateZ(60px);
-ms-transform: perspective(500) rotateX(90deg) translateZ(60px);
transform: perspective(500) rotateX(90deg) translateZ(60px);
}
50% {
-webkit-transform: perspective(500) rotateX(90deg) translateZ(60px);
-moz-transform: perspective(500) rotateX(90deg) translateZ(60px);
-ms-transform: perspective(500) rotateX(90deg) translateZ(60px);
transform: perspective(500) rotateX(90deg) translateZ(60px);
}
80% {
-webkit-transform: perspective(500) rotateX(90deg)
translateZ(60px);
-moz-transform: perspective(500) rotateX(90deg) translateZ(60px);
-ms-transform: perspective(500) rotateX(90deg) translateZ(60px);
transform: perspective(500) rotateX(90deg) translateZ(60px);
}
100% {
}
}
#-webkit-keyframes myfade {
0% {
opacity: 0;
}
100% {
opacity 1;
}
}
#-moz-keyframes myfade {
0% {
opacity: 0;
}
100% {
opacity 1;
}
}
#keyframes myfade {
0% {
opacity: 0;
}
100% {
opacity 1;
}
}
The CSS perspective property accepts length as parameter, which means you should use a unit like px.
Also, in order to see your pen working in Firefox, you should add the vendor-prefix-free version of the -webkit properties you're using and add a unit to the perspective property, like in perspective(500px). See modified pen.

CSS3 Animations cutting to the end on webkit

I'm here again with another webkit css3 animation problem. I've tried absolutely everything, even over-defining CSS properties.
The problem I'm having is the hover animations are cutting to the end when hovering in and out on webkit. It also has some strangeness when activating and deactivating where it seems to remember old values and try to animate to them.
I'm wondering whether I'm just missing something here, or Chrome is just incredibly buggy recently. Here is an example:
$(".offcanvas").click(function() {
$('body').toggleClass('uk-offcanvas-page');
});
html,
body {
padding: 0;
margin: 0;
background: #de1b4a;
}
.center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
/* Bar */
header .offcanvas .bar {
display: inline-block;
position: relative;
width: 20px;
height: 2px;
margin: 8px 0 !important;
background: #fff;
-webkit-transform: rotateZ(0deg) translateX(0px);
-moz-transform: rotateZ(0deg) translateX(0px);
-ms-transform: rotateZ(0deg) translateX(0px);
-o-transform: rotateZ(0deg) translateX(0px);
transform: rotateZ(0deg) translateX(0px);
-webkit-transition: transform 500ms ease-in-out;
-moz-transition: transform 500ms ease-in-out;
-o-transition: transform 500ms ease-in-out;
transition: transform 500ms ease-in-out;
}
header .offcanvas .bar:before {
content: '';
display: block;
position: absolute;
top: 8px;
left: 0;
background: inherit;
width: inherit;
height: inherit;
-webkit-transform: rotateZ(0deg) translateX(0px);
-moz-transform: rotateZ(0deg) translateX(0px);
-ms-transform: rotateZ(0deg) translateX(0px);
-o-transform: rotateZ(0deg) translateX(0px);
transform: rotateZ(0deg) translateX(0px);
-webkit-transition: transform 500ms ease-in-out;
-moz-transition: transform 500ms ease-in-out;
-o-transition: transform 500ms ease-in-out;
transition: transform 500ms ease-in-out;
}
header .offcanvas .bar:after {
content: '';
display: block;
position: absolute;
bottom: 8px;
left: 0;
background: inherit;
width: inherit;
height: inherit;
-webkit-transform: rotateZ(0deg) translateX(0px);
-moz-transform: rotateZ(0deg) translateX(0px);
-ms-transform: rotateZ(0deg) translateX(0px);
-o-transform: rotateZ(0deg) translateX(0px);
transform: rotateZ(0deg) translateX(0px);
-webkit-transition: transform 500ms ease-in-out;
-moz-transition: transform 500ms ease-in-out;
-o-transition: transform 500ms ease-in-out;
transition: transform 500ms ease-in-out;
}
/* Bar Hover */
header .offcanvas:hover .bar {
-webkit-transform: rotateZ(0deg) translateX(-3px);
-moz-transform: rotateZ(0deg) translateX(-3px);
-ms-transform: rotateZ(0deg) translateX(-3px);
-o-transform: rotateZ(0deg) translateX(-3px);
transform: rotateZ(0deg) translateX(-3px);
}
header .offcanvas:hover .bar:before {
-webkit-transform: rotateZ(0deg) translateX(6px);
-moz-transform: rotateZ(0deg) translateX(6px);
-ms-transform: rotateZ(0deg) translateX(6px);
-o-transform: rotateZ(0deg) translateX(6px);
transform: rotateZ(0deg) translateX(6px);
}
header .offcanvas:hover .bar:after {
-webkit-transform: rotateZ(0deg) translateX(6px);
-moz-transform: rotateZ(0deg) translateX(6px);
-ms-transform: rotateZ(0deg) translateX(6px);
-o-transform: rotateZ(0deg) translateX(6px);
transform: rotateZ(0deg) translateX(6px);
}
/* Bar Close */
.uk-offcanvas-page header .offcanvas .bar,
.uk-offcanvas-page header.uk-active .offcanvas .bar {
background: rgba(0, 0, 0, 0);
}
.uk-offcanvas-page header .offcanvas:hover .bar {
-webkit-transform: rotateZ(0deg) translateX(0px);
-moz-transform: rotateZ(0deg) translateX(0px);
-ms-transform: rotateZ(0deg) translateX(0px);
-o-transform: rotateZ(0deg) translateX(0px);
transform: rotateZ(0deg) translateX(0px);
}
.uk-offcanvas-page header .offcanvas .bar:before {
-webkit-transform: rotateZ(45deg) translateX(-11px);
-moz-transform: rotateZ(45deg) translateX(-11px);
-ms-transform: rotateZ(45deg) translateX(-11px);
-o-transform: rotateZ(45deg) translateX(-11px);
transform: rotateZ(45deg) translateX(-11px);
background: #fff;
}
.uk-offcanvas-page header .offcanvas .bar:after {
-webkit-transform: rotateZ(-45deg) translateX(-11px);
-moz-transform: rotateZ(-45deg) translateX(-11px);
-ms-transform: rotateZ(-45deg) translateX(-11px);
-o-transform: rotateZ(-45deg) translateX(-11px);
transform: rotateZ(-45deg) translateX(-11px);
background: #fff;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div class="center">
<header>
<div class="offcanvas"><i class="bar"></i>
</div>
</header>
</div>
I've slowed down the animations so you can see it skipping, but hover in and out to see it.
I was wondering if anyone more advanced could help me on this one?
Thanks,
Tom

Creating flip card with CSS

I'm trying to create a flip card animation with CSS.
It works well on Firefox, Chrome, Opera, Safari but I have a problem with Internet Explorer (again)...
Look at demo I made : Text problem with Internet Explorer
That's OK in Firefox, Chrome, Opera and Safari !
But my text is inverted with Internet Explorer... Please, tell me what's wrong in my code ?
CSS :
<style>
.flip-container {
-webkit-perspective : 680;
-ms-perspective: 680;
-moz-perspective: 680;
-o-perspective: 680;
perspective: 680;
}
.flip-container:hover .flipper, .flip-container.hover .flipper {
-webkit-transform:rotateY(180deg);
-moz-transform:rotateY(180deg);
-ms-transform:rotateY(180deg);
-o-transform:rotateY(180deg);
transform: rotateY(180deg);
}
.flip-container, .front .back {
width:480px;
height:340px;
}
.flipper {
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transition: 2.0s;
-moz-transition: 2.0s;
-ms-transition: 2.0s;
-o-transition: 2.0s;
transition: 2.0s;
position: relative;
}
.front, .back {
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden;
position: absolute;
top: 0;
left: 0;
}
.front {
z-index: 2;
-webkit-transform: rotateY(0deg);
-moz-transform: rotateY(0deg);
-ms-transform: rotateY(0deg);
-o-transform: rotateY(0deg);
transform: rotateY(0deg); }
.back {
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
</style>
I added an update for latest Internet Explorer versions. It works for each modern desktop browser.
I correct rotation values :
Initial :
Front = 0°
Back = -180°
Hover :
Front = 180°
Back = 0°
This code still need to be updated to be compatible with IE6 IE7 IE8 :
<style>
.flip-container {
-webkit-perspective : 680;
-moz-perspective: 680;
-ms-perspective: 680;
-o-perspective: 680;
perspective: 680;
}
/* For Internet Explorer */
.flip-container:hover .back, .flip-container.hover .back {
-webkit-transform:rotateY(0deg);
-moz-transform:rotateY(0deg);
-ms-transform:rotateY(0deg);
-o-transform:rotateY(0deg);
transform: rotateY(0deg);
}
/* For Internet Explorer */
.flip-container:hover .front, .flip-container.hover .front {
-webkit-transform:rotateY(180deg);
-moz-transform:rotateY(180deg);
-ms-transform:rotateY(180deg);
-o-transform:rotateY(180deg);
transform: rotateY(180deg);
}
.flip-container, .front .back {
width:480px;
height:340px;
}
.flipper {
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
position: relative;
}
.front, .back {
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-transition: 2.0s;
-moz-transition: 2.0s;
-ms-transition: 2.0s;
-o-transition: 2.0s;
transition: 2.0s;
position: absolute;
top: 0;
left: 0;
}
.front {
z-index:2;
-webkit-transform: rotateY(0deg);
-moz-transform: rotateY(0deg);
-ms-transform: rotateY(0deg);
-o-transform: rotateY(0deg);
transform: rotateY(0deg);
}
.back {
z-index:1;
-webkit-transform: rotateY(-180deg);
-moz-transform: rotateY(-180deg);
-ms-transform: rotateY(-180deg);
-o-transform: rotateY(-180deg);
transform: rotateY(-180deg);
}
</style>

css piece de resistance

i've been wrestling it out all week with a challenging design and im on my last piece de resistance and a hour left of the day,
I have a diamond/honeycomb ui here
http://jsfiddle.net/z42wg/25/
.diamonds li {
-webkit-perspective: 1000;
-moz-perspective: 1000;
-ms-perspective: 1000;
perspective: 1000;
-ms-transform: perspective(1000px);
-moz-transform: perspective(1000px);
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
}
.diamond:hover .back,.diamond.hover .back {
-webkit-transform: rotateY(0deg);
-moz-transform: rotateY(0deg);
-o-transform: rotateY(0deg);
-ms-transform: rotateY(0deg);
transform: rotateY(0deg);
}
.diamond:hover .frontFlip,.diamond.hover .frontFlip {
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.flipper {
-webkit-transition: 0.6s;
-webkit-transform-style: preserve-3d;
-ms-transition: 0.6s;
-moz-transition: 0.6s;
-moz-transform: perspective(1000px);
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
transition: 0.6s;
transform-style: preserve-3d;
position: relative;
}
.frontFlip, .back {
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-transition: 0.6s;
-webkit-transform-style: preserve-3d;
-moz-transition: 0.6s;
-moz-transform-style: preserve-3d;
-o-transition: 0.6s;
-o-transform-style: preserve-3d;
-ms-transition: 0.6s;
-ms-transform-style: preserve-3d;
transition: 0.6s;
transform-style: preserve-3d;
position: absolute;
top: 0;
left: 0;
}
.frontFlip {
-webkit-transform: rotateY(0deg);
-ms-transform: rotateY(0deg);
z-index: 2;
}
.back {
-webkit-transform: rotateY(-180deg);
-moz-transform: rotateY(-180deg);
-o-transform: rotateY(-180deg);
-ms-transform: rotateY(-180deg);
transform: rotateY(-180deg);
}
.frontFlip .name {
font-size: 2em;
display: inline-block;
background: rgba(33, 33, 33, 0.9);
color: #f8f8f8;
font-family: Courier;
padding: 5px 10px;
border-radius: 5px;
bottom: 60px;
left: 25%;
position: absolute;
text-shadow: 0.1em 0.1em 0.05em #333;
display: none;
-webkit-transform: rotate(-20deg);
-moz-transform: rotate(-20deg);
-ms-transform: rotate(-20deg);
transform: rotate(-20deg);
}
currently on hovering the diamond the inner text uses a css3 transition to flip but the transition needs to be on the grey diamond its self
any pointers on where to move the css rules highly appreciated!!
If you just want the appearance of flipping to be on the 'diamond'. You can move the remove the box-shadow on .diamond li and the background on .diamonds .diamond and put them on the .diamond .content
/* line 118, ../sass/screen.scss */
.diamonds .content {
display: table-cell;
height: 190px;
padding: 0 10px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
text-align: center;
vertical-align: middle;
width: 190px;
border: 1px solid rgb(204,204,204);
background: #f4f4f4;
}
See http://jsfiddle.net/z42wg/44/

CSS3 rotate animation causes Animate.css shake animation to disappear

Whenever I execute an Animate.css shake animation after a CSS3 rotate animation the div being shook will disappear. This only happens on the back-face of the rotated divs. The front-face doesn't have this issue.
I've put together a jsfiddle to demonstrate the problem.
http://jsfiddle.net/kG9Ld/1/
HTML
<div class="wrappers">
<div class="wrapper shaker front">
<p>Front</p>
<p>Flip</p>
<p>Shake</p>
</div>
<div class="wrapper shaker back">
<p>Back</p>
<p>Flip</p>
<p>Shake</p>
</div>
</div>
CSS
.wrappers {
-webkit-transition:-webkit-transform 1s;
-moz-transition:-moz-transform 1s;
-ms-transition:-ms-transform 1s;
-o-transition:-o-transform 1s;
transition: transform 1s;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.wrapper {
height: 100px;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
position: absolute;
width: 100px;
}
.front {
background-color: red;
z-index: 3;
}
.back {
background-color: green;
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
z-index: 1;
}
.flipped {
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.flipped .back {
z-index: 3;
}
JavaScript
$('.flip').on('click', function (e) {
$wrappers = $('.wrappers');
$wrappers.toggleClass('flipped');
});
$('.shake').on('click', function (e) {
$('.shaker').addClass('animated shake');
});
$('.shaker').on('webkitAnimationEnd mozAnimationEnd oAnimationEnd animationEnd', function(e) {
$('.shaker').removeClass('animated shake');
});
The problem was that the shaking animation's transform property was overwriting the .back element's transform property: rotateY(180deg).
The solution would just be to modify the animation and use a combination of transformations:
WORKING EXAMPLE HERE
-webkit-transform: translateX(0) rotateY(180deg);
This would of course require new keyframes:
#-webkit-keyframes shakeBack {
0%, 100% {
-webkit-transform: translateX(0) rotateY(180deg);
transform: translateX(0) rotateY(180deg);
}
10%, 30%, 50%, 70%, 90% {
-webkit-transform: translateX(-10px) rotateY(180deg);
transform: translateX(-10px) rotateY(180deg);
}
20%, 40%, 60%, 80% {
-webkit-transform: translateX(10px) rotateY(180deg);
transform: translateX(10px) rotateY(180deg);
}
}
You now need to add a different animation based on whether the front/back of the element is visible.
.shakeBack {
-webkit-animation-name: shakeBack;
animation-name: shakeBack;
}
Modified JS - this could be written better, but you get the point.
$('.shaker.front .shake').on('click', function (e) {
$(this).parents('.shaker').addClass('animated shake');
});
$('.shaker.back .shake').on('click', function (e) {
$(this).parents('.shaker').addClass('animated shakeBack');
});

Resources