[装飾系]ボタンデザイン HOVERで右上に丸いアクセントが出る

CSS HTML
 2018.03.17

HOVERで右上に丸いアクセントが出る

HOVERで右上に丸いアクセントが出るボタンです。

browser:  65 11 20 10 
ニャン易度 
<button class="cp_button07">button</button>
.cp_button07 {
	position: relative;
	z-index: 1;
	overflow: hidden;
	width: 160px;
	padding: 1em;
	cursor: pointer;
	line-height: 1.4;
	transition: color 0.3s cubic-bezier(0.02,0.01,0.47,1),transform 0.3s cubic-bezier(0.02,0.01,0.47,1);
	color: #ffffff;
	border: none;
	border-width: 0;
	border-color: transparent;
	border-radius: 100px;
	background: #009688;
}
.cp_button07:after, .cp_button07:before {
	position: absolute;
	z-index: -1;
	right: 0;
	bottom: 0;
	width: 100px;
	height: 100px;
	content: '';
	transition: transform 0.15s cubic-bezier(0.02,0.01,0.47,1),opacity 0.15s cubic-bezier(0.02,0.01,0.47,1);
	-webkit-transform: translate(100%,-25%) translateZ(0);
	        transform: translate(100%,-25%) translateZ(0);
	opacity: 0;
	border-radius: 50%;
	background: #009688;
}
.cp_button07:after, .cp_button07:before {
	background: #ffffff;
}
.cp_button07:hover {
	transition: all 0.5s cubic-bezier(0.02,0.01,0.47,1);
	-webkit-transform: scale(1.1) translateZ(0);
	        transform: scale(1.1) translateZ(0);
	color: #ffffff;
	box-shadow: 0 1px 8px rgba(0,0,0,0.3);
}
.cp_button07:hover:before {
	transition: transform 0.2s cubic-bezier(0.02,0.01,0.47,1),opacity 0.2s cubic-bezier(0.02,0.01,0.47,1);
	-webkit-transform: translate3d(50%,0,0) scale(0.9);
	        transform: translate3d(50%,0,0) scale(0.9);
	opacity: 0.15;
}
.cp_button07:hover:after {
	transition: transform 0.2s cubic-bezier(0.02,0.01,0.47,1) 0.05s,opacity 0.2s cubic-bezier(0.02,0.01,0.47,1) 0.05s;
	-webkit-transform: translate(50%) scale(1.1);
	        transform: translate(50%) scale(1.1);
	opacity: 0.25;
}
.cp_button07:active {
	opacity: 0.5;
}
.cp_button07:focus {
	color: #ffffff;
}

copypet.jp

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

More Info

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