Created
December 18, 2012 10:40
-
-
Save pehaa/4327002 to your computer and use it in GitHub Desktop.
The first commented line is your dabblet’s title
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
.container { | |
margin:100px auto; | |
width: 200px; | |
height: 50px; | |
position: relative; | |
perspective: 2000px; | |
overflow:hidden; | |
} | |
#cube { | |
width: 100%; | |
height: 100%; | |
position: absolute; | |
transform-style: preserve-3d; | |
display:block; | |
text-align:center; | |
line-height:50px; | |
color:#fff; | |
} | |
#cube span { | |
background:pink; | |
width: 100%; | |
height: 100%; | |
display: block; | |
position: absolute; | |
transition:all 1s; | |
} | |
#cube span {background:pink; color:red} | |
#cube span { transform: rotateY( 0deg ) translateZ( 25px ); } | |
#cube:after {content:"This is a link"; background:red; width: 100%; | |
height: 100%; | |
display: block; | |
position: absolute;transform: rotateX( -90deg ) translateZ( 25px );} | |
#cube { transform: translateZ( -25px ); } | |
#cube:hover | |
{ transform: translateZ( -25px ) rotateX( 90deg ); } | |
#cube:hover span {background:red; color:pink} | |
#cube { transition: transform .6s; } | |
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
<!-- content to be placed inside <body>…</body> --> | |
<section class="container"> | |
<a href="#" id="cube"> | |
<span class="front">This is a link</span> | |
</a> | |
</section> | |
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
// alert('Hello world!'); |
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
{"view":"split-vertical","fontsize":"80","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment