CSS3 Image flip Animation issues in IE and Chrome - html

I'm building a personal website and in the header section(i.e div) i've a logo for which i'm trying to add flip animation on hover, to show the content written back of the logo. Need a help in fixing the problem with browser Chrome as well as IE11. Works fine with Mozilla.
<div id="logo">
<div id="logo_card" class="shadow">
<div class="front face">
<img src="./images/logo+.jpg" />
</div>
<div class="back face center">
<p>Sooner the logo will be changed</p>
</div>
</div>
CSS for animation:
#logo{
width:450px;
height:150px;
margin-left:300px;
border-radius: 5px;
z-index: 1;
}
#logo {
perspective: 1000;
}
#logo_card {
width: 100%;
height: 100%;
transform-style: preserve-3d;
-moz-transition: all 1s linear;
-o-transition: all 1s linear;
-webkit-transition: all 1s linear;
transition: all 1s linear;
border-radius: 5px;
}
#logo:hover #logo_card {
-moz-transform: rotatey(180deg);
-ms-transform: rotatey(180deg);
-o-transform: rotatey(180deg);
-webkit-transform: rotatey(180deg);
transform: rotatey(180deg);
-moz-box-shadow: -5px 5px 5px #aaa;
-webkit-box-shadow: -5px 5px 5px #aaa;
box-shadow: 0 2px 5px rgba(0,0,0,0.25), 0 0 50px rgba(0,0,0,0.1) inset;
border-radius: 5px;
}
.face {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
border-radius: 5px;
}
.face.back {
display: block;
-moz-transform: rotatey(180deg);
-ms-transform: rotatey(180deg);
-o-transform: rotatey(180deg);
-webkit-transform: rotatey(180deg);
transform: rotatey(180deg);
-moz-box-sizing: border-box;
box-sizing: border-box;
/*padding: 10px;*/
color: white;
text-align: center;
background-color: transparent;
border-radius: 5px;
font-size:20px;
font-family: 'Helvetica Neue',Helvetica,arial,sans-serif;
}
Greately this works fine with Mozilla firefox browser only :(
Thank you,

Related

Transform rotate on hover shifting up one pixel

I have created a circle with a fontAwesome icon in it, and on hover, rotating it 180 degree that is working fine, But on hover when I mouseover and when icon moving to 180 its moving up by one pixel, not sure why.
My question is why its moving up by one pixel on hover, I'm not able to find the issue.
Here is the JSFiddle demo
EDIT Please note that its happening in Firefox only.
.share-icon {
background-color: #f00;
border-radius: 50%;
box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.3);
color: #ffffff;
float: left;
font-size: 18px;
height: 45px;
line-height: 45px;
margin-top: 50px;
position: relative;
text-align: center;
width: 45px;
transition: all 0.5s ease 0s;
cursor: pointer;
}
.share-icon:hover {
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-o-transform: rotate(180deg);
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
<div class="share-icon" onclick="shairIcon(this)">
<i class="fa fa-share-alt" aria-hidden="true"></i>
</div>
Refer this css, i have made correction.
You should add fa icon class on hover and add transition property.
.share-icon:hover .fa-share-alt {
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-o-transform: rotate(180deg);
-moz-transition: all 500ms ease;
}
Working DEMO!!!
Honestly I don't know exactly why but if you increase your font-size just by two pixels you'll get rid of this jump. Simply update your code to the following
.share-icon {
background-color: #f00;
border-radius: 50%;
box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.3);
color: #ffffff;
height: 45px;
width: 45px;
line-height: 45px;
text-align: center;
cursor: pointer;
font-size: 20px;
}
.share-icon i {
transition: all 0.5s ease 0s;
}
.share-icon:hover i {
transform: rotate(180deg);
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
<div class="share-icon" onclick="shairIcon(this)">
<i class="fa fa-share-alt" aria-hidden="true"></i>
</div>

2nd image appears as mirror image in IE--- CSS image FLIP transform- How to fix?

Im hoping someone can help me get my code to flip my second image properly (not mirror image) when viewed in IE. I think I have it working properly in the other browsers.
My goal is to have picture #1 show, then upon button click show the picture #2.
The code also uses javascript + jquery but my knowledge currently is limited.
Can someone offer a solution via css that I can add or amend my code with to accomplish what I am trying to do? Thanks.
My fiddle: http://jsfiddle.net/zgn9kd0L/6/
HTML
<div id="block" class="block" onclick="changeClass()">
<div class="front side">
<img src="http://imgur.com/etY8veW.jpg" alt="" />
</div>
<div class="back side">
<img src="http://imgur.com/DiSXWpR.jpg" alt="" />
</div>
</div>
<button class="flip">Flip</button>
CSS
#container {
height: 500px;
width: 500px;
position: relative;
/*perspective*/
-webkit-perspective: 500;
-moz-perspective: 500;
-ms-perspective: 500;
-o-perspective: 500;
perspective: 500;
}
.block {
position: relative;
height: 500px;
width: 500px;
/*transform-style*/
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
/*transition*/
-webkit-transition: -webkit-transform 1.5s;
-moz-transition: -moz-transform 1.5s;
-o-transition: -o-transform 1.5s;
transition: transform 1.5s;
}
.rotated {
/*transform*/
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.side {
position: absolute;
/*backface-visibility*/
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden;
}
.front {
}
.back {
/*transform*/
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.flip {
background: white;
font-family: 'open sans';
font-weight: 400;
color: #5b5b5b;
border-radius: 5px;
margin-top: 1em;
}
IE10+ only has partial support for the property transform-style: preserve-3d. I assume that's why it wasn't working.
Here is a similar alternative that works in IE. (updated example)
HTML
<div class="block">
<div class="front side">
<img src="http://imgur.com/etY8veW.jpg" alt="" />
</div>
<div class="back side">
<img src="http://imgur.com/DiSXWpR.jpg" alt="" />
</div>
</div>
CSS - vendor prefixes omitted. See the example.
.block {
width: 500px;
height: 500px;
position: relative;
perspective: 500;
}
.side {
position: absolute;
transition: transform 0.5s;
backface-visibility: hidden;
}
.side.rotated {
transform: rotateY(360deg);
}
.back {
transform: rotateY(180deg);
}
If you are looking for Pure CSS Solutions here are few:
Create a CSS Flipping Animation
Working Demo
HTML:
<div class="flip-container" ontouchstart="this.classList.toggle('hover');">
<div class="flipper">
<div class="front">
<span class="name">David Walsh</span>
</div>
<div class="back">
<div class="back-logo"></div>
<div class="back-title">#davidwalshblog</div>
<p>Mozilla Web Developer, MooTools & jQuery Consultant, MooTools Core Developer, Javascript Fanatic, CSS Tinkerer, PHP Hacker, and web lover.</p>
</div>
</div>
</div>
CSS:
.flip-container {
-webkit-perspective: 1000;
-moz-perspective: 1000;
-o-perspective: 1000;
perspective: 1000;
border: 1px solid #ccc;
}
.flip-container:hover .flipper,
.flip-container.hover .flipper {
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.flip-container, .front, .back {
width: 320px;
height: 427px;
}
.flipper {
-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;
transition: 0.6s;
transform-style: preserve-3d;
position: relative;
}
.front, .back {
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden;
position: absolute;
top: 0;
left: 0;
}
.front {
background: url(http://davidwalsh.name/demo/dwflip.jpg) 0 0 no-repeat;
z-index: 2;
}
.back {
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
background: #f8f8f8;
}
.front .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;
-webkit-transform: rotate(-20deg);
-moz-transform: rotate(-20deg);
-o-transform: rotate(-20deg);
transform: rotate(-20deg);
}
.back-logo {
position: absolute;
top: 40px;
left: 90px;
width: 160px;
height: 117px;
background: url(http://davidwalsh.name/demo/logo.png) 0 0 no-repeat;
}
.back-title {
font-weight: bold;
color: #00304a;
position: absolute;
top: 180px;
left: 0;
right: 0;
text-align: center;
text-shadow: 0.1em 0.1em 0.05em #acd7e5;
font-family: Courier;
font-size: 2em;
}
.back p {
position: absolute;
bottom: 40px;
left: 0;
right: 0;
text-align: center;
padding: 0 20px;
font-family: arial;
line-height: 2em;
}

CSS flip code won't work in IE11

I am trying to create a flip animation for some images, which when they turn over, display appropriate link text. This works perfectly in all browsers that I have tested, but IE11.
I read that there is a problem with transform-style: preserve-3d; for IE10, but as I am a CSS beginner, I have been unable to figure out a way to correct the coding.
Here is the HTML:
<div class="flipcontainer">
<div class="flipscene3D">
<div class="flip">
<div>
<p>
<a itemprop="url" href="ARC3RFC.html"><span itemprop="headline">ARC3RFC Essay: Tomb 100, Tomb U-J and Maadi South: Themes from Predynastic Egypt</span></a> - 2013
</p>
</div>
<div>
<img src="ARC3RFC.jpg" class="flipimg">
</div>
</div>
</div>
</div>
And the CSS:
img.flipimg {
height: 150px;
width: 150px;
/*border-radius*/
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.flipcontainer {
display: block;
width: 760px;
height: 700px;
margin: 30px auto;
}
.flipscene3D {
display: block;
float: left;
margin: 10px;
/*border-radius*/
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
/*perspective*/
-webkit-perspective: 300px;
-moz-perspective: 300px;
-ms-perspective: 300px;
-o-perspective: 300px;
perspective: 300px;
}
.flip div {
position: absolute;
width: 150px;
height: 150px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden;
z-index: 500
}
.flip div:first-child {
font-size: 12px;
/*border-radius*/
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background: #333;
/*transform*/
-webkit-transform: rotateX(180deg);
-moz-transform: rotateX(180deg);
-ms-transform: rotateX(180deg);
-o-transform: rotateX(180deg);
transform: rotateX(180deg);
}
.flip div:first-child p {
color: #FFF;
text-shadow: 0 0 1px .111;
padding-top: 10px;
text-align: center;
}
.flip {
width: 150px;
height: 150px;
/*border-radius*/
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
/*box-shadow*/
-webkit-box-shadow: 0 0 15px rgba(0,0,0,0.3);
-moz-box-shadow: 0 0 15px rgba(0,0,0,0.3);
box-shadow: 0 0 15px rgba(0,0,0,0.3);
/*transform*/
-webkit-transform: rotateX(0deg);
-moz-transform: rotateX(0deg);
-ms-transform: rotateX(0deg);
-o-transform: rotateX(0deg);
transform: rotateX(0deg);
/*transition*/
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;
/*transform-style*/
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.flipscene3D:hover .flip {
/*transform*/
-webkit-transform: rotateX(180deg);
-moz-transform: rotateX(180deg);
-ms-transform: rotateX(180deg);
-o-transform: rotateX(180deg);
transform: rotateX(180deg);
}
Have a look at this Flipping animation Demo. I hope it will solve your problem.
Check the DEMO.
Here is the HTML code look like.
<div class="wrapper">
<div class="front anim">
Chrome
</div>
<div class="back anim">
IE
</div>
</div>
Here is the CSS code.
.wrapper {
width: 300px;
height: 300px;
margin: auto;
position: relative;
}
.anim {
width: 100%;
height: 100%;
-o-transition: all .5s;
-ms-transition: all .5s;
-moz-transition: all .5s;
-webkit-transition: all .5s;
transition: all .5s;
-webkit-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
position: absolute;
top: 0px;
left: 0px;
}
.front {
z-index: 2;
background: url(http://lorempixel.com/300/300/) no-repeat;
}
.back {
z-index: 1;
-webkit-transform: rotateX(-180deg);
-ms-transform: rotateX(-180deg);
-moz-transform: rotateX(-180deg);
transform: rotateX(-180deg);
background: url(http://placehold.it/300x300) no-repeat;
}
.wrapper:hover .front {
z-index: 1;
-webkit-transform: rotateX(180deg);
-ms-transform: rotateX(180deg);
-moz-transform: rotateX(180deg);
transform: rotateX(180deg);
}
.wrapper:hover .back {
z-index: 2;
-webkit-transform: rotateX(0deg);
-ms-transform: rotateX(0deg);
-moz-transform: rotateX(0deg);
transform: rotateX(0deg);
}
.flipscene3D:hover .flip {
/*transform*/
-webkit-transform: rotateX(180deg);
-moz-transform: rotateX(180deg);
-ms-transform: rotateX(180deg);
-o-transform: rotateX(180deg);
transform: rotateX(180deg);
filter: progid:DXImageTransform.Microsoft.Matrix(M11=-1,
M12=1.2246467991473532e-16,
M21=-1.2246467991473532e-16,
M22=-1,
SizingMethod='auto expand');
}

css card flip internet explorer

I'm stuck on this and I've run into a brick wall, all works in Chrome, FF, Safari etc but in Internet Explorer, I get the reverse side of the front image rather than backside text, please help!!! I'm sure there's a simple answer I've overlooked but I'm on a deadline and desperatly need to get this wrapped up.
Thanks in advance for any help :)
CSS
flip-container {
perspective: 1000px;
-webkit-perspective:1000px;
}
/* flip the pane when hovered */
.flip-container:hover .flipper, .flip-container.hover .flipper {
-webkit-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
transform: rotateY(180deg);
font-family: "Montserrat Alternates regular";
text-align: center;
}
.flip-container, .front, .back {
width: 250px;
height: 250px;
font-family: "Montserrat Alternates regular";
}
/* flip speed goes here */
.flipper {
-webkit-transition: 0.6s;
-ms-transition: 0.6s;
transition: 0.6s;
-webkit-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
transform-style: preserve-3d;
position: relative;
}
/* hide back of pane during swap */
.front, .back {
-webkit-backface-visibility:hidden;
-ms-backface-visibility:hidden;
backface-visibility: hidden;
margin: auto;
position: absolute;
top: 0;
left: 0;
}
/* front pane, placed above back */
.front {
z-index: 2;
border: 2px solid black;
border-radius: 30px;
-moz-border-radius: 30px;
-khtml-border-radius: 30px;
-webkit-border-radius: 30px;
-webkit-transform: rotateY(0deg);
-ms-transform: rotateY(0deg);
transform: rotateY(0deg);
width: 246px;
height: 246px;
}
/* back, initially hidden pane */
.back {
z-index:3;
background-color: #fff;
border: 2px solid black;
border-radius: 30px;
-moz-border-radius: 30px;
-khtml-border-radius: 30px;
-webkit-border-radius: 30px;
width: 246px;
height: 246px;
-webkit-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
transform: rotateY(180deg);
}
HTML:
<div class="grid-element">
<div class="flip-container" ontouchstart="this.classList.toggle('hover');">
<div class="flipper">
<div class="front" style="background: url('images/flip2.jpg');" />
<span style="font-family: 'Montserrat Alternates regular';
font-weight:bolder; text-align: center; position: relative; top: 190px; font-size:
18pt;">Who Are We?</span> </div>
<div class="back">
<div style="text-align: center; font-family: 'Montserrat Alternates regular';
font-size: 10pt; position: relative; top: 10px;margin-left:10px; margin-right:10px;
margin-top:10px;">Founded by writers Kurt McClung and Simon Mackenzie to offer
complete story solutions for ambitious entertainment in various media: from video
games to comic books, theater and screen, novels to song writing.</div>
<img src="images/kurt.png" style="position:absolute; top:155px; left:18px; width:75px;
height:75px"/>
<img src="images/simon.png" style="position:absolute; top:155px; left:152px;
width:75px; height:75px"/>
</div>
</div>
</div>
</div>
Target site : http://www.taliespin.com
try adding -ms-perspective:1000px; as well to the following
flip-container {
perspective: 1000px;
-webkit-perspective:1000px;
}
(i'm on a mac right now, can't test in IE so its a wild guess)

Images not showing up on some computers

This is my CSS for a concept I'm working on...
It displays the picture, and once you hover over the card it flips it. The problem I'm having is that it isn't working on SOME computers. Oddly enough, it doesn't work on one of my computers. It's windows XP. It doesn't work in any of the modern browsers. Another computer experienced it running OSX 10.5, and chrome. The problem being, you only see the backwards text of the , then if flip to the normal view.
.sleeve {
float: left;
margin: 5px;
width: 240px; height: 340px;
perspective: 1000px;
-webkit-perspective: 1000px;
-moz-perspective: 1000px;
-o-perspective: 1000px;
}
.card {
width: 240px;
height: 340px;
transform-style: preserve-3d;
transition: all 0.5s ease-in;
-webkit-transform-style: preserve-3d;
-webkit-transition: all 0.5s ease-in;
-moz-transform-style: preserve-3d;
-moz-transition: all 0.5s ease-in;
-o-transform-style: preserve-3d;
-o-transition: all 0.5s ease-in;
}
.sleeve:hover .card {
transform: rotateY(180deg);
box-shadow: -5px 5px 5px #333333;
-webkit-transform: rotateY(180deg);
-webkit-box-shadow: -5px 5px 5px #333333;
-moz-transform: rotateY(180deg);
-moz-box-shadow: -5px 5px 5px #333333;
-o-transform: rotateY(180deg);
-o-box-shadow: -5px 5px 5px #333333;
}
.face {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-o-backface-visibility: hidden;
}
.face.front img {
height: 340px;
width: 240px;
}
.face.back {
display: block;
transform: rotateY(180deg);
box-sizing: border-box;
-webkit-transform: rotateY(180deg);
-webkit-box-sizing: border-box;
-moz-transform: rotateY(180deg);
-moz-box-sizing: border-box;
-o-transform: rotateY(180deg);
-o-box-sizing: border-box;
border: 5px solid #000000;
padding: 5px 0 0 10px;
height: 340px;
width: 240px;
overflow: auto;
color: black;
text-align: left;
background-color: #FFFFFF;
}
If I add:
.face.front {
z-index=10;
}
It shows the picture, but when it flips, the image is just backwards.