Created
June 20, 2013 14:17
-
-
Save btotr/5823104 to your computer and use it in GitHub Desktop.
A CodePen by Colin Meerveld. blur
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
<svg xmlns="http://www.w3.org/2000/svg" | |
width="400" | |
height="400" | |
xmlns:xlink="http://www.w3.org/1999/xlink"> | |
<defs> | |
<filter id="blur"> | |
<feGaussianBlur stdDeviation="10 2"/> | |
</filter> | |
</defs> | |
<rect x="10" y="10" | |
width="100" height="100" | |
rx="15" ry="15"/> | |
</svg> |
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
document.addEventListener("keydown", function(e){ | |
document.getElementsByTagName("svg")[0].classList.toggle("move"); | |
}, false); |
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
svg { | |
-webkit-transform: translate3D(0, 0, 0); | |
-webkit-transition: -webkit-transform 320ms ease-out; | |
} | |
svg.move { | |
-webkit-transform: translate3d(400px,0px,0); | |
} | |
svg rect { | |
fill:red; | |
} | |
svg.move rect { | |
filter:url(#blur); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment