Skip to content

Instantly share code, notes, and snippets.

Created October 28, 2012 04:16
Show Gist options
  • Save anonymous/3967481 to your computer and use it in GitHub Desktop.
Save anonymous/3967481 to your computer and use it in GitHub Desktop.
A CodePen by Anonymous. Folding letters
<h1>typography</h1>
$("h1").children().andSelf().contents().each(function(){
if (this.nodeType == 3) {
var $this = $(this);
$this.replaceWith($this.text().replace(/(\w)/g, "<span>$&</span>"));
}
});
@import url(http://fonts.googleapis.com/css?family=Open+Sans:800);
body {
font-family: 'Open Sans';
padding: 20px;
background: #9ef5ff;
}
h1 {
width: 13em;
text-align: center;
font-size: 70px;
font-weight: 800;
padding: 0;
margin: 0 auto;
text-transform: uppercase;
-webkit-perspective: 800px;
}
h1 span {
display: inline-block;
text-align: center;
width: 1.25em;
color: #FFF;
margin: 0 1px;
position: relative;
}
h1 span {
background: #ff69b3;
transform: skew(-10deg, -90deg);
-webkit-transform: rotateX( 45deg );
box-shadow: 0px 10px 0px -1px rgba(0,0,0,0.5);
z-index: 2;
transition: all 2s ease-in-out 10ms;
}
h1 span:hover{
z-index:100;
x-webkit-transform: rotateX(0deg);
top: -.25em;
-webkit-animation: rotate 1s ease-in-out;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment