Created
November 10, 2016 03:54
-
-
Save cahsowan/bace14e364926b883f00152375182b51 to your computer and use it in GitHub Desktop.
Belajar CSS Animation
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> | |
<meta charset="utf-8"> | |
<title>CSS Animation</title> | |
<style> | |
.kotak { | |
width: 100px; | |
height: 100px; | |
background: blue; | |
margin: 50px auto; | |
animation: membesar 1.5s infinite ease-in-out; | |
} | |
.benda { | |
width: 100px; | |
height: 100px; | |
background: none; | |
margin: 50px auto; | |
border: solid 1px #555; | |
border-radius: 50%; | |
position: relative; | |
animation: berputar 1.5s infinite ease-in-out; | |
} | |
.kecil { | |
width: 10px; | |
height: 10px; | |
background: red; | |
margin-left: 45px; | |
position: absolute; | |
top: -5px; | |
border-radius: 50%; | |
} | |
@keyframes berputar { | |
0% { transform: rotate(0); } | |
25% { transform: rotate(90deg); } | |
50% { transform: rotate(180deg); } | |
74% { transform: rotate(270deg); } | |
100% { transform: rotate(360deg); } | |
} | |
@keyframes membesar { | |
0% { transform: scale(0); } | |
100% { transform: scale(1); opacity: 0.5; } | |
} | |
</style> | |
</head> | |
<body> | |
<div class="benda"> | |
<div class="kecil"></div> | |
</div> | |
<hr> | |
<div class="kotak"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment