Created
December 26, 2012 10:10
-
-
Save Antonio-Laguna/4379381 to your computer and use it in GitHub Desktop.
Sencilla animación CSS
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
/** | |
* Sencilla animación CSS | |
*/ | |
body { | |
background: #EFEFEF; | |
} | |
div.recuadro { | |
background: #fff; | |
margin: 0 300px; | |
width: 100px; | |
padding: 25px; | |
text-align: center; | |
-webkit-border-radius: 5px; | |
-moz-border-radius: 5px; | |
border-radius: 5px; | |
-webkit-box-shadow: rgba(0,0,0,0.2) 0px 1px 3px; | |
-moz-box-shadow: rgba(0,0,0,0.2) 0px 1px 3px; | |
box-shadow: rgba(0,0,0,0.2) 0px 1px 3px; | |
} | |
@keyframes "agrandar" { | |
0%, 20%, 40%, 60%, 80%, 100% { | |
-webkit-transform: scale(1.0); | |
-ms-transform: scale(1.0); | |
transform: scale(1.0); | |
} | |
10%, 30%, 50%, 70%, 90% { | |
-webkit-transform: scale(1.5); | |
-ms-transform: scale(1.5); | |
transform: scale(1.5); | |
} | |
} | |
@-webkit-keyframes "agrandar" { | |
0%, 20%, 40%, 60%, 80%, 100% { | |
-webkit-transform: scale(1.0); | |
transform: scale(1.0); | |
} | |
10%, 30%, 50%, 70%, 90% { | |
-webkit-transform: scale(1.5); | |
transform: scale(1.5); | |
} | |
} | |
/* Elemento al que asociamos la animación */ | |
.recuadro:hover { | |
-webkit-animation-name: 'agrandar'; | |
animation-name: 'agrandar'; | |
animation-duration: 3s; | |
-webkit-animation-duration: 3s; | |
-webkit-animation-iteration-count: 2; | |
animation-iteration-count: 2; | |
-webkit-animation-timing-function: ease; | |
animation-timing-function: ease; | |
-webkit-transform: scale(1.5); | |
-ms-transform: scale(1.5); | |
transform: scale(1.5); | |
} | |
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
<div class="recuadro">Pasa el cursor por encima</div> |
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","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment