Created
August 4, 2013 22:33
-
-
Save mcamiano/6152223 to your computer and use it in GitHub Desktop.
A CSS transition effect to mimic slowly expanding/contracting movie titles.
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
<style> | |
hr { | |
margin-top: 2em; | |
} | |
.inflate, .deflate { | |
font-size: 4em; | |
width: 50%; | |
hideborder: solid thin red; | |
text-align: center; | |
margin-left: 25%; | |
margin-top: 1em; | |
transition: color 12s, tranform 12s; | |
-webkit-transition: color 12s, -webkit-transform 12s; | |
} | |
.inflates:hover .deflate { | |
transform-origin: center center; | |
-webkit-transform-origin: center center; | |
transform: scale(0.83,0.83); | |
-webkit-transform: scale(0.83,0.83); | |
color: red; | |
} | |
.inflates:hover .inflate { | |
transform-origin: center center; | |
-webkit-transform-origin: center center; | |
transform: scale(1.2,1.2); | |
-webkit-transform: scale(1.2,1.2); | |
color: red; | |
} | |
h2.deflate { | |
font-size: 4em; | |
} | |
</style> | |
<div class='inflates'> | |
<h1 class='inflate'>Hello</h1> | |
<hr /> | |
<h2 class='deflate'>World</h2> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See http://jsfiddle.net/mcamiano/Wzf8H/ for a working example.