[装飾系]Input checkbox チェックが入るときにぴょこんと動く

CSS HTML
 2018.02.03
 2018.03.12

チェックが入るときにぴょこんと動くチェックボックス

チェックをした際のエフェクトが「ぴょこん」と動くチェックボックスです。

browser:  65 11 20 11 
ニャン易度 
<div class="cp_ipcheck">
	<ul>
		<li class="list_item">
		<label>
		<input type="checkbox" class="option-input05" checked />
		ネコ
		</label>
		</li>
		<li class="list_item">
		<label>
		<input type="checkbox" class="option-input05" />
		イヌ
		</label>
		</li>
		<li class="list_item">
		<label>
		<input type="checkbox" class="option-input05" />
		ウサギ
		</label>
		</li>
	</ul>
</div>
.cp_ipcheck {
	width: 90%;
	margin: 2em auto;
	text-align: left;
}
.cp_ipcheck ul {
	margin: 0.5rem 0.5rem 2rem 0.5rem;
	padding: 0.5rem 1rem;
	list-style: none;
	border: 1px solid #cccccc;
}
.cp_ipcheck .list_item {
	margin: 0 0 0.5rem 0;
	padding: 0;
}
.cp_ipcheck label {
	line-height: 135%;
	position: relative;
	margin: 0.5rem;
	cursor: pointer;
}
.cp_ipcheck .option-input05 {
	position: relative;
	margin: 0 1rem 0 0;
	cursor: pointer;
}
.cp_ipcheck .option-input05:before {
	position: absolute;
	z-index: 1;
	top: 0.125rem;
	left: 0.1875rem;
	width: 0.75rem;
	height: 0.375rem;
	content: '';
	-webkit-transition: -webkit-transform 0.4s cubic-bezier(0.45, 1.8, 0.5, 0.75);
	        transition:         transform 0.4s cubic-bezier(0.45, 1.8, 0.5, 0.75);
	-webkit-transform: rotate(-45deg) scale(0, 0);
	        transform: rotate(-45deg) scale(0, 0);
	border: 2px solid #da3c41;
	border-top-style: none;
	border-right-style: none;
}
.cp_ipcheck .option-input05:checked:before {
	-webkit-transform: rotate(-45deg) scale(1, 1);
	        transform: rotate(-45deg) scale(1, 1);
}
.cp_ipcheck .option-input05:after {
	position: absolute;
	top: -0.125rem;
	left: 0;
	width: 1rem;
	height: 1rem;
	content: '';
	cursor: pointer;
	border: 2px solid #f2f2f2;
	background: #ffffff;
}

copypet.jp

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

More Info

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