svg+css实现图标菜单悬浮效果代码

代码语言:html

所属分类:菜单导航

代码描述:svg+css实现图标菜单悬浮效果代码

代码标签: svg css 图标 菜单 悬浮

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
<style>
    body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #151519;
}

* {
  box-sizing: border-box;
}

div {
  transform: scale(3);
}
div a {
  padding: 7px;
  border-radius: 999px;
  display: flex;
  float: left;
  margin: 4px;
}
div a:hover {
  background: rgba(255, 255, 255, 0.04);
}

.foryou svg path {
  stroke: #C1C1C1;
  transform-origin: center;
  transition: all 0.25s ease;
}
.foryou svg path:first-child {
  stroke-dasharray: 43;
  transform: rotate(240deg);
}
.foryou svg path:last-child {
  transform: rotate(0);
}
.foryou:hover path {
  stroke: #E6E6E6;
}
.foryou:hover path:first-child {
  stroke-dasharray: 40;
}
.foryou:hover path:last-child {
  transform: rotate(-90deg);
}

.graphs svg path {
  stroke: #C1C1C1;
  transform-origin: center;
  transition: all 0.25s ease;
}
.graphs svg path:nth-child(2) {
  stroke-dasharray: 4;
  stroke-dashoffset: 8;
}
.graphs svg path:last-child {
  stroke-dasharray: 4;
  stroke-dashoffset: 0;
}
.graphs:hover path {
  stroke: #E6E6E6;
}
.graphs:hover path:nth-child(2), .graphs:hover path:last-child {
  stroke-dashoffset: 4;
}

.screener svg path {
  stroke: #C1C1C1;
  transform-origin: center;
  transition: all 0.25s ease;
}
.screener svg path:last-child {
  stroke-dasharray: 3;
  stroke-dashoffset: 0;
}
.screener:hover path {
  stroke: #E6E6E6;
}
.screener:hover path:last-child {
  stroke-dashoffset: 3;
}

.settings svg circle {
  stroke: #C1C1C1;
}
.settings svg path {
  stroke: #C1C1C1;
  transform-origin: center;
  transition: all 0.25s ease;
}
.settings svg path:last-child {
  stroke-dasharray: 4;
  stroke-dashoffset: 0;
}
.settings:hover path {
  stroke: #E6E6E6;
}
.settings:hover path:last-child {
  stroke-dashoffset: 4;
}
</style>
    </head>
    <body>

        <div>
            <a href="#" class="foryou">
                <svg width="18" height=".........完整代码请登录后点击上方下载按钮下载查看

网友评论0