css实现波形变换动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现波形变换动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
/**
* get random number.
* @param {number} min - min number.
* @param {number} max - max number.
*/
html,
body {
height: 100%;
width: 100%;
}
body {
background: #000;
position: relative;
overflow: hidden;
}
.criterion {
position: absolute;
top: 50%;
left: 50%;
height: 0;
width: 0;
transform: translate(-2.5px, -10px);
}
.shape {
position: absolute;
background-color: #fff;
width: 5px;
height: 20px;
}
.shape:nth-of-type(1) {
left: 100px;
top: 0px;
transform: scale(1, 1) rotate(0deg);
-webkit-animation: shape-animation0 4s ease-out 0ms infinite normal;
animation: shape-animation0 4s ease-out 0ms infinite normal;
}
.shape:nth-of-type(2) {
left: 98.4807753px;
top: 17.364817799999997px;
transform: scale(1, 1) rotate(10deg);
-webkit-animation: shape-animation1 4s ease-out 10ms infinite normal;
animation: shape-animation1 4s ease-out 10ms infinite normal;
}
.shape:nth-of-type(3) {
left: 93.9692621px;
top: 34.2020143px;
transform: scale(1, 1) rotate(20deg);
-webkit-animation: shape-animation2 4s ease-out 20ms infinite normal;
animation: shape-animation2 4s ease-out 20ms infinite normal;
}
.shape:nth-of-type(4) {
left: 86.60254040000001px;
top: 50px;
transform: scale(1, 1) rotate(30deg);
-webkit-animation: shape-animation3 4s ease-out 30ms infinite normal;
animation: shape-animation3 4s ease-out 30ms infinite normal;
}
.shape:nth-of-type(5) {
left: 76.6044443px;
top: 64.27876099999999px;
transform: scale(1, 1) rotate(40deg);
-webkit-animation: shape-animation4 4s ease-out 40ms infinite normal;
animation: shape-animation4 4s ease-out 40ms infinite normal;
}
.shape:nth-of-type(6) {
left: 64.27876099999999px;
top: 76.6044443px;
transform: scale(1, 1) rotate(50deg);
-webkit-animation: shape-animation5 4s ease-out 50ms infinite normal;
animation: shape-animation5 4s ease-out 50ms infinite normal;
}
.shape:nth-of-type(7) {
left: 50px;
top: 86.60254040000001px;
transform: scale(1, 1) rotate(60deg);
-webkit-animation: shape-animation6 4s ease-out 60ms infinite normal;
animation: shape-animation6 4s ease-out 60ms infinite normal;
}
.shape:nth-of-type(8) {
left: 34.2020143px;
top: 93.9692621px;
transform: scale(1, 1) rotate(70deg);
-webkit-animation: shape-animation7 4s ease-out 70ms infinite normal;
animation: shape-animation7 4s ease-out 70ms infinite normal;
}
.shape:nth-of-type(9) {
left: 17.364817799999997px;
top: 98.4807753px;
transform: scale(1, 1) rotate(80deg);
-webkit-animation: shape-animation8 4s ease-out 80ms infinite normal;
animation: shape-animation8 4s ease-out 80ms infinite normal;
}
.shape:nth-of-type(10) {
left: 0px;
top: 100px;
transform: scale(1, 1) rotate(90deg);
-webkit-animation: shape-animation9 4s ease-out 90ms infinite normal;
animation: shape-animation9 4s ease-out 90ms infinite normal;
}
.shape:nth-of-type(11) {
left: -17.364817799999997px;
top: 98.4807753px;
transform: scale(1, 1) rotate(100deg);
-webkit-animation: shape-animation10 4s ease-out 100ms infinite normal;
animation: shape-animation10 4s ease-out 100ms infinite normal;
}
.shape:nth-of-type(12) {
left: -34.2020143px;
top: 93.9692621px;
transform: scale(1, 1) rotate(110deg);
-webkit-animation: shape-animation11 4s ease-out 110ms infinite normal;
animation: shape-animation11 4s ease-out 110ms infinite normal;
}
.shape:nth-of-type(13) {
left: -50px;
top: 86.60254040000001px;
transform: scale(1, 1) rotate(120deg);
-webkit-animation: shape-animation12 4s ease-out 120ms infinite normal;
animation: shape-animation12 4s ease-out 120ms infinite normal;
}
.shape:nth-of-type(14) {
left: -64.27876099999999px;
top: 76.6044443px;
transform: scale(1, 1) rotate(130deg);
-webkit-animation: shape-animation13 4s ease-out 130ms infinite normal;
animation: shape-animation13 4s ease-out 130ms infinite normal;
}
.shape:nth-of-type(15) {
left: -76.6044443px;
top: 64.27876099999999px;
transform: scale(1, 1) rotate(140deg);
-webkit-animation: shape-animation14 4s ease-out 140ms infinite normal;
animation: shape-animation14 4s ease-out 140ms infinite normal;
}
.shape:nth-of-type(16) {
left: -86.60254040000001px;
top: 50px;
transform: scale(1, 1) rotate(150deg);
-webkit-animation: shape-animation15 4s ease-out 150ms infinite normal;
animation: shape-animation15 4s ease-out 150ms infinite normal;
}
.shape:nth-of-type(17) {
left: -93.9692621px;
top: 34.2020143px;
transform: scale(1, 1) rotate(160deg);
-webkit-animation: shape-animation16 4s ease-out 160ms infinite normal;
animation: shape-animation16 4s ease-out 160ms infinite normal;
}
.shape:nth-of-type(18) {
left: -98.4807753px;
top: 17.364817799999997px;
transform: scale(1, 1) rotate(170deg);
-webkit-animation: shape-animation17 4s ease-out 170ms infinite normal;
animation: shape-animation17 4s ease-out 170ms infinite normal;
}
.shape:nth-of-type(19) {
left: -100px;
top: 0px;
transform: scale(1, 1) rotate(180deg);
-webkit-animation: shape-animation18 4s ease-out 180ms infinite normal;
animation: shape-animation18 4s ease-out 180ms infinite normal;
}
.shape:nth-of-type(20) {
left: -98.4807753px;
top: -17.364817799999997px;
transform: scale(1, 1) rotate(190deg);
-webkit-animation: shape-animation19 4s ease-out 190ms infinite normal;
animation: shape-animation19 4s ease-out 190ms infinite normal;
}
.shape:nth-of-type(21) {
left: -93.9692621px;
top: -34.2020143px;
transform: scale(1, 1) rotate(200deg);
-webkit-animation: shape-animation20 4s ease-out 200ms infinite normal;
animation: shape-animation20 4s ease-out 200ms infinite normal;
}
.shape:nth-of-type(22) {
left: -86.60254040000001px;
top: -50px;
transform: scale(1, 1) rotate(210deg);
-webkit-animation: shape-animation21 4s ease-out 210ms infinite normal;
animation: shape-animation21 4s ease-out 210ms infinite normal;
}
.shape:nth-of-type(23) {
left: -76.6044443px;
top: -64.27876099999999px;
transform: scale(1, 1) rotate(220deg);
-webkit-animation: shape-animation22 4s ease-out 220ms infinite normal;
animation: shape-animation22 4s ease-out 220ms infinite normal;
}
.shape:nth-of-type(24) {
left: -64.27876099999999px;
top: -76.6044443px;
transform: scale(1, 1) rotate(230deg);
-webkit-animation: shape-animation23 4s ease-out 230ms infinite normal;
animation: shape-animation23 4s ease-out 230ms infinite normal;
}
.shape:nth-of-type(25) {
left: -50px;
top: -86.60254040000001px;
transform: scale(1, 1) rotate(240deg);
-webkit-animation: shape-animation24 4s ease-out 240ms infinite normal;
animation: shape-animation24 4s ease-out 240ms infinite normal;
}
.shape:nth-of-type(26) {
left: -34.2020143px;
top: -93.9692621px;
transform: scale(1, 1) rotate(250deg);
-webkit-animation: shape-animation25 4s ease-out 250ms infinite normal;
animation: shape-animation25 4s ease-out 250ms infinite normal;
}
.shape:nth-of-type(27) {
left: -17.364817799999997px;
top: -98.4807753px;
transform: scale(1, 1) rotate(260deg);
-webkit-animation: shape-animation26 4s ease-out 260ms infinite normal;
animation: shape-animation26 4s ease-out 260ms infinite normal;
}
.shape:nth-of-type(28) {
left: 0px;
top: -100px;
transform: scale(1, 1) rotate(270deg);
-webkit-animation: shape-animation27 4s ease-out 270ms infinite normal;
animation: shape-animation27 4s ease-out 270ms infinite normal;
}
.shape:nth-of-type(29) {
left: 17.364817799999997px;
top: -98.4807753px;
transform: scale(1, 1) rotate(280deg);
-webkit-animation: shape-animation28 4s ease-out 280ms infinite normal;
animation: shape-animation28 4s ease-out 280ms infinite normal;
}
.shape:nth-of-type(30) {
left: 34.2020143px;
top: -93.9692621px;
transform: scale(1, 1) rotate(290deg);
-webkit-animation: shape-animation29 4s ease-out 290ms infinite normal;
animation: shape-animation29 4s ease-out 290ms infinite normal;
}
.shape:nth-of-type(31) {
left: 50px;
top: -86.60254040000001px;
transform: scale(1, 1) rotate(300deg);
-webkit-animation: shape-animation30 4s ease-out 300ms infinite normal;
animation: shape-animation30 4s ease-out 300ms infinite normal;
}
.shape:nth-of-type(32) {
left: 64.27876099999999px;
top: -76.6044443px;
transform: scale(1, 1) rotate(310deg);
-webkit-animation: shape-animation31 4s ease-out 310ms infinite normal;
animation: shape-animation31 4s ease-out 310ms infinite normal;
}
.shape:nth-of-type(33) {
left: 76.6044443px;
top: -64.27876099999999px;
transform: scale(1, 1) rotate(320deg);
-webkit-animation: shape-animation32 4s ease-out 320ms infinite normal;
animation: shape-animation32 4s ease-out 320ms infinite normal;
}
.shape:nth-of-type(34) {
left: 86.60254040000001px;
top: -50px;
transform: scale(1, 1) rotate(330deg);
-webkit-animation: shape-animation33 4s ease-out 330ms infinite normal;
animation: shape-animation33 4s ease-out 330ms infinite normal;
}
.shape:nth-of-type(35) {
left: 93.9692621px;
top: -34.2020143px;
transform: scale(1, 1) rotate(340deg);
-webkit-animation: shape-animation34 4s ease-out 340ms infinite normal;
animation: shape-animation34 4s ease-out 340ms infinite normal;
}
.shape:nth-of-type(36) {
left: 98.4807753px;
top: -17.364817799999997px;
transform: scale(1, 1) rotate(350deg);
-webkit-animation: shape-animation35 4s ease-out 350ms infinite normal;
animation: shape-animation35 4s ease-out 350ms infinite normal;
}
.shape:nth-of-type(37) {
left: 100px;
top: 0px;
transform: scale(1, 1) rotate(360deg);
-webkit-animation: shape-animation36 4s ease-out 360ms infinite normal;
animation: shape-animation36 4s ease-out 360ms infinite normal;
}
@-webkit-keyframes shape-animation0 {
0% {
left: 100px;
top: 0px;
transform: scale(1, 1) rotate(0deg);
}
10% {
left: 100px;
top: 0px;
transform: scale(1, 1) rotate(0deg);
}
20% {
left: 175px;
top: 0;
transform: scale(1, 5) rotate(360deg);
}
30% {
left: 175px;
top: 0;
transform: scale(1, 5) rotate(0deg);
}
40% {
left: 175px;
top: 0;
transform: scale(1, 0) rotate(0deg);
}
50% {
left: 175px;
top: 0;
transform: scale(1, 18) rotate(0deg);
}
60% {
left: 0;
top: 0;
transform: scale(0, 0) rotate(0deg);
}
70% {
left: 0;
top: 0;
transform: scale(10, 10) rotate(0deg);
}
80% {
left: 0;
top: 0;
transform: scale(10, 10) rotate(90deg);
}
90% {
top: 175px;
left: 0;
transform: scale(1, 1) rotate(180deg);
}
100% {
top: 175px;
left: 0;
transform: scale(36, 1) rotate(90deg);
}
}
@keyframes shape-animation0 {
0% {
left: 100px;
top: 0px;
transform: scale(1, 1) rotate(0deg);
}
10% {
left: 100px;
top: 0px;
transform: scale(1, 1) rotate(0deg);
}
20% {
left: 175px;
top: 0;
transform: scale(1, 5) rotate(360deg);
}
30% {
left: 175px;
top: 0;
transform: scale(1, 5) rotate(0deg);
}
40% {
left: 175px;
top: 0;
transform: scale(1, 0) rotate(0deg);
}
50% {
left: 175px;
top: 0;
transform: scale(1, 18) rotate(0deg);
}
60% {
left: 0;
top: 0;
transform: scale(0, 0) rotate(0deg);
}
70% {
left: 0;
top: 0;
transform: scale(10, 10) rotate(0deg);
}
80% {
left: 0;
top: 0;
transform: scale(10, 10) rotate(90deg);
}
90% {
top: 175px;
left: 0;
transform: scale(1, 1) rotate(180deg);
}
100% {
top: 175px;
left: 0;
transform: scale(36, 1) rotate(90deg);
}
}
@-webkit-keyframes shape-animation1 {
0% {
left: 98.4807753px;
top: 17.364817799999997px;
transform: scale(1, 1) rotate(10deg);
}
10% {
left: 98.4807753px;
top: 17.364817799999997px;
transform: scale(1, 1) rotate(10deg);
}
20% {
left: 165px;
top: 0;
transform: scale(1, 5) rotate(370deg);
}
30% {
left: 165px;
top: 0;
transform: scale(1, 5) rotate(0deg);
}
40% {
left: 165px;
top: 0;
transform: scale(1, 0.5) rotate(0deg);
}
50% {
left: 165px;
top: 0;
transform: scale(1, 17.5) rotate(0deg);
}
60% {
left: 0;
top: 0;
transform: scale(0, 0) rotate(0deg);
}
70% {
left: 0;
top: 0;
transform: scale(10, 10) rotate(0deg);
}
80% {
left: 0;
top: 0;
transform: scale(10, 10) rotate(90deg);
}
90% {
top: 165px;
left: 0;
transform: scale(1, 1) rotate(180deg);
}
100% {
top: 165px;
left: 0;
transform: scale(36, 1) rotate(90deg);
}
}
@keyframes shape-animation1 {
0% {
left: 98.4807753px;
top: 17.364817799999997px;
transform: scale(1, 1) rotate(10deg);
}
10% {
left: 98.4807753px;
top: 17.364817799999997px;
transform: scale(1, 1) rotate(10deg);
}
20% {
left: 165px;
top: 0;
transform: scale(1, 5) rotate(370deg);
}
30% {
left: 165px;
top: 0;
transform: scale(1, 5) rotate(0deg);
}
40% {
left: 165px;
top: 0;
transform: scale(1, 0.5) rotate(0deg);
}
50% {
left: 165px;
top: 0;
transform: scale(1, 17.5) rotate(0deg);
}
60% {
left: 0;
top: 0;
transform: scale(0, 0) rotate(0deg);
}
70% {
left: 0;
top: 0;
transform: scale(10, 10) rotate(0deg);
}
80% {
left: 0;
top: 0;
transform: scale(10, 10) rotate(90deg);
}
90% {
top: 165px;
left: 0;
transform: scale(1, 1) rotate(180deg);
}
100% {
top: 165px;
left: 0;
transform: scale(36, 1) rotate(90deg);
}
}
@-webkit-keyframes shape-animation2 {
0% {
left: 93.9692621px;
top: 34.2020143px;
transform: scale(1, 1) rotate(20deg);
}
10% {
left: 93.9692621px;
top: 34.2020143px;
transform: scale(1, 1) rotate(20deg);
}
20% {
left: 155px;
top: 0;
transform: scale(1, 5) rotate(380deg);
}
30.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0