CSS Transisi mempunyai fungsi untuk mengubah durasi suatu nilai dari nilai awal suatu tampilan menuju nilai titik akhir suatu tampilan. Dalam perkembangan-nya CSS Transisi ini bisa dipergunakan untuk Media Queries seperti WebBlog Go Blog Go ini.
Sintaks CSS Transisi :
div {
-webkit-transition: properti durasi percepatan delay;
-moz-transition: properti durasi percepatan delay;
-ms-transition: properti durasi percepatan delay;
-o-transition: properti durasi percepatan delay;
transition: properti durasi percepatan delay;
}
Untuk lebih jelas-nya Mojang dan Bujang silahkan lihat demo-nya dibawah ini :
Efek Glow :
Hover me, Bro!!
#boxs{
width:200px;
height:100px;
text-align:center;
background:#ddd;
line-height:100px;
margin:20px auto;
/* Pemberian transition pada box-shadow akan memberikan efek glow */
-webkit-transition: .3s box-shadow ease-in, .3s background ease-in;
-moz-transition: .3s box-shadow ease-in, .3s background ease-in;
-ms-transition: .3s box-shadow ease-in, .3s background ease-in;
-o-transition: .3s box-shadow ease-in, .3s background ease-in;
transition: .3s box-shadow ease-in, .3s background ease-in;
}
#boxs:hover{
box-shadow:0 0 30px #52A7FF;
background:#fff;
}
Efek Hover Timing/Waktu :
ease
ease-in
ease-out
ease-in-out
.timing{
width:100px;
padding:10px;
background:#fff;
margin:10px auto;
float:left;
}
.timing:hover{
width:500px;
}
#ease{
-webkit-transition:.8s width ease;
-moz-transition:.8s width ease;
-ms-transition:.8s width ease;
-o-transition:.8s width ease;
transition:.8s width ease;
}
#ease-in{
-webkit-transition:.8s width ease-in;
-moz-transition:.8s width ease-in;
-ms-transition:.8s width ease-in;
-o-transition:.8s width ease-in;
transition:.8s width ease-in;
}
#ease-out{
-webkit-transition:.8s width ease-out;
-moz-transition:.8s width ease-out;
-ms-transition:.8s width ease-out;
-o-transition:.8s width ease-out;
transition:.8s width ease-out;
}
#ease-in-out{
-webkit-transition:.8s width ease-in-out;
-moz-transition:.8s width ease-in-out;
-ms-transition:.8s width ease-in-out;
-o-transition:.8s width ease-in-out;
transition:.8s width ease-in-out;
}
Efek Perubahan Warna :
Efek Warna
.timing{
width:100px;
padding:10px;
background:orange;
color:gray;
margin:10px auto;
float:left;
}
.timing:hover{
width:500px;
background:grey;
color:black;
}
#bunglon {
-webkit-transition: all 2s ease-out;
-moz-transition: all 2s ease-out;
-ms-transition: all 2s ease-out;
-o-transition: all 2s ease-out;
transition: all 2s ease-out;
}
#bunglon:hover {
background:grey;
color:black;
width:500px;
}
Efek Delay/Menunggu :
"Look At Me"
#ngantosan {
width:180px;
padding:40px;
border:5px solid #990000;
background:#ffe046;
padding:20px;
text-align:center;
color:#000;
font-size:12px;
cursor:pointer;
-webkit-box-shadow:0 0 5px #000;
-moz-box-shadow:0 0 5px #000;
box-shadow:0 0 5px #000;
-webkit-transition: all 1s ease-out 5s;
-moz-transition: all 1s ease-out 5s;
-ms-transition: all 1s ease-out 5s;
-o-transition: all 1s ease-out 5s;
transition: all 1s ease-out 5s;
}
#ngantosan:hover {
background:#bbb;
border-width:0;
color:#990000;
font-size:20px;
padding:20px;
text-align:center;
-webkit-box-shadow:0 0 0 #000;
-moz-box-shadow:0 0 0 #000;
box-shadow:0 0 0 #000;
-webkit-border-radius:100px;
-moz-border-radius:100px;
border-radius:100px;
-webkit-transform:rotate(360deg);
-moz-transform:rotate(360deg);
-ms-transform:rotate(360deg);
-o-transform:rotate(360deg);
transform:rotate(360deg);
}
Saya hanya sedikit mengulas saja karena sudah banyak yang membahas CSS Transition ini, disini hanya cara pelaksanaan-nya. Go Blog Go...!!! Amiin
Wassalam,
0 comments:
Post a Comment
Catatan :
1.Untuk menyisipkan Kode, gunakan Tag <i rel="code">Kode Anda Di-Sini...</i>
2.Untuk menyisipkan Kode Panjang, gunakan Tag <i rel="pre">Kode Anda Di-Sini...</i>
3.Untuk menyisipkan Kode Gambar, gunakan Tag <i rel="image">URL Gambar Anda Di-Sini...</i>
4.Untuk menyisipkan Catatan, gunakan Tag <b rel="quote">Catatan Anda Di-Sini...</i>
NB: Sebelum menyisipkan Kode, konversi terlebih dulu Kode-nya agar bisa tampil di Kolom Komentar