Skip to content

Instantly share code, notes, and snippets.

@stresslimit
Last active August 29, 2015 13:57
Show Gist options
  • Save stresslimit/9588754 to your computer and use it in GitHub Desktop.
Save stresslimit/9588754 to your computer and use it in GitHub Desktop.
cloud float css anim
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
<style>
/* define the floating animation; just a simple position shift */
@-webkit-keyframes cloud_floating {
0% { left: -5%; }
100% { left: 105%; }
}
/* style for banner container */
.cloud_floating_container {
position: relative;
background:#efefef;
color:#fff;
height:100px;
}
/* basic cloud element. put bg img stuff here. for now i've used font-awesome */
.cloud {
position:absolute;
display:block;
font-size:200%;
-webkit-animation: cloud_floating 40s linear infinite;
top:10px;
}
/* altering size, alignment and initial position */
.cloud2 {
font-size:5em;
-webkit-animation-duration:60s;
-webkit-animation-delay: -5s;
top:10px;
}
.cloud3 {
font-size:2em;
-webkit-animation-duration: 50s;
-webkit-animation-delay: -20s;
top:auto;
bottom:10px;
}
.cloud4 {
font-size:3em;
-webkit-animation-duration: 70s;
-webkit-animation-delay: -40s;
top:auto;
bottom:10px;
}
</style>
</head>
<body>
<div class="cloud_floating_container">
<i class="icon-cloud cloud"></i>
<i class="icon-cloud cloud cloud2"></i>
<i class="icon-cloud cloud cloud3"></i>
<i class="icon-cloud cloud cloud4"></i>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment