[パーツ]ローディング 縦に並んだドットが左右にふわふわ揺れるローディング

CSS HTML
 2018.03.14
 2018.03.23

縦に並んだドットが左右にふわふわ揺れるローディング

cssのanimationを使ったローディングサンプル。
縦に並んだドットが左右にふわふわ揺れるローディングです。

browser:  65 11 20 10 
ニャン易度 
<div class="cp_loading15">
	<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>
.cp_loading15 {
	position: absolute;
	top: 50%;
	left: 50%;
	-webkit-transform: translate(-50%,-50%);
	        transform: translate(-50%,-50%);
}
.cp_loading15 .cp_item {
	width: 15px;
	height: 15px;
	margin: 15px auto;
	border-radius: 50px;
}
.cp_loading15 .cp_item:nth-child(1) {
	-webkit-animation: loading15_right 1s infinite cubic-bezier(.64,.1,.64,.9);
	        animation: loading15_right 1s infinite cubic-bezier(.64,.1,.64,.9);
	background: #26A69A;
}
.cp_loading15 .cp_item:nth-child(2) {
	-webkit-animation: loading15_left 1.1s infinite cubic-bezier(.64,.1,.64,.9);
	        animation: loading15_left 1.1s infinite cubic-bezier(.64,.1,.64,.9);
	background: #9CCC65;
}
.cp_loading15 .cp_item:nth-child(3) {
	-webkit-animation: loading15_right 1.05s infinite cubic-bezier(.64,.1,.64,.9);
	        animation: loading15_right 1.05s infinite cubic-bezier(.64,.1,.64,.9);
	background: #FFEE58;
}
.cp_loading15 .cp_item:nth-child(4) {
	-webkit-animation: loading15_left 1.15s infinite cubic-bezier(.64,.1,.64,.9);
	        animation: loading15_left 1.15s infinite cubic-bezier(.64,.1,.64,.9);
	background: #FFA726;
}
.cp_loading15 .cp_item:nth-child(5) {
	-webkit-animation: loading15_right 1.1s infinite cubic-bezier(.64,.1,.64,.9);
	        animation: loading15_right 1.1s infinite cubic-bezier(.64,.1,.64,.9);
	background: #ef5350;
}
@-webkit-keyframes loading15_right {
	0% {
		-webkit-transform: translate(-15px);
		        transform: translate(-15px);
	}
	50% {
		-webkit-transform: translate(15px);
		        transform: translate(15px);
	}
	100% {
		-webkit-transform: translate(-15px);
		        transform: translate(-15px);
	}
}
@-webkit-keyframes loading15_left {
	0% {
		-webkit-transform: translate(15px);
		        transform: translate(15px);
	}
	50% {
		-webkit-transform: translate(-15px);
		        transform: translate(-15px);
	}
	100% {
		-webkit-transform: translate(15px);
		        transform: translate(15px);
	}
}
@keyframes loading15_right {
	0% {
		-webkit-transform: translate(-15px);
		        transform: translate(-15px);
	}
	50% {
		-webkit-transform: translate(15px);
		        transform: translate(15px);
	}
	100% {
		-webkit-transform: translate(-15px);
		        transform: translate(-15px);
	}
}
@keyframes loading15_left {
	0% {
		-webkit-transform: translate(15px);
		        transform: translate(15px);
	}
	50% {
		-webkit-transform: translate(-15px);
		        transform: translate(-15px);
	}
	100% {
		-webkit-transform: translate(15px);
		        transform: translate(15px);
	}
}

copypet.jp

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

More Info

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