Created
November 19, 2015 01:05
-
-
Save PseudoSky/44a94d29e7f448719d5f to your computer and use it in GitHub Desktop.
CSS Perspective Transformation Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rotZ = 0; | |
var rotZ = 0; | |
var rotZ = 0; | |
var persp= 0; | |
var image = document.getElementById('image'); | |
var funk=function(){ | |
image.style.transform="translateX(-96px) translateY(0px) translateZ(0px) rotateX("+rotX+"deg) rotateY("+rotY+"deg) rotateZ(" +rotZ+"deg)"; | |
rotZ+=.5; | |
rotX+=.7; | |
rotY+=1; | |
persp=(persp%800)+5; | |
image.style["-webkit-perspective"]= persp; | |
image.style["-moz-perspective"]= persp+"px"; | |
image.style["-ms-perspective"]= persp; | |
image.style.perspective= persp; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment