Làm chiếc xe ô tô chuyển động giống 2020.yp.vn (ok)
Last updated
Last updated
<a href="https://2020.yp.vn/quang-cao-tren-thanh-xe-buy">
<div id="bgbus">
<h2 id="adshotbus">Quảng cáo trên thành xe buýt</h2>
<img src="https://2020.yp.vn/wp-content/uploads/2020/05/bus-run-2.png" class="car">
</div>
</a>
@-webkit-keyframes animate {
from {
background-position: 0 0;
}
to {
background-position: 100% 0;
}
}
@keyframes animate {
from {
background-position: 0 0;
}
to {
background-position: 100% 0;
}
}
@-webkit-keyframes tadact {
0% {
-webkit-transform:translateX(-50%) scaleX(1);
transform:translateX(-50%) scaleX(1)
}
10%,
20% {
-webkit-transform: translateX(-50%) scale3d(.9, .9, .9) rotate(-3deg);
transform: translateX(-50%) scale3d(.9, .9, .9) rotate(-3deg)
}
30%,
50%,
70%,
90% {
-webkit-transform: translateX(-50%) scale3d(1.1, 1.1, 1.1) rotate(3deg);
transform: translateX(-50%) scale3d(1.1, 1.1, 1.1) rotate(3deg)
}
40%,
60%,
80% {
-webkit-transform: translateX(-50%) scale3d(1.1, 1.1, 1.1) rotate(-3deg);
transform: translateX(-50%) scale3d(1.1, 1.1, 1.1) rotate(-3deg)
}
to {
-webkit-transform:translateX(-50%) scaleX(1);
transform:translateX(-50%) scaleX(1)
}
}
@keyframes tadact {
0% {
-webkit-transform:translateX(-50%) scaleX(1);
transform:translateX(-50%) scaleX(1)
}
10%,
20% {
-webkit-transform: translateX(-50%) scale3d(.9, .9, .9) rotate(-3deg);
transform: translateX(-50%) scale3d(.9, .9, .9) rotate(-3deg)
}
30%,
50%,
70%,
90% {
-webkit-transform: translateX(-50%) scale3d(1.1, 1.1, 1.1) rotate(3deg);
transform: translateX(-50%) scale3d(1.1, 1.1, 1.1) rotate(3deg)
}
40%,
60%,
80% {
-webkit-transform: translateX(-50%) scale3d(1.1, 1.1, 1.1) rotate(-3deg);
transform: translateX(-50%) scale3d(1.1, 1.1, 1.1) rotate(-3deg)
}
to {
-webkit-transform:translateX(-50%) scaleX(1);
transform:translateX(-50%) scaleX(1);
}
}
#bgbus {
position: relative;
background-image: url(http://phpcoder.tech/html-css/city.jpg);
height: 350px;
background-size: cover;
background-position: 0 0;
background-repeat: repeat-x;
animation: animate 15s linear infinite;
}
#bgbus .car {
position: absolute;
bottom: 15px;
left: 50%;
-webkit-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%);
}
#adshotbus {
position: absolute;
top: 10%;
left: 50%;
font-size: 40px;
font-weight: 700;
animation: tadact 4s linear infinite;
color: #4881d6;
}
Tham khảo 1:
<div class="country-wrap">
<!--<div class="mountain-1"></div>
<div class="mountain-2"></div>-->
<div class="sun"></div>
<div class="grass"></div>
<div class="street">
<div class="car">
<!--<div class="car-base"></div>-->
<div class="car-body">
<div class="car-top-back">
<div class="back-curve"></div>
</div>
<div class="car-gate"></div>
<div class="car-top-front">
<div class="wind-sheild"></div>
</div>
<div class="bonet-front"></div>
<div class="stepney"></div>
</div>
<div class="boundary-tyre-cover">
<div class="boundary-tyre-cover-back-bottom"></div>
<div class="boundary-tyre-cover-inner"></div>
</div>
<div class="tyre-cover-front">
<div class="boundary-tyre-cover-inner-front"></div>
</div>
<div class="base-axcel">
</div>
<div class="front-bumper"></div>
<div class="tyre">
<div class="gap"></div>
</div>
<div class="tyre front">
<div class="gap"></div>
</div>
<div class="car-shadow"></div>
</div>
</div>
<div class="street-stripe"></div>
<div class="hill">
<!--<div class="tree-1">
<div class="branch-1"></div>
<div class="branch-2"></div>
<div class="branch-3"></div>
</div>
<div class="tree-1">
<div class="branch"></div>
<div class="trunk"></div>
</div>-->
</div>
</div>
@charset "utf-8";
/* CSS Document */
body, html {
height: 100%;
}
body {
background: rgb(209,228,234);
background: -moz-radial-gradient(center, ellipse cover, rgba(209,228,234,1) 0%, rgba(186,228,244,1) 100%);
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,rgba(209,228,234,1)), color-stop(100%,rgba(186,228,244,1)));
background: -webkit-radial-gradient(center, ellipse cover, rgba(209,228,234,1) 0%,rgba(186,228,244,1) 100%);
background: -o-radial-gradient(center, ellipse cover, rgba(209,228,234,1) 0%,rgba(186,228,244,1) 100%);
background: -ms-radial-gradient(center, ellipse cover, rgba(209,228,234,1) 0%,rgba(186,228,244,1) 100%);
background: radial-gradient(ellipse at center, rgba(209,228,234,1) 0%,rgba(186,228,244,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d1e4ea', endColorstr='#bae4f4',GradientType=1 );
padding:0;
margin:0;
}
.country-wrap {
position:relative;
width:100%;
height:100%;
overflow:hidden;
}
.push-bottom {
position:absolute;
bottom:0;
height:100%;
}
.bottom-ground {
background:#8d773e;
width:102%;
left:-1%;
height:60px;
bottom:0;
position:absolute;
box-shadow:0 2px 3px rgba(0,0,0,0.2) inset;
}
.street {
background:#7a7a7a url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo9/WUMZHlgr4Bg8Z4qQgQJlHI4A8SzFVrapvmTF9O7dmYRFZ60YiBhJRCgh1FYhiLAmdvX0CzTOpNE77ME0Zty/nWWzchDtiqrmQDeuv3powQ5ta2eN0FY0InkqDD73lT9c9lEzwUNqgFHs9VQce3TVClFCQrSTfOiYkVJQBmpbq2L6iZavPnAPcoU0dSw0SUTqz/GtrGuXfbyyBniKykOWQWGqwwMA7QiYAxi+IlPdqo+hYHnUt5ZPfnsHJyNiDtnpJyayNBkF6cWoYGAMY92U2hXHF/C1M8uP/ZtYdiuj26UdAdQQSXQErwSOMzt/XWRWAz5GuSBIkwG1H3FabJ2OsUO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hRIjTok8i+algT1lTHi4SxFvONKNrgQFAq2/gFnWMXgwffgYMJpiKYkmW3tTg3ZQ9Jq+f8XN+A5eeUKHWvJWJ2sgJ1Sop+wwhqFVijqWaJhwtD8MNlSBeWNNWTa5Z5kPZw5+LbVT99wqTdx29lMUH4OIG/D86ruKEauBjvH5xy6um/Sfj7ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhSnO3Wp/3fEV5a+4wz//6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg==);
height:80px;
width:102%;
position:absolute;
bottom:0;
box-shadow:0 1px 16px rgba(111, 35, 51, 0.4) inset;
}
.street:after {
content:'';
display:block;
position:absolute;
width:100%;
height:10px;
background:#cdbcb4;
bottom:0;
border-bottom:3px solid #72625a;
z-index:1;
}
.street:before {
content:'';
display:block;
position:absolute;
width:100%;
height:7px;
background:#c2a99d;
bottom:-7px;
z-index:1;
}
.street-stripe {
background:#d4d4d4;
height:8px;
width:100px;
position:absolute;
bottom:44px;
border-radius:2px;
box-shadow:200px 0 0 #d4d4d4, 400px 0 0 #d4d4d4 , 600px 0 0 #d4d4d4 , 800px 0 0 #d4d4d4 , 1000px 0 0 #d4d4d4 , 1200px 0 0 #d4d4d4 , 1400px 0 0 #d4d4d4 , 1600px 0 0 #d4d4d4 , 1800px 0 0 #d4d4d4 , 2000px 0 0 #d4d4d4;
}
.grass {
height: 40px;
width: 100%;
background-color: #dbcac2;
position:absolute;
bottom:60px;
}
.grass:before {
position: absolute;
content: '';
top: 14px;
left: 0;
height: 8px;
width: 100%;
background-color: #b99f93;
}
.grass:after {
position: absolute;
content: '';
top: -4px;
left: 0;
width: 100%;
height: 8px;
background-color: #0aa;
background: linear-gradient(135deg, transparent 25%, #0aa 25%);
background-size:10px 10px;
}
.sun {
background:#ff9944;
width:40px;
height:40px;
border-radius:50%;
box-shadow:0 0 50px rgba(255,153,68,0.7);
position:absolute;
left:49%;
bottom:350px;
}
.tree-1 {
position:absolute;
z-index:2;
bottom:210px;
right:10px;
width:50px;
height:100px;
}
.trunk {
width:20%;
height:30%;
background:brown;
}
.branch {
position:abslute;
width:60%;
height:30%;
background:green;
-moz-transform:rotate(45deg);
border-radius:0 0 100% 0;
}
.branch-1 {
border:50px solid;
border-bottom:90px solid;
border-color:transparent transparent #a5894a transparent;
height: 0;
width: 0;
position:absolute;
left:-50px;
top:-70px;
}
.branch-2 {
border-bottom: 40px solid #9d8346;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
height: 0;
width: 100px;
position:absolute;
top:60px;
left:-80px;
}
.branch-3 {
border-bottom: 50px solid #90713b;
border-left: 40px solid transparent;
border-right: 40px solid transparent;
height: 0;
width: 100px;
position:absolute;
top:100px;
left:-90px;
}
.mountain-1 {
background:#cea392;
width:500px;
height:500px;
position:absolute;
-moz-transform:rotate(45deg);
-webkit-transform:rotate(45deg);
bottom:-150px;
border-radius:40px;
}
.mountain-2 {
background:#e4dbd2;
width:800px;
height:800px;
position:absolute;
-moz-transform:rotate(45deg);
-webkit-transform:rotate(45deg);
bottom:-350px;
border-radius:40px;
left:250px;
z-index:-1;
box-shadow: 0 0 25px #e4dbd2;
opacity:0.6;
}
.la {
position: absolute;
bottom: 200px;
width: 2px;
height: 50px;
background: $cd;
margin-right: 20px;
}
.la:before {
top: 5px;
left: -10px;
width: 22px;
height: 2px;
background: $cd;
}
.la:after {
bottom: 0;
left: -2px;
width: 6px;
height: 12px;
background: $cd;
}
.l {
position: absolute;
width: 5px;
height: 5px;
border-radius: 50%;
background: #fff;
box-shadow: 0 0 10px #fff, 0 0 25px #fff, 0 0 50px #fff;
}
.l:nth-child(1) { left: -10px; }
.l:nth-child(2) { right: -10px; }
/*styles for car*/
.car {
position:absolute;
top:-35%;
z-index:10;
-moz-animation:myfirst 10s linear infinite;
-webkit-animation:myfirst 10s linear infinite;
}
@-moz-keyframes myfirst
{
0% {left:-25%;}
100% {left:100%;}
}
@-webkit-keyframes myfirst
{
0% {left:-25%;}
100% {left:100%;}
}
.tyre {
width:30px;
height:30px;
border-radius:50%;
background:#3f3f40;
position:absolute;
z-index:2;
left:9px;
top:20px;
-moz-animation:tyre-rotate 1s infinite linear;
-webkit-animation:tyre-rotate 1s infinite linear;
}
@-moz-keyframes tyre-rotate {
from{-moz-transform:rotate(-360deg);}
to{-moz-transform:rotate(0deg);}
}
@-webkit-keyframes tyre-rotate {
from{-webkit-transform:rotate(-360deg);}
to{-webkit-transform:rotate(0deg);}
}
.tyre:before {
content:'';
width:20px;
height:20px;
border-radius:50%;
background:#bdc2bd;
position:absolute;
top:5px;
left:5px;
}
.gap {
background:#3f3f40;
width:2px;
height:4px;
position:absolute;
left:14px;
top:8px;
box-shadow:0 9px 0 #3f3f40;
}
.gap:before {
content:'';
display:block;
width:2px;
height:4px;
position:absolute;
background:#3f3f40;
box-shadow:0 12px 0 #3f3f40;
-webkit-transform:rotate(-90deg);
-webkit-transform-origin:0 7px;
-moz-transform:rotate(-90deg);
-moz-transform-origin:0 7px;
z-index:3;
}
.car-base {
position:absolute;
display:block;
width: 125px;
height: 30px;
background:#000000;
border-radius: 10% 10% 50% 50% / 60% 100% 20% 10%;
-webkit-transform:rotate(-2deg);
-moz-transform:rotate(-2deg);
border:solid;
border-color:#000000;
}
.back-bonet {
background: #4c4b4b;
border-radius: 54% 25% 0 0;
height: 22px;
left: 11px;
position: absolute;
top: 8px;
width: 40px;
}
.tyre.front {
left:94px;
}
.car-body {
/*width:125px;
height:24px;
background:#d1352b;
border-top:1px solid #a82e27;*/
border-bottom: 24px solid #d1352b;
height: 0;
top:10px;
width: 120px;
position:relative;
}
.car-body:before {
content:'';
display:inline-block;
width:30px;
height:24px;
position:absolute;
right:-5px;
background:#d1352b;
border-top-right-radius:4px;
z-index:1;
}
.car-body:after {
content:'';
display:inline-block;
width:121px;
border-bottom: 1px solid #942b25;
border-right: 2px solid transparent;
height: 0;
z-index:2;
position:absolute;
}
.car-gate {
width:32px;
height:20px;
background:#d1352b;
border-radius:0 0 2px 8px / 0 0 2px 8px;
box-shadow:0 0 0 1px #892924;
position:absolute;
left:48px;
}
.car-gate:before {
content:'';
width:8px;
height:2px;
background:#4c4b4b;
position:absolute;
top:2px;
left:4px;
box-shadow:1px 1px 1px rgba(0,0,0,0.1);
}
.car-top-back {
background: none repeat scroll 0 0 #4C4B4B;
border-radius: 5px 0 0 0;
height: 20px;
left: 4px;
position: absolute;
top: -20px;
width: 58px;
}
.car-top-back:before {
width:30px;
height:15px;
background:#736f6f;
content:'';
position:absolute;
top:3px;
left:8px;
border-radius:2px;
}
.car-top-back:after {
content:'';
background:#4c4b4b;
border-radius: 30%;
height: 5px;
left: 3px;
position: absolute;
top: -1px;
width: 62px;
}
.car-top-front {
top:-19px;
position:absolute;
left:47px;
width:20px;
height:20px;
background:#dc4630;
border-left: 1px solid #892924;
border-radius: 2px 0 0 0;
}
.car-top-front:after {
width:26px;
height:20px;
-webkit-transform:skew(37deg);
-moz-transform:skew(37deg);
background:#dc4630;
content:'';
position:absolute;
top:0;
left:6px;
border-radius:4px 0 4px 4px;
}
.car-top-front:before {
width:12px;
height:5px;
background:#dc4630;
content:'';
position:absolute;
top:14px;
left:28px;
z-index:1;
border:solid #a82e27;
border-width:0 1px 1px 0;
}
.wind-sheild {
top:3px;
left:3px;
position:absolute;
z-index:3;
width:18px;
height:12px;
background:#f5e7e7;
border-radius:0 3px 0 0;
}
.wind-sheild:after {
width:12px;
height:12px;
-webkit-transform:skew(25deg);
-moz-transform:skew(25deg);
background:#f5e7e7;
content:'';
position:absolute;
top:0;
left:10px;
border-radius:3px;
}
.boundary-tyre-cover {
position:absolute;
top:14px; left:10px;
border-bottom: 20px solid #4c4b4b;
border-right: 10px solid transparent;
height:0;
width:20px;
}
.boundary-tyre-cover:before {
content:'';
position:absolute;
display:inline-block;
background:#4c4b4b;
height:20px;
width:15px;
-webkit-transform:skewX(-20deg);
-moz-transform:skewX(-20deg);
border-radius:3px;
left:-6px;
top:0;
}
.boundary-tyre-cover:after {
content:'';
position:absolute;
display:inline-block;
background:#4c4b4b;
height:20px;
width:20px;
-webkit-transform:skewx(40deg);
-moz-transform:skewX(40deg);
border-radius:3px;
right:-14px;
top:0;
}
.boundary-tyre-cover-inner {
position:absolute;
top:4px; left:4px;
border-bottom: 16px solid black;
border-right: 10px solid transparent;
height:0;
width:15px;
z-index:2;
}
.boundary-tyre-cover-inner:before {
content:'';
position:absolute;
display:inline-block;
background:black;
height:16px;
width:15px;
-webkit-transform:skewX(-20deg);
-moz-transform:skewX(-20deg);
border-radius:3px 3px 0 0;
left:-6px;
top:0;
}
.boundary-tyre-cover-inner:after {
content:'';
position:absolute;
display:inline-block;
background:black;
height:16px;
width:20px;
-webkit-transform:skewx(40deg);
-moz-transform:skewX(40deg);
border-radius:3px 3px 0 0;
right:-11px;
top:0;
}
.boundary-tyre-cover-back-bottom {
position: absolute;
width: 14px;
height: 8px;
background: #4c4b4b;
top: 12px;
left: -19px;
}
.bonet-front {
background: #d1352b;
border-radius: 5px 258px 0 38px / 36px 50px 0 0;
height: 4px;
position: absolute;
right: 0;
top: -4px;
width: 40px;
z-index: 0;
}
.back-curve {
background: none repeat scroll 0 0 #4C4B4B;
border-radius: 960% 100% 0 0;
height: 20px;
left: -3px;
position: absolute;
top: 1px;
transform: rotate(6deg);
width: 5px;
}
.stepney {
height: 6px;
left: -4px;
position: absolute;
top: 6px;
width: 8px;
z-index: -1;
background:#3f3f40;
}
.stepney:before {
width:8px;
height:12px;
background:#3f3f40;
content:'';
position:absolute;
top:-10px;
left:-7px;
border-radius:3px 3px 0 0;
}
.stepney:after {
width:8px;
height:12px;
background:#0d0c0d;
content:'';
position:absolute;
top:0px;
left:-7px;
border-radius:0 0 3px 3px;
}
.tyre-cover-front {
background:#4c4b4b;
height: 4px;
left: 97px;
position: absolute;
top: 13px;
width: 22px;
z-index: 1;
}
.tyre-cover-front:before {
background: none repeat scroll 0 0 #4c4b4b;
content: "";
display: inline-block;
height: 21px;
left: -10px;
position: absolute;
top: 0;
transform: skewX(-30deg);
width: 10px;
z-index: 6;
border-radius:4px 0 0 0;
}
.tyre-cover-front:after {
background: none repeat scroll 0 0 #4c4b4b;
content: "";
display: inline-block;
height: 6px;
left: 14px;
position: absolute;
top: 0;
transform: skewX(30deg);
width: 17px;
z-index: 6;
border-radius:0 4px 2px 0;
}
.boundary-tyre-cover-inner-front {
position:absolute;
top:4px; left:4px;
border-bottom: 16px solid black;
border-right: 10px solid transparent;
height:0;
width:15px;
z-index:7;
}
.boundary-tyre-cover-inner-front:before {
background: none repeat scroll 0 0 #000000;
border-radius: 3px 3px 0 0;
content: "";
display: inline-block;
height: 17px;
left: -10px;
position: absolute;
top: 0;
transform: skewX(-30deg);
width: 15px;
}
.boundary-tyre-cover-inner-front:after {
content:'';
position:absolute;
display:inline-block;
background:black;
height:16px;
width:20px;
-webkit-transform:skewx(25deg);
-moz-transform:skewX(25deg);
border-radius:3px 3px 0 0;
right:-12px;
top:0;
}
.base-axcel {
background: none repeat scroll 0 0 black;
bottom: -15px;
height: 10px;
left: 30px;
position: absolute;
transform: rotate(-2deg);
width: 70px;
z-index:-1;
}
.base-axcel:before {
background: none repeat scroll 0 0 black;
border-radius: 0 0 0 10px / 0 0 0 5px;
content: "";
height: 10px;
left: -35px;
position: absolute;
top: -2px;
transform: rotate(6deg);
width: 30px;
}
.base-axcel:after {
background: none repeat scroll 0 0 black;
border-radius: 0 0 0 10px / 0 0 0 5px;
content: "";
height: 10px;
right: -33px;
position: absolute;
top: -1px;
transform: rotate(-4deg);
width: 40px;
border-radius:0 10px 5px 0;
}
.front-bumper {
background: none repeat scroll 0 0 #4c4b4b;
border-radius: 0 2px 2px 0;
height: 8px;
position: absolute;
right: -15px;
width: 11px;
z-index: 1;
-moz-transform:rotate(-5deg);
-webkit-transform:rotate(-5deg);
}
.front-bumper:before {
background: none repeat scroll 0 0 #000000;
content: "";
height: 10px;
left: -7px;
position: absolute;
transform: rotate(-22deg);
width: 9px;
z-index: 1;
}
.car-shadow {
background: none repeat scroll 0 0 rgba(0, 0, 0, 0);
bottom: -15px;
box-shadow: -5px 10px 15px 3px #000000;
left: -7px;
position: absolute;
width: 136px;
}
/*noise css*/
.noise {
position: relative;
z-index: 1;
}
.noise:before, .body-noise:before {
content: "";
position: absolute;
z-index: -1;
top:0;
bottom:0;
left:0;
right:0;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo9/WUMZHlgr4Bg8Z4qQgQJlHI4A8SzFVrapvmTF9O7dmYRFZ60YiBhJRCgh1FYhiLAmdvX0CzTOpNE77ME0Zty/nWWzchDtiqrmQDeuv3powQ5ta2eN0FY0InkqDD73lT9c9lEzwUNqgFHs9VQce3TVClFCQrSTfOiYkVJQBmpbq2L6iZavPnAPcoU0dSw0SUTqz/GtrGuXfbyyBniKykOWQWGqwwMA7QiYAxi+IlPdqo+hYHnUt5ZPfnsHJyNiDtnpJyayNBkF6cWoYGAMY92U2hXHF/C1M8uP/ZtYdiuj26UdAdQQSXQErwSOMzt/XWRWAz5GuSBIkwG1H3FabJ2OsUOUhGC6tK4EMtJO0ttC6IBD3kM0ve0tJwMdSfjZo+EEISaeTr9P3wYrGjXqyC1krcKdhMpxEnt5JetoulscpyzhXN5FRpuPHvbeQaKxFAEB6EN+cYN6xD7RYGpXpNndMmZgM5Dcs3YSNFDHUo2LGfZuukSWyUYirJAdYbF3MfqEKmjM+I2EfhA94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ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhSnO3Wp/3fEV5a+4wz//6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg==);
}
.hill {
position: absolute;
bottom: 0;
right: 0;
width: 100%;
height: 250px;
border-top-right-radius: 160%;
border-top-left-radius: 100%;
background-color: #adde60;
z-index:-1;
}
.hill:after {
content: '';
position: absolute;
bottom: -100px;
right: -400px;
width: 120%;
height: 110%;
border-top-right-radius: 100%;
border-top-left-radius: 0%;
background-color: #94c943;
-moz-transform:rotate(-12deg);
-webkit-transform:rotate(-12deg);
box-shadow:0 0 25px #cbf191 inset;
}
.hill:before {
background-color: #93cc3a;
border-top-left-radius: 0;
border-top-right-radius: 100%;
bottom: -70px;
content: "";
height: 110%;
left: -54px;
position: absolute;
transform: rotate(4deg);
width: 120%;
}
.cloud {
background:#fff;
width:150px;
height:50px;
border-radius:50px;
position:absolute;
left:450px;
top:150px;
}
.cloud:before {
width:100px;
height:100px;
content:'';
position:absolute;
bottom:0;
left:-15px;
border-radius:50px;
box-shadow:100px 0 0 #fff;
background:#fff;
}
Tham khảo 2:
<!DOCTYPE html>
<html>
<head>
<title>Animation</title>
</head>
<body>
<img src="https://dl.dropbox.com/s/d6xgtlas8ix1rj0/sky.jpg?dl=0" width="100%" height="300px">
<div class="sky">
<div class="road"></div>
<div class="city"></div>
<div class="car">
<img src="https://dl.dropbox.com/s/e0iyphcx3obkcmv/car.png?dl=0">
</div>
<div class="wheel">
<img src="https://dl.dropbox.com/s/diuv9lkhxy0zfq6/wheel.png?dl=0">
<img src="https://dl.dropbox.com/s/diuv9lkhxy0zfq6/wheel.png?dl=0" class="front">
</div>
</div>
</body>
</html>
.road{
height:70px;
width:800%;
position:fixed ;
z-index:1;
top:280px; background-image:url(https://dl.dropbox.com/s/yjf55d2lim35iad/road%20%281%29.jpg?dl=0);
animation: road 8s linear infinite ;
}
@keyframes road{
100%{
transform:translateX(-3100px) ;
}
}
.city{
height:200px;
width:500%;
position:fixed ;
top:80px; background-image:url(https://dl.dropbox.com/s/mf93weqibhqtnxq/city.png?dl=0);
z-index:1;
animation:city 20s linear infinite;
}
@keyframes city{
100%{
transform:translateX(-1400px);
}
}
.car{
width:200px;
z-index:2;
position:fixed ;
top:250px;
left:150px;
}
.car img{
width:110%;
}
.wheel{
width:;50px;
z-index:4;
position:fixed;
top:300px;
left:169px;
}
.wheel img{
width:40px;
animation: wheel 1s linear infinite;
}
@keyframes wheel{
100%{
transform:rotate(360deg);
}
}
.front{
left:304px;
z-index:4;
position:fixed ;
top:300px;
}