I have a dashboard in that I am using CSS3 flip animations,the flip animations are working fine in windows but when comes to chrome on Mac OS X the flip animation is flickering when I am hovering on that DIV.Please provide me some fix.
Thanks.
CSS:
Here the problem is only with 'back face' when I am hovering on that div it is flickering.
#f1_container {
position: relative;
width: 100%;
z-index: 1;
margin-bottom: 20px;
display: inline-block;
}
#f1_container {
-webkit-perspective: 1000;
-moz-perspective: 1000;
-ms-perspective: 1000;
-o-perspective: 1000;
perspective: 1000;
}
#f1_card {
width: 100%;
height: 100%;
-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: 1.5s ease-in-out;
-moz-transition: 1.5s ease-in-out;
-ms-transition: 1.5s ease-in-out;
-o-transition: 1.5s ease-in-out;
transition: 1.5s ease-in-out;
background-color: white;
}
#f1_container:hover #f1_card {
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.face {
position: relative;
width: 100%;
height: 100%;
-moz-transform-style: preserve-3d;
-moz-backface-visibility: hidden;
-webkit-transform-style: preserve-3d;
-webkit-backface-visibility: hidden;
top: 0;
}
.face.back {
display: block;
-webkit-transform: rotateY(-180deg);
-moz-transform: rotateY(-180deg);
-ms-transform: rotateY(-180deg);
-o-transform: rotateY(-180deg);
transform: rotateY(-180deg);
box-sizing: border-box;
color: white;
text-align: center;
position: absolute;
-moz-transform-style: preserve-3d;
-moz-backface-visibility: hidden;
-webkit-transform-style: preserve-3d;
-webkit-backface-visibility: hidden;
-moz-transform: rotateY(-180deg);
-webkit-transform: rotateY(-180deg);
}
.no-flick{
-webkit-transform:translate3d(0,0,0);
-moz-transform:translate3d(0,0,0);
-ms-transform:translate3d(0,0,0);
-o-transform:translate3d(0,0,0);
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden;
}
I experienced the same issue using Chrome 57 on OSX. Upon flipping the card, the back would show briefly and then disappear to white.
My solution was to set background-color: white; on the front and back instead of the flip container. Not 100% sure why the background color is an issue but it flips correctly now with no flicker! :)
Related
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>
I have a card with something on the back, and I'm y-rotating the card +/- 180 deg:
http://jsfiddle.net/s46t6cem/1/
#back {
transform: rotateY(180deg);
}
.flipped-right {
transform: rotateY(180deg);
}
.flipped-left {
transform: rotateY(-180deg);
}
In the jsfiddle basic example, both flips work fine. However, in my application, flipping right works, but when I flip left, I can see the back as it's moving (it flickers though, which is odd), but then I can't see the back when it stops moving. I can see it if I change the original #back rotation to 181 deg.
and then
I can't figure out what's different between the fiddle and my app that might be causing this. How can I further diagnose this?
I dont know how to debug this kind of things. But maybe you need to add some x-browser propierty:
-webkit -moz -o -ms. I have used this code in other project, try it, it worked for me (not for IE)
<style>
.flip-container {
position: relative;
height: 100%;
-webkit-perspective: 800;
-moz-perspective: 800;
-o-perspective: 800;
-ms-perspective: 800;
perspective: 800;
padding: 0;
}
.flip {
height: 100%;
width: 100%;
-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: all 0.5s;
-moz-transition: all 0.5s;
-ms-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
}
.flip-container:hover .flip {
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.side {
position: absolute;
height: 100%;
width: 100%;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-o-backface-visibility: hidden;
}
.flip .front {
height: 100%;
width: 100%;
}
.flip .back {
display: block;
height: 100%;
width: 100%;
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
</style>
<div class="flip-container">
<div class="flip">
<div class="side front">
a
</div>
<div class="side back">
b
</div>
</div>
</div>
Thank you #mknadler, I took background: white off of the #card and it works.
I'm trying to create a simple CSS Flip effect on some images and put links on the backside... however, the links work in FireFox, but not Chrome or Safari.
I've tried many different methods, but I can't seem to figure it out.
/* Artists Flip */
.rsp-img-center {
margin: 0 auto;
}
.front img {
border-radius: 50%;
width: 120px;
height: 120px;
background-color: #000;
}
#f1_container {
position: relative;
margin: 10px auto;
width: 200px;
height: 175px;
-webkit-perspective: 1000;
-moz-perspective: 1000;
-o-perspective: 1000;
perspective: 1000;
}
#f1_card {
width: 200px;
height: 175px;
position: relative;
transition: 0.6s;
transform-style: preserve-3d;
-webkit-transition: 0.6s;
-webkit-transform-style: preserve-3d;
-moz-transition: 0.6s;
-moz-transform-style: preserve-3d;
}
#f1_container:hover #f1_card {
position: relative;
transform: rotateY(180deg);
-webkit-transform: rotateY(180deg) scale(1);
-moz-transform: rotateY(180deg);
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
z-index: 100;
clear: both;
top: 0;
}
.face {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
}
.face.back {
display: inline-block;
z-index: 500;
position: absolute;
transform: rotateY(180deg);
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
color: white;
text-align: center;
background-image: url("http://beta2.thrivemusic.com/wp-content/uploads/2014/07/flip_back.png");
background-attachment:local;
position: relative;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
-webkit-transform-style: preserve-3d;
-moz-backface-visibility: hidden;
}
.face.back a{
z-index: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;
}
.front {
background-color: #000000;
}
.back {
background-attachment:local;
background-position:center;
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
transform: rotateY(180deg);
}
Here's the codepen URL: http://codepen.io/samkimdesign/pen/tAvDn
Any help would be greatly appreciated, thanks!
Just in case, have a look at my jsfiddle
css3 and html :
#card {
-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-perspective: 1000;
-moz-perspective: 1000;
-ms-perspective: 1000;
-o-perspective: 1000;
perspective: 1000;
width: 250px;
height: 250px;
position: relative;
}
.back, .front {
position: absolute;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-transition: -webkit-transform 1s ease-in;
-moz-transition: -moz-transform 1s ease-in;
-ms-transition: -ms-transform 1s ease-in;
-o-transition: -ms-transform 1s ease-in;
transition: transform 1s ease-in;
width: 100%;
height: 100%;
padding: 20px;
font-family: Helvetica, Arial, sans-serif;
color: #000;
font-weight: bold;
box-shadow: inset 0px 0px 20px rgba(0,0,0,0.4);
border-radius: 4px;
}
.back {
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
background: #bde;
overflow: hidden;
}
.front {
background: #fde;
}
#card-container {
display: inline-block;
text-align: justify;
}
#card-container:target .back {
-webkit-transform: rotateY(0deg);
-moz-transform: rotateY(0deg);
-ms-transform: rotateY(0deg);
-o-transform: rotateY(0deg);
transform: rotateY(0deg);
}
#card-container:target .front {
-webkit-transform: rotateY(-180deg);
-moz-transform: rotateY(-180deg);
-ms-transform: rotateY(-180deg);
-o-transform: rotateY(-180deg);
transform: rotateY(-180deg);
}
<div id="card-container">
<div id="card">
<div class="back">This is the back of the card
<br/>Go to front
</div>
<div class="front">This is the front of the card
<br/>Go to back
</div>
</div>
</div>
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/
Alright. I've done quite a bit of research, but I wasn't able to come up with anything. After possibly over-thinking the problem, here is what I'd appreciate your help with.
I would like to be able to rotate a <div> around its center so its backside becomes visible. I was able to do that with rotateY--without any problems. But when using rotateX the <div> does not rotate around its center anymore.
The CSS:
.flip-container {
font-size: 30px;
-webkit-perspective: 1000;
-moz-perspective: 1000;
margin: 0 auto;
color: black;
}
.flip-container:hover .flipper {
-webkit-transform: rotateX(180deg);
-moz-transform: rotateX(180deg);
-o-transform: rotateX(180deg);
-ms-transform: rotateX(180deg);
}
.flipper {
-webkit-transition: 0.6s;
-webkit-transform-style: preserve-3d;
-moz-transition: 0.6s;
-moz-transform-style: preserve-3d;
position: relative;
}
.front, .back {
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
position: absolute;
top: 0;
left: 0;
background: transparent;
}
.front {
z-index: 1;
}
.flip-container, .front, .back {
width: 200px;
height: 200px;
}
.back {
-webkit-transform: rotateX(-180deg);
-moz-transform: rotateX(-180deg);
-o-transform: rotateX(180deg);
-ms-transform: rotateX(180deg);
This problem is driving me up the walls. I know it's something small I overlooked; but I can't find it. Any helps or hints would be greatly appreciated. :)
Fiddle
For a vertical rotation, you need to specify transform-origin, with :
<x> : 50%
<y> : half height of the div
Updated Fiddle
.flipper {
-webkit-transform-origin: 50% 100px;
-moz-transform-origin: 50% 100px;
-o-transform-origin: 50% 100px;
-ms-transform-origin: 50% 100px;
transform-origin: 50% 100px;
-webkit-transition: 0.6s;
-webkit-transform-style: preserve-3d;
-moz-transition: 0.6s;
-moz-transform-style: preserve-3d;
position: relative;
}