[パーツ]ローディング 1/4の丸が少しずつずれながら回るローディング

CSS HTML
 2018.03.13
 2018.03.23

1/4の丸が少しずつずれながら回るローディング

cssのanimationを使ったローディングサンプル。
1/4の丸が少しずつずれながら回るローディングです。

browser:  65 11 20 10 
ニャン易度 
<span class="cp_loading04 cp_item"> </span>
.cp_loading {
	width: 300px;
	height: 200px;
	margin: 2em auto;
	padding: 0.5em;
	text-align: center;
	position: relative;
	overflow: hidden;
}
.cp_loading04 {
	position: absolute;
	top: 42%;
	left: 42%;
	width: 50px;
	height: 50px;
}
.cp_loading04.cp_item {
	-webkit-animation: loading04 1s cubic-bezier(.17,.67,.88,.52) infinite;
	        animation: loading04 1s cubic-bezier(.17,.67,.88,.52) infinite;
	border: 3px solid transparent;
	border-top-color: #4dd0e1;
	border-radius: 50px;
}
.cp_loading04.cp_item:before,
.cp_loading04.cp_item:after {
	position: absolute;
	top: 5px;
	right: 5px;
	bottom: 5px;
	left: 5px;
	content: '';
	-webkit-animation: loading04_reverse 4s cubic-bezier(.58,.17,.67,.83) infinite;
	        animation: loading04_reverse 4s cubic-bezier(.58,.17,.67,.83) infinite;
	opacity: .8;
	border: 3px solid transparent;
	border-radius: 50px;
	filter: alpha(opacity=80);
}
.cp_loading04.cp_item:before {
	top: 15px;
	right: 15px;
	bottom: 15px;
	left: 15px;
	-webkit-animation: loading04_reverse 8s cubic-bezier(.17,.67,.88,.52) infinite;
	        animation: loading04_reverse 8s cubic-bezier(.17,.67,.88,.52) infinite;
	border-top-color: #FDD835;
}
.cp_loading04.cp_item:after {
	border-top-color: #26A69A;
}
@keyframes loading04 {
	0% {
		-webkit-transform: rotate(0deg);
		transform: rotate(0deg);
	}
	100% {
		-webkit-transform: rotate(360deg);
		transform: rotate(360deg);
	}
}
@keyframes loading04_reverse {
	0% {
		-webkit-transform: rotate(0deg);
		transform: rotate(0deg);
	}
	100% {
		-webkit-transform: rotate(-360deg);
		transform: rotate(-360deg);
	}
}

copypet.jp

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

More Info

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