[パーツ]ローディング 四角いパーツが横に広がりながら光るローディング

CSS HTML
 2018.03.15
 2018.03.23

四角いパーツが横に広がりながら光るローディング

cssのanimationを使ったローディングサンプル。
四角いパーツが横に広がりながら光るローディングです。

browser:  65 11 20 10 
ニャン易度 
<div class="cp_loading17">
	<div class="cp_item"></div>
	<div class="cp_item"></div>
	<div class="cp_item"></div>
	<div class="cp_item"></div>
	<div class="cp_item"></div>
</div>
*, *:before, *:after {
	-webkit-box-sizing: border-box;
	        box-sizing: border-box;
}
.cp_loading17 {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100px;
	-webkit-transform: translate(-50%,-50%);
					transform: translate(-50%,-50%);
}
.cp_loading17 .cp_item {
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: 1px;
	margin-left: 1px;
	-webkit-animation: loading17 1s ease-in infinite;
	        animation: loading17 1s ease-in infinite;
	-webkit-animation-delay: 0;
	        animation-delay: 0;
	opacity: 0.1;
	background-color: #ff7043;
}
.cp_loading17 .cp_item:nth-child(1) {
	-webkit-animation-delay: 0.3s;
	        animation-delay: 0.3s;
}
.cp_loading17 .cp_item:nth-child(2) {
	-webkit-animation-delay: 0.2s;
	        animation-delay: 0.2s;
}
.cp_loading17 .cp_item:nth-child(3) {
	-webkit-animation-delay: 0.1s;
	        animation-delay: 0.1s;
}
.cp_loading17 .cp_item:nth-child(4) {
	-webkit-animation-delay: 0.2s;
	        animation-delay: 0.2s;
}
.cp_loading17 .cp_item:nth-child(5) {
	-webkit-animation-delay: 0.3s;
	        animation-delay: 0.3s;
}
@-webkit-keyframes loading17 {
	0% {
		-webkit-transform: scale(1.2);
		        transform: scale(1.2);
		opacity: 1;
	}
	100% {
		-webkit-transform: scale(0.7);
		        transform: scale(0.7);
		opacity: 0.1;
	}
}
@keyframes loading17 {
	0% {
		-webkit-transform: scale(1.2);
		        transform: scale(1.2);
		opacity: 1;
	}
	100% {
		-webkit-transform: scale(0.7);
		        transform: scale(0.7);
		opacity: 0.1;
	}
}

copypet.jp

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

More Info

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