[パーツ]ハンバーガーメニューアクション ホバーでニュインと伸びるハンバーガーメニュー

 2018.05.21

ホバーでニュインと伸びるハンバーガーメニュー

ホバーでそれぞれのバーが横にニュインとバラバラに伸びます。

browser:  65 11 20 10 
ニャン易度 
<div class="cp_hmenuac05">
<span class="cp_bar"></span>
</div>
.cp_hmenuac05 {
	position: absolute;
	padding: 1.5em;
	width: 40px;
	cursor: pointer;
}
.cp_hmenuac05 .cp_bar,
.cp_hmenuac05 .cp_bar:before,
.cp_hmenuac05 .cp_bar:after {
	display: block;
	width: 40px;
	height: 5px;
	content: '';
	-webkit-transition: all 0.5s ease-in-out;
	        transition: all 0.5s ease-in-out;
	border-radius: 5px;
	background: #009688;
}
.cp_hmenuac05 .cp_bar {
	position: relative;
	margin: 5px 0;
}
.cp_hmenuac05 .cp_bar:before,
.cp_hmenuac05 .cp_bar:after {
	position: absolute;
}
.cp_hmenuac05 .cp_bar:before {
	top: 11px;
}
.cp_hmenuac05 .cp_bar:after {
	bottom: 11px;
}
.cp_hmenuac05:hover .cp_bar,
.cp_hmenuac05:hover .cp_bar:before,
.cp_hmenuac05:hover .cp_bar:after {
	-webkit-animation: hmenuac 0.3s cubic-bezier(0, 0, 0.2, 1) 1;
	        animation: hmenuac 0.3s cubic-bezier(0, 0, 0.2, 1) 1;
}
.cp_hmenuac05:hover .cp_bar:before {
	-webkit-animation-delay: 0.1s;
	        animation-delay: 0.1s;
}
.cp_hmenuac05:hover .cp_bar:after {
	-webkit-animation-delay: 0.2s;
	        animation-delay: 0.2s;
}
@-webkit-keyframes hmenuac {
	60% {
		-webkit-transform: scaleX(1.4);
		        transform: scaleX(1.4);
	}
	100% {
		-webkit-transform: scaleX(1);
		        transform: scaleX(1);
	}
}
@keyframes hmenuac {
	60% {
		-webkit-transform: scaleX(1.4);
		        transform: scaleX(1.4);
	}
	100% {
		-webkit-transform: scaleX(1);
		        transform: scaleX(1);
	}
}

copypet.jp

CSS3などで新たに追加された要素・装飾方法など、日々コードを書いていないと忘れてしまったり、ささっとプロトタイプを作る時などちょっとしたことに時間をかけている暇はない。そんな時に「あ〜、あれストックしときゃよかったなぁ」って困った自分用のストックブログです。カスタマイズなどがしやすいよう、昨今のweb制作に取り入れられる一般的なコードを中心に掲載しています。

More Info

こんな記事はいかがですか?