Quickly create responsive HTML emails that work on any device & client. Even Outlook.
http://zurb.com/ink
http://zurb.com/ink
I'm Nassim, a web developer and I'm sharing with you some programming tips and tricks
#back {
width: 600px;
height: 500px;
background: rgba(0,100,120,1);
text-align: center;
-webkit-transform: translateZ(-49px); // on place le fond à -49
}
#front {
width: 600px;
height: 500px;
background: url('../stripe.png') no-repeat bottom;
-webkit-transform: translateZ(50px); // on place le premier plan à 50
}
#wall-left {
height: 500px;
width: 100px;
left: 0px;
background: #bbb;
// le mur gauche est placé sur l'axe X puis tourné sur l'axe Y de 90 degrés
-webkit-transform: translateX(-50px) rotate3d(0, 50, 0, 90deg);
}
#wall-right {
height: 500px;
width: 100px;
right: 0px;
background: #bbb;
// on fait de même pour le mur droit en inversant l'angle de rotation
-webkit-transform: translateX(50px) rotate3d(0, 50, 0, -90deg);
}
#wall-top {
height: 100px;
width: 600px;
top: 0px;
background: #999;
-webkit-transform: translateY(-50px) rotate3d(50, 0, 0, 90deg);
}
#wall-bottom {
height: 100px;
width: 600px;
bottom: 0px;
background: #999;
-webkit-transform: translateY(50px) rotate3d(50, 0, 0, -90deg);
}function onMouseMove( event ) {
perspective.tx = Math.round( ( event.clientX / window.innerWidth ) * 100 );
perspective.ty = Math.round( ( event.clientY / window.innerHeight ) * 100 );
};
function update() {
// Interpolate towards the target perspective
perspective.cx += ( perspective.tx - perspective.cx ) * 0.1;
perspective.cy += ( perspective.ty - perspective.cy ) * 0.1;
// Apply the current perspective
world.style.webkitPerspectiveOrigin = perspective.cx + '% ' + perspective.cy + '%';
world.style.perspectiveOrigin = perspective.cx + '% ' + perspective.cy + '%';
// Rinse, repeat
setTimeout( update, 1000 / 30 );
}function onMotionChange( event ) {
if ( orientation ) {
var beta = -event.accelerationIncludingGravity.z;
var gamma = -event.accelerationIncludingGravity.y;
}else {
var beta = -event.accelerationIncludingGravity.z;
var gamma = -event.accelerationIncludingGravity.x;
}
perspective.tx = ( ( gamma / 5 ) + 0.5 ) * 100;
perspective.ty = ( ( beta / 5 ) - 0.5 ) * 100;
event.preventDefault();
}