Shiny Bouncing Ball Animation CSS3
.ball-wrapper {
position: fixed;
width: 120px;
height: 300px;
margin-left: -60px;
left: 50%;
top: 20%;
}
.ball {
position: absolute;
width: 120px;
height: 120px;
border-radius: 70px;
background: -webkit-linear-gradient(top, rgba(187,187,187,1) 0%,rgba(119,119,119,1) 99%);
background: -moz-linear-gradient(top, rgba(187,187,187,1) 0%,rgba(119,119,119,1) 99%);
background: linear-gradient(top, rgba(187,187,187,1) 0%,rgba(119,119,119,1) 99%);
box-shadow: inset 0 -5px 15px rgba(255,255,255,0.4), inset -2px -1px 40px rgba(0,0,0,0.4), 0 0 1px #000;
-webkit-animation: jump 1s infinite;
-moz-animation: jump 1s infinite;
animation: jump 1s infinite;
}
.ball::after {
content: "";
position: absolute;
width: 60px;
height: 30px;
border-radius: 40px / 20px;
left: 30px;
top: 10px;
background: -webkit-linear-gradient(top, rgba(232,232,232,1) 0%,rgba(232,232,232,1) 1%,rgba(255,255,255,0) 100%);
background: -moz-linear-gradient(top, rgba(232,232,232,1) 0%,rgba(232,232,232,1) 1%,rgba(255,255,255,0) 100%);
background: linear-gradient(top, rgba(232,232,232,1) 0%,rgba(232,232,232,1) 1%,rgba(255,255,255,0) 100%);
}
.ball-shadow {
position: absolute;
left: 50%;
bottom: 0;
width: 50px;
height: 65px;
border-radius: 30px / 40px;
margin-left: -25px;
background: rgba(20, 20, 20, 0.1);
box-shadow: 0px 0 20px 35px rgba(20,20,20,.1);
-webkit-transform: scaleY(0.3);
-moz-transform: scaleY(0.3);
transform: scaleY(0.3);
-webkit-animation: shrink 1s infinite;
-moz-animation: shrink 1s infinite;
animation: shrink 1s infinite;
}
/**
* animation
*/
@-webkit-keyframes jump {
0% {
top: 0;
-webkit-animation-timing-function: ease-in;
}
40% {}
50% {
top: 140px;
height: 120px;
-webkit-animtion-timing-function: ease-out;
}
55% {
top: 160px;
height: 100px;
border-radius: 70px/60px;
-webkit-animation-timing-function: ease-in;
}
65% {
top: 110px;
height: 120px;
border-radius: 50%;
-webkit-animation-timing-function: ease-out;
}
95% {
top: 0;
-webkit-animation-timing-function: ease-in;
}
100% {
top: 0;
-webkit-animation-timing-function: ease-in;
}
}
@-moz-keyframes jump {
0% {
top: 0;
-moz-animation-timing-function: ease-in;
}
40% {}
50% {
top: 140px;
height: 120px;
-moz-animtion-timing-function: ease-out;
}
55% {
top: 160px;
height: 100px;
border-radius: 70px/60px;
-moz-animation-timing-function: ease-in;
}
65% {
top: 110px;
height: 120px;
border-radius: 50%;
-moz-animation-timing-function: ease-out;
}
95% {
top: 0;
-moz-animation-timing-function: ease-in;
}
100% {
top: 0;
-moz-animation-timing-function: ease-in;
}
}
@-webkit-keyframes shrink {
0% {
bottom: 0;
margin-left: -30px;
width: 60px;
height: 75px;
background: rgba(20, 20, 20, .1);
box-shadow: 0px 0 20px 35px rgba(20,20,20,.1);
border-radius: 30px / 40px;
-webkit-animation-timing-function: ease-in;
}
50% {
bottom: 30px;
margin-left: -10px;
width: 20px;
height: 5px;
background: rgba(20, 20, 20, .3);
box-shadow: 0px 0 20px 35px rgba(20,20,20,.3);
border-radius: 20px / 20px;
-webkit-animation-timing-function: ease-out;
}
100% {
bottom: 0;
margin-left: -30px;
width: 60px;
height: 75px;
background: rgba(20, 20, 20, .1);
box-shadow: 0px 0 20px 35px rgba(20,20,20,.1);
border-radius: 30px / 40px;
-webkit-animation-timing-function: ease-in;
}
}
@-moz-keyframes shrink {
0% {
bottom: 0;
margin-left: -30px;
width: 60px;
height: 75px;
background: rgba(20, 20, 20, .1);
box-shadow: 0px 0 20px 35px rgba(20,20,20,.1);
border-radius: 30px / 40px;
-moz-animation-timing-function: ease-in;
}
50% {
bottom: 30px;
margin-left: -10px;
width: 20px;
height: 5px;
background: rgba(20, 20, 20, .3);
box-shadow: 0px 0 20px 35px rgba(20,20,20,.3);
border-radius: 20px / 20px;
-moz-animation-timing-function: ease-out;
}
100% {
bottom: 0;
margin-left: -30px;
width: 60px;
height: 75px;
background: rgba(20, 20, 20, .1);
box-shadow: 0px 0 20px 35px rgba(20,20,20,.1);
border-radius: 30px / 40px;
-moz-animation-timing-function: ease-in;
}
}
<div class="ball-wrapper">
<div class="ball"></div>
<div class="ball-shadow"></div>
</div>
0 komentar:
Posting Komentar
Catatan
Dilarang menambahkan link aktif ataupun meng-iklankan suatu produk dll.
Untuk menyisipkan kode, gunakan tag <i rel="code">KODE ANDA</i>
Kode yang panjang bisa menggunakan tag <i rel="pre">KODE PANJANG ANDA</i>
Untuk menyisipkan link gunakan tag <i rel="anchor">LINK ANDA</i>
Untuk menyisipkan gambar, gunakan tag <i rel="image">URL GAMBAR</i>
Untuk menyisipkan judul, gunakan tag <b rel="h3">JUDUL ANDA DI SINI...</b>
Untuk menciptakan efek tebal gunakan tag <b>TEKS ANDA DI SINI...</b>
Untuk menciptakan efek huruf miring gunakan tag <i>TEKS ANDA DI SINI...</i>
Khusus untuk membalas komentar disarankan menggunakan tombol balas di bawah komentar terkait dibandingkan menggunakan formulir komentar di bawah agar komunikasi lebih terstruktur. Karena mungkin, apa yang kita bahas saat ini akan sangat bermanfaat bagi pembaca lain.
Klik untuk melihat kode: :) :( ^_^ :D ;) :-bd :yaya: :'( :\ :p B) :Q :Ozz 7:( \o/ **p <3 0:) :-a 7:O *fck* x@ X@ ~x( =p*