svg悬停动画
代码语言:html
所属分类:悬停
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
ul {
margin: 0;
padding: 3em;
box-sizing: border-box;
list-style: none;
width: 100%;
min-height: 100vh;
display: -webkit-box;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
flex-flow: row nowrap;
-webkit-box-pack: justify;
justify-content: space-between;
-webkit-box-align: center;
align-items: center;
}
ul li {
margin: 0;
padding: 0;
box-sizing: border-box;
width: calc(33% - 1.5rem);
position: relative;
}
ul li:hover #icon-lighthouse #rays-r path:nth-of-type(1), ul li:hover #icon-lighthouse #rays-r path:nth-of-type(3), ul li:hover #icon-lighthouse #rays-l path:nth-of-type(1), ul li:hover #icon-lighthouse #rays-l path:nth-of-type(3) {
stroke-dasharray: 15;
/*stroke-dashoffset: 15;*/
-webkit-animation: ray-beam-in-out-sm 0.5s linear forwards 0s, ray-beam-in-sm 0.35s ease-out forwards 0.75s;
animation: ray-beam-in-out-sm 0.5s linear forwards 0s, ray-beam-in-sm 0.35s ease-out forwards 0.75s;
}
ul li:hover #icon-lighthouse #rays-r path:nth-of-type(2), ul li:hover #icon-lighthouse #rays-l path:nth-of-type(2) {
stroke-dasharray: 20;
/*stroke-dashoffset: 20;*/
-webkit-animation: ray-beam-in-out-lg 0.5s linear forwards 0s, ray-beam-in-lg 0.35s ease-out forwards 0.75s;
animation: ray-beam-in-out-lg 0.5s linear forwards 0s, ray-beam-in-lg 0.35s ease-out forwards 0.75s;
}
@-webkit-keyframes ray-beam-in-out-sm {
0% {
stroke-dashoffset: 15;
}
100% {
stroke-dashoffset: -15;
}
}
@keyframes ray-beam-in-out-sm {
0% {
stroke-dashoffset: 15;
}
100% {
stroke-dashoffset: -15;
}
}
@-webkit-keyframes ray-beam-in-sm {
0% {
stroke-dashoffset: 15;
}
100% {
stroke-dashoffset: 0;
}
}
@keyframes ray-beam-in-sm {
0% {
stroke-dashoffset: 15;
}
100% {
stroke-dashoffset: 0;
}
}
@-webkit-keyframes ray-beam-in-out-lg {
0% {
stroke-dashoffset: 20;
}
100% {
stroke-dashoffset: -20;
}
}
@keyframes ray-beam-in-out-lg {
0% {
stroke-dashoffset: 20;
}
100% {
stroke-dashoffset: -20;
}
}
@-webkit-keyframes ray-beam-in-lg {
0% {
stroke-dashoffset: 20;
}
100% {
stroke-dashoffset: 0;
}
}
@keyframes ray-beam-in-lg {
0% {
stroke-dashoffset: 20;
}
100% {
stroke-dashoffset: 0;
}
}
ul li:hover #icon-target #arrow {
-webkit-tr.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0