div+css实现彩色炫酷六边形卷动动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现彩色炫酷六边形卷动动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
html, body {
width: 100%;
height: 100%;
}
body {
background-color: #140032;
overflow: hidden;
margin: 0;
}
body *, body *:after, body *:before {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}
.hexagon {
width: 150px;
height: 75px;
}
.hexagon, .hexagon span {
border-top-left-radius: 150px;
border-bottom-right-radius: 150px;
}
.hexagon span {
-webkit-animation: hexagon 3s linear infinite;
animation: hexagon 3s linear infinite;
}
.hexagon span:after, .hexagon span:before {
content: "";
background-color: currentColor;
width: 10px;
height: 10px;
border-radius: 50%;
}
.hexagon span:before {
transform: translate(75px, -37.5px);
}
.hexagon span:after {
transform: translate(-75px, 37.5px);
}
.hexagon:nth-child(1) {
transform: rotate(-7.2deg) translate(250px);
color: #ff1f00;
}
.hexagon:nth-child(1) span {
-webkit-animation-delay: -0.18s;
animation-delay: -0.18s;
background-color: rgba(255, 31, 0, 0.5);
}
.hexagon:nth-child(2) {
transform: rotate(-14.4deg) translate(250px);
color: #ff3d00;
}
.hexagon:nth-child(2) span {
-webkit-animation-delay: -0.36s;
animation-delay: -0.36s;
background-color: rgba(255, 61, 0, 0.5);
}
.hexagon:nth-child(3) {
transform: rotate(-21.6deg) translate(250px);
color: #ff5c00;
}
.hexagon:nth-child(3) span {
-webkit-animation-delay: -0.54s;
animation-delay: -0.54s;
background-color: rgba(255, 92, 0, 0.5);
}
.hexagon:nth-child(4) {
transform: rotate(-28.8deg) translate(250px);
color: #ff7a00;
}
.hexagon:nth-child(4) span {
-webkit-animation-delay: -0.72s;
animation-delay: -0.72s;
background-color: rgba(255, 122, 0, 0.5);
}
.hexagon:nth-child(5) {
transform: rotate(-36deg) translate(250px);
color: #ff9900;
}
.hexagon:nth-child(5) span {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s;
background-color: rgba(255, 153, 0, 0.5);
}
.hexagon:nth-child(6) {
transform: rotate(-43.2deg) translate(250px);
color: #ffb800;
}
.hexagon:nth-child(6) span {
-webkit-animation-delay: -1.08s;
animation-delay: -1.08s;
background-color: rgba(255, 184, 0, 0.5);
}
.hexagon:nth-child(7) {
transform: rotate(-50.4deg) translate(250px);
color: #ffd600;
}
.hexagon:nth-child(7) span {
-webkit-animation-delay: -1.26s;
animation-delay: -1.26s;
background-color: rgba(255, 214, 0, 0.5);
}
.hexagon:nth-child(8) {
transform: rotate(-57.6deg) translate(250px);
color: #fff500;
}
.hexagon:nth-child(8) span {
-webkit-animation-delay: -1.44s;
animation-delay: -1.44s;
background-color: rgba(255, 245, 0, 0.5);
}
.hexagon:nth-child(9) {
transf.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0