Created
August 21, 2018 14:16
-
-
Save redknitin/98ecbbf25ba84787f4e8736525e26f3e to your computer and use it in GitHub Desktop.
CSS Animation - Translation and Opacity
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
<!doctype html><html> | |
<head> | |
<title></title> | |
<style> | |
body { | |
background-color: black; | |
} | |
@keyframes wiggum { | |
0% { transform: translateX(0px); } | |
25% { transform: translateY(400px); opacity: 0.05; } | |
100% { transform: translateY(400px) translateX(800px); } | |
} | |
#a1 { | |
margin-left: 0px; | |
animation: wiggum 10s linear 1s infinite alternate; | |
} | |
@keyframes example { | |
from {background-color: red;} | |
to {background-color: blue;} | |
} | |
/* The element to apply the animation to */ | |
div { | |
width: 100px; | |
height: 100px; | |
background-color: red; | |
animation-name: example; | |
animation-duration: 4s; | |
} | |
</style> | |
<script></script> | |
</head> | |
<body> | |
<div id="a1"> | |
... | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment