Membuat Navigasi Hamburger - Hallo Sobat... berjumpa kembali dengan Aak. Sobat tentunya sudah mengetahui fungsi dari navigasi atau sajian pada Blog . Yapps betul sekali, ialah untuk memudahkan pengunjung untuk menavigasi halaman Blog sobat.
Banyak sekali style atau gaya pada Navigasi yang dapat kita temukan di Internet seperti Navigasi Circle Fill Effect , Navigasi Underline Stroke Effect , atau Navigasi Shift Hover Effect . Pada Navigasi berikut ini ibarat sebuah masakan berasal dari Benua Amerika yang terdiri dari roti bundar agak pipih dan dibelah dua , ditengahnya disisipkan lempengan daging yaitu Hamburger (atau seringkali disebut dengan burger) .
Karena Navigasi ini berbentuk ibarat Hamburger maka aku beri judul Navigasi Hamburger : D
Fitur pada tombol Navigasi ini mempunyai effect yang menari jikalau tombol di klik maka sajian akan mencul di bawahnya. Bagi Anda yang tertarik berikut ini langkah-langkahnya :
Pertama-tama Anda cari arahan ]]></b:skin> , lalu copy arahan CSS dibawah ini dan pastekan diatasnya.
Selanjutnya Anda cari arahan </body> lalu copy arahan dibawah ini dan pastekan diatasnya.
Catatan : Jika pada Template sahabat sudah terinstall arahan diatas, maka lewati langkah tersebut
Masih pada arahan </body> Anda copy arahan Javascript dibawah ini dan pastekan dibawah arahan diatas.
Pada pemasangan arahan HTML dibawah ini Anda cari kode <div id='main-wrapper'> , lalu terapkan dibawahnya.
Semoga bermanfaat!
Sumber http://www.websiteedukasi.com/
Banyak sekali style atau gaya pada Navigasi yang dapat kita temukan di Internet seperti Navigasi Circle Fill Effect , Navigasi Underline Stroke Effect , atau Navigasi Shift Hover Effect . Pada Navigasi berikut ini ibarat sebuah masakan berasal dari Benua Amerika yang terdiri dari roti bundar agak pipih dan dibelah dua , ditengahnya disisipkan lempengan daging yaitu Hamburger (atau seringkali disebut dengan burger) .
Karena Navigasi ini berbentuk ibarat Hamburger maka aku beri judul Navigasi Hamburger : D
Fitur pada tombol Navigasi ini mempunyai effect yang menari jikalau tombol di klik maka sajian akan mencul di bawahnya. Bagi Anda yang tertarik berikut ini langkah-langkahnya :
Pertama-tama Anda cari arahan ]]></b:skin> , lalu copy arahan CSS dibawah ini dan pastekan diatasnya.
.hamburger-btn {
background-color: #fc5638;
box-shadow: 0 4px 0 0 #fb3815, inset 0 4px 0 0 #fd745b, 0 2px 8px 4px #141414;
height: 100px;
width: 100px;
border-radius: 100%;
cursor: pointer;
position: absolute;
top: 50px;
left: 500px;
z-index: 5;
transition: all .4s ease;
}
.hamburger-btn:hover {
background-color: #fc5f42;
box-shadow: 0 4px 0 0 #fc4524, inset 0 4px 0 0 #fd8974, 0 2px 8px 4px #141414;
}
.hamburger-btn:active {
background-color: #fc4524;
box-shadow: inset 0 4px 0 0 #CF280A, 0 4px 0 0 #fc6347, 0 2px 8px 4px #141414;
}
.one, .two, .three {
width: 65px;
height: 8px;
border-radius: 50px;
display: inline-block;
background-color: whitesmoke;
position: absolute;
left: 17px;
top: 33px;
transition: opacity .2s ease;
}
.two {
top: 48px;
-webkit-transform-origin: center center;
transition: all .3s ease;
}
.three {
top: 63px;
}
.hidden {
opacity: 0;
}
.close {
background-color: #fc4524;
box-shadow: inset 0 4px 0 0 #CF280A, 0 4px 0 0 #fc6347, 0 2px 8px 4px #141414;
z-index: 5;
}
.close:hover {
background-color: #fc3c1a;
box-shadow: inset 0 4px 0 0 #c5260a, 0 4px 0 0 #fc5f42, 0 2px 8px 4px #141414;
}
.buttons {
margin-top: 40px;
margin-right: -20px;
z-index: 1;
}
.buttons .button1 {
background-color: #5BC385;
box-shadow: 0 4px 0 0 #43b772, inset 0 4px 0 0 #75cd98, 0 2px 8px 4px #141414;
height: 0;
width: 0;
border-radius: 100%;
cursor: pointer;
transition: all 0.55s cubic-bezier(0, 1.2, 0.8, 1.2);
display: inline-block;
position: absolute;
top: 4px;
left: 19px;
z-index: 1;
}
.buttons .button1:hover {
background-color: #62c68b;
box-shadow: 0 4px 0 0 #4cbe7a, inset 0 4px 0 0 #88d3a6, 0 2px 8px 4px #141414;
}
.buttons .button1:active {
background-color: #4cbe7a;
box-shadow: inset 0 4px 0 0 #3ca566, 0 4px 0 0 #66c78d, 0 2px 8px 4px #141414;
}
.buttons .button2 {
background-color: #7E5DC2;
box-shadow: 0 4px 0 0 #6a45b7, inset 0 4px 0 0 #9377cc, 0 2px 8px 4px #141414;
height: 0;
width: 0;
border-radius: 100%;
cursor: pointer;
transition: all 0.55s cubic-bezier(0, 1.2, 0.8, 1.2);
display: inline-block;
position: absolute;
top: 4px;
left: 19px;
z-index: 1;
}
.buttons .button2:hover {
background-color: #8464c5;
box-shadow: 0 4px 0 0 #724ebc, inset 0 4px 0 0 #a189d3, 0 2px 8px 4px #141414;
}
.buttons .button2:active {
background-color: #724ebc;
box-shadow: inset 0 4px 0 0 #5f3ea4, 0 4px 0 0 #8768c6, 0 2px 8px 4px #141414;
}
.buttons .button3 {
background-color: #4084C7;
box-shadow: 0 4px 0 0 #3472b0, inset 0 4px 0 0 #5c96cf, 0 2px 8px 4px #141414;
height: 0;
width: 0;
border-radius: 100%;
cursor: pointer;
transition: all 0.55s cubic-bezier(0, 1.2, 0.8, 1.2);
display: inline-block;
position: absolute;
top: 4px;
left: 19px;
z-index: 1;
}
.buttons .button3:hover {
background-color: #4889c9;
box-shadow: 0 4px 0 0 #377abc, inset 0 4px 0 0 #6fa2d5, 0 2px 8px 4px #141414;
}
.buttons .button3:active {
background-color: #377abc;
box-shadow: inset 0 4px 0 0 #2e659c, 0 4px 0 0 #4c8cca, 0 2px 8px 4px #141414;
}
.buttons .button4 {
background-color: #C7408D;
box-shadow: 0 4px 0 0 #b0347a, inset 0 4px 0 0 #cf5c9d, 0 2px 8px 4px #141414;
height: 0;
width: 0;
border-radius: 100%;
cursor: pointer;
transition: all 0.55s cubic-bezier(0, 1.2, 0.8, 1.2);
display: inline-block;
position: absolute;
top: 4px;
left: 19px;
z-index: 1;
}
.buttons .button4:hover {
background-color: #c94892;
box-shadow: 0 4px 0 0 #bc3783, inset 0 4px 0 0 #d56fa9, 0 2px 8px 4px #141414;
}
.buttons .button4:active {
background-color: #bc3783;
box-shadow: inset 0 4px 0 0 #9c2e6d, 0 4px 0 0 #ca4c94, 0 2px 8px 4px #141414;
}
.buttons i {
color: whitesmoke;
font-size: 0;
-webkit-transform-origin: center center;
transition: all .25s ease-in;
}
background-color: #fc5638;
box-shadow: 0 4px 0 0 #fb3815, inset 0 4px 0 0 #fd745b, 0 2px 8px 4px #141414;
height: 100px;
width: 100px;
border-radius: 100%;
cursor: pointer;
position: absolute;
top: 50px;
left: 500px;
z-index: 5;
transition: all .4s ease;
}
.hamburger-btn:hover {
background-color: #fc5f42;
box-shadow: 0 4px 0 0 #fc4524, inset 0 4px 0 0 #fd8974, 0 2px 8px 4px #141414;
}
.hamburger-btn:active {
background-color: #fc4524;
box-shadow: inset 0 4px 0 0 #CF280A, 0 4px 0 0 #fc6347, 0 2px 8px 4px #141414;
}
.one, .two, .three {
width: 65px;
height: 8px;
border-radius: 50px;
display: inline-block;
background-color: whitesmoke;
position: absolute;
left: 17px;
top: 33px;
transition: opacity .2s ease;
}
.two {
top: 48px;
-webkit-transform-origin: center center;
transition: all .3s ease;
}
.three {
top: 63px;
}
.hidden {
opacity: 0;
}
.close {
background-color: #fc4524;
box-shadow: inset 0 4px 0 0 #CF280A, 0 4px 0 0 #fc6347, 0 2px 8px 4px #141414;
z-index: 5;
}
.close:hover {
background-color: #fc3c1a;
box-shadow: inset 0 4px 0 0 #c5260a, 0 4px 0 0 #fc5f42, 0 2px 8px 4px #141414;
}
.buttons {
margin-top: 40px;
margin-right: -20px;
z-index: 1;
}
.buttons .button1 {
background-color: #5BC385;
box-shadow: 0 4px 0 0 #43b772, inset 0 4px 0 0 #75cd98, 0 2px 8px 4px #141414;
height: 0;
width: 0;
border-radius: 100%;
cursor: pointer;
transition: all 0.55s cubic-bezier(0, 1.2, 0.8, 1.2);
display: inline-block;
position: absolute;
top: 4px;
left: 19px;
z-index: 1;
}
.buttons .button1:hover {
background-color: #62c68b;
box-shadow: 0 4px 0 0 #4cbe7a, inset 0 4px 0 0 #88d3a6, 0 2px 8px 4px #141414;
}
.buttons .button1:active {
background-color: #4cbe7a;
box-shadow: inset 0 4px 0 0 #3ca566, 0 4px 0 0 #66c78d, 0 2px 8px 4px #141414;
}
.buttons .button2 {
background-color: #7E5DC2;
box-shadow: 0 4px 0 0 #6a45b7, inset 0 4px 0 0 #9377cc, 0 2px 8px 4px #141414;
height: 0;
width: 0;
border-radius: 100%;
cursor: pointer;
transition: all 0.55s cubic-bezier(0, 1.2, 0.8, 1.2);
display: inline-block;
position: absolute;
top: 4px;
left: 19px;
z-index: 1;
}
.buttons .button2:hover {
background-color: #8464c5;
box-shadow: 0 4px 0 0 #724ebc, inset 0 4px 0 0 #a189d3, 0 2px 8px 4px #141414;
}
.buttons .button2:active {
background-color: #724ebc;
box-shadow: inset 0 4px 0 0 #5f3ea4, 0 4px 0 0 #8768c6, 0 2px 8px 4px #141414;
}
.buttons .button3 {
background-color: #4084C7;
box-shadow: 0 4px 0 0 #3472b0, inset 0 4px 0 0 #5c96cf, 0 2px 8px 4px #141414;
height: 0;
width: 0;
border-radius: 100%;
cursor: pointer;
transition: all 0.55s cubic-bezier(0, 1.2, 0.8, 1.2);
display: inline-block;
position: absolute;
top: 4px;
left: 19px;
z-index: 1;
}
.buttons .button3:hover {
background-color: #4889c9;
box-shadow: 0 4px 0 0 #377abc, inset 0 4px 0 0 #6fa2d5, 0 2px 8px 4px #141414;
}
.buttons .button3:active {
background-color: #377abc;
box-shadow: inset 0 4px 0 0 #2e659c, 0 4px 0 0 #4c8cca, 0 2px 8px 4px #141414;
}
.buttons .button4 {
background-color: #C7408D;
box-shadow: 0 4px 0 0 #b0347a, inset 0 4px 0 0 #cf5c9d, 0 2px 8px 4px #141414;
height: 0;
width: 0;
border-radius: 100%;
cursor: pointer;
transition: all 0.55s cubic-bezier(0, 1.2, 0.8, 1.2);
display: inline-block;
position: absolute;
top: 4px;
left: 19px;
z-index: 1;
}
.buttons .button4:hover {
background-color: #c94892;
box-shadow: 0 4px 0 0 #bc3783, inset 0 4px 0 0 #d56fa9, 0 2px 8px 4px #141414;
}
.buttons .button4:active {
background-color: #bc3783;
box-shadow: inset 0 4px 0 0 #9c2e6d, 0 4px 0 0 #ca4c94, 0 2px 8px 4px #141414;
}
.buttons i {
color: whitesmoke;
font-size: 0;
-webkit-transform-origin: center center;
transition: all .25s ease-in;
}
Selanjutnya Anda cari arahan </body> lalu copy arahan dibawah ini dan pastekan diatasnya.
<script src='//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'/>
Catatan : Jika pada Template sahabat sudah terinstall arahan diatas, maka lewati langkah tersebut
Masih pada arahan </body> Anda copy arahan Javascript dibawah ini dan pastekan dibawah arahan diatas.
<script type="text/javascript">
$('.hamburger-btn').click(function () {
if ($(this).hasClass('close')) {
$('.one').removeClass('hidden');
$('.three').removeClass('hidden');
$('.x1').css('transform', 'rotate(0deg)');
$('.x2').css('transform', 'rotate(0deg)');
$(this).removeClass('close');
$('.button1').css({
'top': '4px',
'left': '19px',
'height': '0',
'width': '0',
'transition': 'all .3s ease-in'
});
$('.button1 .fa-bolt').css('font-size', '0');
setTimeout(function () {
$('.button2').css({
'top': '4px',
'left': '19px',
'height': '0',
'width': '0',
'transition': 'all .3s ease-in'
});
$('.button2 .fa-bolt').css('font-size', '0');
}, 200);
setTimeout(function () {
$('.button3').css({
'top': '4px',
'left': '19px',
'height': '0',
'width': '0',
'transition': 'all .3s ease-in'
});
$('.button3 .fa-bolt').css('font-size', '0');
}, 400);
setTimeout(function () {
$('.button4').css({
'top': '4px',
'left': '19px',
'height': '0',
'width': '0',
'transition': 'all .3s ease-in'
});
$('.button4 .fa-bolt').css('font-size', '0');
}, 500);
} else {
$('.one').addClass('hidden');
$('.three').addClass('hidden');
$('.x1').css('transform', 'rotate(45deg)');
$('.x2').css('transform', 'rotate(-45deg)');
$(this).addClass('close');
$('.button1').css({
'top': '180px',
'left': '300px',
'height': '80px',
'width': '80px',
'transition': 'all 0.55s cubic-bezier(0, 1.2, .8, 1.2)'
});
$('.button1 .fa-bolt').css('font-size', '50px');
setTimeout(function () {
$('.button2').css({
'top': '180px',
'left': '440px',
'height': '80px',
'width': '80px',
'transition': 'all 0.55s cubic-bezier(0, 1.2, .8, 1.2)'
});
$('.button2 .fa-bolt').css('font-size', '50px');
}, 300);
setTimeout(function () {
$('.button3').css({
'top': '180px',
'left': '570px',
'height': '80px',
'width': '80px',
'transition': 'all 0.55s cubic-bezier(0, 1.2, .8, 1.2)'
});
$('.button3 .fa-bolt').css('font-size', '50px');
}, 600);
setTimeout(function () {
$('.button4').css({
'top': '180px',
'left': '700px',
'height': '80px',
'width': '80px',
'transition': 'all 0.55s cubic-bezier(0, 1.2, .8, 1.2)'
});
$('.button4 .fa-bolt').css('font-size', '50px');
}, 900);
}
});
//@ sourceURL=pen.js
</script>
$('.hamburger-btn').click(function () {
if ($(this).hasClass('close')) {
$('.one').removeClass('hidden');
$('.three').removeClass('hidden');
$('.x1').css('transform', 'rotate(0deg)');
$('.x2').css('transform', 'rotate(0deg)');
$(this).removeClass('close');
$('.button1').css({
'top': '4px',
'left': '19px',
'height': '0',
'width': '0',
'transition': 'all .3s ease-in'
});
$('.button1 .fa-bolt').css('font-size', '0');
setTimeout(function () {
$('.button2').css({
'top': '4px',
'left': '19px',
'height': '0',
'width': '0',
'transition': 'all .3s ease-in'
});
$('.button2 .fa-bolt').css('font-size', '0');
}, 200);
setTimeout(function () {
$('.button3').css({
'top': '4px',
'left': '19px',
'height': '0',
'width': '0',
'transition': 'all .3s ease-in'
});
$('.button3 .fa-bolt').css('font-size', '0');
}, 400);
setTimeout(function () {
$('.button4').css({
'top': '4px',
'left': '19px',
'height': '0',
'width': '0',
'transition': 'all .3s ease-in'
});
$('.button4 .fa-bolt').css('font-size', '0');
}, 500);
} else {
$('.one').addClass('hidden');
$('.three').addClass('hidden');
$('.x1').css('transform', 'rotate(45deg)');
$('.x2').css('transform', 'rotate(-45deg)');
$(this).addClass('close');
$('.button1').css({
'top': '180px',
'left': '300px',
'height': '80px',
'width': '80px',
'transition': 'all 0.55s cubic-bezier(0, 1.2, .8, 1.2)'
});
$('.button1 .fa-bolt').css('font-size', '50px');
setTimeout(function () {
$('.button2').css({
'top': '180px',
'left': '440px',
'height': '80px',
'width': '80px',
'transition': 'all 0.55s cubic-bezier(0, 1.2, .8, 1.2)'
});
$('.button2 .fa-bolt').css('font-size', '50px');
}, 300);
setTimeout(function () {
$('.button3').css({
'top': '180px',
'left': '570px',
'height': '80px',
'width': '80px',
'transition': 'all 0.55s cubic-bezier(0, 1.2, .8, 1.2)'
});
$('.button3 .fa-bolt').css('font-size', '50px');
}, 600);
setTimeout(function () {
$('.button4').css({
'top': '180px',
'left': '700px',
'height': '80px',
'width': '80px',
'transition': 'all 0.55s cubic-bezier(0, 1.2, .8, 1.2)'
});
$('.button4 .fa-bolt').css('font-size', '50px');
}, 900);
}
});
//@ sourceURL=pen.js
</script>
Pada pemasangan arahan HTML dibawah ini Anda cari kode <div id='main-wrapper'> , lalu terapkan dibawahnya.
<div class="container">
<div class="hamburger-btn">
<span class="line one"></span>
<span class="line two x1" style="-webkit-transform: rotate(0deg);"></span>
<span class="line two x2" style="-webkit-transform: rotate(0deg);"></span>
<span class="line three"></span>
</div>
<div class="buttons">
<div class="button1" style="-webkit-transition: all 0.3s ease-in; height: 0px; left: 19px; top: 4px; transition: all 0.3s ease-in; width: 0px;">
<i class="fa fa-bolt" style="font-size: 0px;"></i></div>
<div class="button2" style="-webkit-transition: all 0.3s ease-in; height: 0px; left: 19px; top: 4px; transition: all 0.3s ease-in; width: 0px;">
<i class="fa fa-bolt" style="font-size: 0px;"></i></div>
<div class="button3" style="-webkit-transition: all 0.3s ease-in; height: 0px; left: 19px; top: 4px; transition: all 0.3s ease-in; width: 0px;">
<i class="fa fa-bolt" style="font-size: 0px;"></i></div>
<div class="button4" style="-webkit-transition: all 0.3s ease-in; height: 0px; left: 19px; top: 4px; transition: all 0.3s ease-in; width: 0px;">
<i class="fa fa-bolt" style="font-size: 0px;"></i></div>
</div>
</div>
<div class="hamburger-btn">
<span class="line one"></span>
<span class="line two x1" style="-webkit-transform: rotate(0deg);"></span>
<span class="line two x2" style="-webkit-transform: rotate(0deg);"></span>
<span class="line three"></span>
</div>
<div class="buttons">
<div class="button1" style="-webkit-transition: all 0.3s ease-in; height: 0px; left: 19px; top: 4px; transition: all 0.3s ease-in; width: 0px;">
<i class="fa fa-bolt" style="font-size: 0px;"></i></div>
<div class="button2" style="-webkit-transition: all 0.3s ease-in; height: 0px; left: 19px; top: 4px; transition: all 0.3s ease-in; width: 0px;">
<i class="fa fa-bolt" style="font-size: 0px;"></i></div>
<div class="button3" style="-webkit-transition: all 0.3s ease-in; height: 0px; left: 19px; top: 4px; transition: all 0.3s ease-in; width: 0px;">
<i class="fa fa-bolt" style="font-size: 0px;"></i></div>
<div class="button4" style="-webkit-transition: all 0.3s ease-in; height: 0px; left: 19px; top: 4px; transition: all 0.3s ease-in; width: 0px;">
<i class="fa fa-bolt" style="font-size: 0px;"></i></div>
</div>
</div>
Semoga bermanfaat!
Sumber http://www.websiteedukasi.com/