css实现三角形内彩色变换动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现三角形内彩色变换动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: #000;
overflow: hidden;
--offset: 0s;
}
body .hover {
position: absolute;
z-index: 999;
width: 100vw;
height: 5vh;
top: 0;
left: 0;
}
body .hover:nth-of-type(1) {
top: 0%;
}
body .hover:nth-of-type(1):hover ~ #kaleidoscope {
--offset: -0.1s;
}
body .hover:nth-of-type(2) {
top: 5%;
}
body .hover:nth-of-type(2):hover ~ #kaleidoscope {
--offset: -0.2s;
}
body .hover:nth-of-type(3) {
top: 10%;
}
body .hover:nth-of-type(3):hover ~ #kaleidoscope {
--offset: -0.3s;
}
body .hover:nth-of-type(4) {
top: 15%;
}
body .hover:nth-of-type(4):hover ~ #kaleidoscope {
--offset: -0.4s;
}
body .hover:nth-of-type(5) {
top: 20%;
}
body .hover:nth-of-type(5):hover ~ #kaleidoscope {
--offset: -0.5s;
}
body .hover:nth-of-type(6) {
top: 25%;
}
body .hover:nth-of-type(6):hover ~ #kaleidoscope {
--offset: -0.6s;
}
body .hover:nth-of-type(7) {
top: 30%;
}
body .hover:nth-of-type(7):hover ~ #kaleidoscope {
--offset: -0.7s;
}
body .hover:nth-of-type(8) {
top: 35%;
}
body .hover:nth-of-type(8):hover ~ #kaleidoscope {
--offset: -0.8s;
}
body .hover:nth-of-type(9) {
top: 40%;
}
body .hover:nth-o.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0