Created
April 25, 2015 21:51
-
-
Save asanocorp/ebcd31076f937cb7a038 to your computer and use it in GitHub Desktop.
Full-page Animation - Part 3
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="boat"> | |
<img src="http://treehouse-code-samples.s3.amazonaws.com/CSS-DD/codepen/stage-12/boat.png" alt="tugboat"> | |
</div> | |
<img class="mike" src="http://treehouse-code-samples.s3.amazonaws.com/CSS-DD/codepen/stage-12/mike.png"> |
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
/* Animations | |
------------------------------------------ */ | |
body { | |
-webkit-animation: bg-move 8s ease-out forwards; | |
} | |
.boat { | |
-webkit-animation: rock-boat 3s ease-in-out infinite; | |
} | |
.boat::after { | |
-webkit-animation: steam 4s 2s infinite; | |
} | |
.mike { | |
-webkit-animation: mike-move 6s 6s ease-out forwards, | |
mike-float 3.2s infinite; | |
} | |
/* Keyframes - WebKit only | |
------------------------------------------ */ | |
@-webkit-keyframes rock-boat { | |
50% { -webkit-transform: rotate(-5deg) translateY(-10px); } | |
} | |
@-webkit-keyframes steam { | |
40%, | |
60% { opacity: .8; } | |
100% { -webkit-transform: translate(-15%, -35%) rotateZ(20deg); } | |
} | |
@-webkit-keyframes bg-move { | |
0% { background-position: 100% -560px; } | |
100% { background-position: -350% -460px; } | |
} | |
@-webkit-keyframes mike-move { | |
100% { left: 12%; } | |
} | |
@-webkit-keyframes mike-float { | |
50% { -webkit-transform: rotateZ(5deg) translateY(-5px); } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment