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-of-type(9):hover ~ #kaleidoscope {
--offset: -0.9s;
}
body .hover:nth-of-type(10) {
top: 45%;
}
body .hover:nth-of-type(10):hover ~ #kaleidoscope {
--offset: -1s;
}
body .hover:nth-of-type(11) {
top: 50%;
}
body .hover:nth-of-type(11):hover ~ #kaleidoscope {
--offset: -1.1s;
}
body .hover:nth-of-type(12) {
top: 55%;
}
body .hover:nth-of-type(12):hover ~ #kaleidoscope {
--offset: -1.2s;
}
body .hover:nth-of-type(13) {
top: 60%;
}
body .hover:nth-of-type(13):hover ~ #kaleidoscope {
--offset: -1.3s;
}
body .hover:nth-of-type(14) {
top: 65%;
}
body .hover:nth-of-type(14):hover ~ #kaleidoscope {
--offset: -1.4s;
}
body .hover:nth-of-type(15) {
top: 70%;
}
body .hover:nth-of-type(15):hover ~ #kaleidoscope {
--offset: -1.5s;
}
body .hover:nth-of-type(16) {
top: 75%;
}
body .hover:nth-of-type(16):hover ~ #kaleidoscope {
--offset: -1.6s;
}
body .hover:nth-of-type(17) {
top: 80%;
}
b.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0