Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Kelvin Atawura
Front End Web Development Techdegree Student 19,022 Pointshow can l keep the boat going forward without any jump in keyframe?
l want to keep my boat moving infinitely and not stop. this is my code below but dont seem to work. any help would be great. thanks guys
body {
background: #F0FCFF url('http://treehouse-code-samples.s3.amazonaws.com/CSS-DD/codepen/stage-12/island.png') repeat-x 100% -460px;
background-size: 760px;
}
.boat {
width: 100px;
position: absolute;
top: 40%;
left: 35%;
}
.boat img {
width 100%;
}
.boat::after {
content: "";
display: block;
width:120px;
height: 120px;
background: url('http://treehouse-code-samples.s3.amazonaws.com/CSS-DD/codepen/stage-12/steam.png') no-repeat;
background-size: 120px;
position: absolute;
top: -25%;
left: 5%;
opacity: 0;
}
/* Animations - WebKit only
------------------------------------------ */
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;
}
/* Keyframes - WebKit only
------------------------------------------ */
@-webkit-keyframes rock-boat {
50% { -webkit-transform: rotate(-5deg) translateY(-10px); }
}
@-webkit-keyframes steam {
40%,
60% { opacity: 1; }
100% { -webkit-transform: translate(-15%, -35%) rotateZ(20deg); }
}
@-webkit-keyframes bg-move {
0% { background-position: 100% -560px; }
100% { background-position: -8000px -460px; }
}