Skip to content

Instantly share code, notes, and snippets.

@alyssaq
Last active February 13, 2024 07:57
Show Gist options
  • Save alyssaq/cc19d25ca20f8b2b989d to your computer and use it in GitHub Desktop.
Save alyssaq/cc19d25ca20f8b2b989d to your computer and use it in GitHub Desktop.
Bouncing smiley face
.smile {
position: absolute;
top: 0;
left: 60%;
width: 100px;
height: 100px;
margin-left: -50px;
}
@-webkit-keyframes circle {
from {
-webkit-transform:
rotate(0deg)
translate(-300px)
rotate(0deg)
}
to {
-webkit-transform:
rotate(360deg)
translate(200px)
rotate(-360deg)
}
}
.smile {
top: 200px;
-webkit-animation: circle 3s ease-in-out infinite;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<img src="http://www.konnectafrica.net/wp-content/uploads/2013/11/Laughing-smiley-face-2.png" alt=":)" class="smile">
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment