css实现蓝色圆柱体组成六边形上下起伏动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现蓝色圆柱体组成六边形上下起伏动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
:root {
--w: 8vmin; /*** change width ***/
--h: 15vmin; /*** change height ***/
--m: 8vmin; /*** change margin ***/
--s: 1.25s; /*** change speed ***/
}
body {
margin: 0;
padding: 0;
background: radial-gradient(#311d54 15%, #000000 100%);
font-family: 'Averia Sans Libre', Arial, sans-serif;
overflow: hidden;
}
.content {
height: 100vh;
width: 100vw;
text-align: center;
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
}
.pipe {
width: var(--w);
height: var(--w);
background: linear-gradient(90deg, #be9aff, #673ab7);
position: absolute;
animation: grow var(--s) ease-in-out 0s infinite alternate;
z-index: 50;
box-shadow: 1vmin 15vmin 5vmin 0vmin #00000020;
filter: hue-rotate(-15deg);
}
.pipe:before, .pipe:after {
content: "";
width: 100%;
height: calc(var(--w) / 2);
background: #be9aff;
position: absolute;
left: 0;
top: calc(calc(var(--w) / 4) * -1);
border-radius: 100%;
}
.pipe:after {
top: inherit;
bottom: calc(calc(var(--w) / 4) * -1);
background: linear-gradient(90deg, #be9aff, #673ab7);
}
@keyframes grow {
0% { height: var(--w); filter: hue-rotate(-15deg) brightness(0.85) ;}
100% { height: var(--h); filter: hue-rotate(-25deg) brightness(1.15) ;}
}
.pipe:nth-child(1n+2) {
animation-delay: 0.2s
}
.pipe:nth-child(1n+8) {
animation-delay: 0.4s
}
.pipe:nth-child(1n+20) {
animation-delay: 0.6s
}
.pipe:nth-child(1n+38) {
animation-delay: 0.8s
}
.pipe:nth-child(1n+62) {
animation-delay: 1s
}
/*** 2 ***/
.pipe:nth-child(2) {
margin-top: var(--m);
margin-left: var(--m);
z-index: 51;
}
.pipe:nth-child(3) {
margin-top: var(--m);
margin-left: calc(var(--m) * -1);
z-index: 51;
}
.pipe:nth-child(4) {
margin-top: 0vmin;
margin-left: calc(var(--m) * 2);
z-index: 50;
}
.pipe:nth-child(5) {
margin-left: calc(var(--m) * -2);
z-index: 50;
}
.pipe:nth-child(6) {
margin-left: var(--m);
margin-top: calc(var(--m) * -1);
z-index: 49;
}
.pipe:nth-child(7) {
margin-top: calc(var(--m) * -1);
margin-left: calc(var(--m) * -1);
z-index: 49;
}
/*** 3 ***/
.pipe:nth-child(8) {
margin-top: calc(var(--m) * 2);
z-index: 51;
}
.pipe:nth-child(9) {
margin-top: var(--m);
margin-left: calc(var(--m) * 3);
z-index: 50;
}
.pipe:nth-child(10) {
margin-top: var(--m);
margin-left: calc(var(--m) * -3);
z-index: 50;
}
.pipe:nth-child(11) {
margin.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0