svg+css实现悬浮九宫格图标菜单显示效果代码
代码语言:html
所属分类:菜单导航
代码描述:svg+css 实现悬浮九宫格图标菜单显示效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum=1.0,minimum=1.0,user-scalable=0" />
<style>
body{
margin: 100px;
}
.main_back {
position: absolute;
border-radius: 10px;
transform: rotate(90deg);
width: 11em;
height: 11em;
background: linear-gradient(270deg, #03a9f4, #cc39a4, #ffb5d2);
z-index: -2;
box-shadow: inset 0px 0px 180px 5px #ffffff;
}
.main {
display: flex;
flex-wrap: wrap;
width: 14em;
align-items: center;
justify-content: center;
z-index: -1;
}
.card {
width: 60px;
height: 60px;
border-top-left-radius: 10px;
background: lightgrey;
transition: .4s ease-in-out, .2s background-color ease-in-out, .2s background-image ease-in-out;
background: rgba(255, 255, 255, 0.596);
backdrop-filter: blur(5px);
border: 1px solid transparent;
-webkit-backdrop-filter: blur(5px);
display: flex;
align-items: center;
justify-content: center;
}
.card .instagram {
opacity: 0;
transition: .2s ease-in-out;
fill: #cc39a4;
}
.card:nth-child(2) {
border-radius: 0px;
}
.card:nth-child(2) .twitter {
opacity: 0;
transition: .2s ease-in-out;
fill: #03A9F4;
}
.card:nth-child(3) {
border-top-right-radius: 10px;
border-top-left-radius: 0px;
}
.card:nth-child(3) .dribble {
opacity: 0;
transition: .2s ease-in-out;
fill: #ffb5d2;
}
.card:nth-child(4) {
border-radius: 0px;
}
.card:nth-child(4) .codepen {
opacity: 0;
transition: .2s ease-in-out;
fill: black;
}
.card:nth-child(5) {
border-radius: 0px;
}
.card:nth-child(5) .uiverse {
position: absolute;
margin-left: 0.2em;
margin-top: 0.2em;
opacity: 0;
transition: .2s ease-in-out;
}
.card:nth-child(6) {
border-radius: 0px;
}
.card:nth-child(6) .discord {
opacity: 0;
transition: .2s ease-in-out;
fill: #8c9eff;
}
.card:nth-child(7) {
border-bottom-left-radius: 10px;
border-top-left-radius: 0px;
}
.card:nth-child(7) .github {
opacity: 0;
transition: .2s ease-in-out;
fill: black;
}
.card:nth-child(8) {
border-radius: 0px;
}
.card:nth-child(8) .telegram {
opacity: 0;
transition: .2s ease-in-out;
fill: #29b6f6;
}
.card:nth-child(9) {
border-bottom-right-radius: 10px;
border-top-left-radius: 0px;
}
.card:nth-child(9) .reddit {
opacity: 0;
transition: .2s ease-in-out;
}
.main:hover {
width: 14em;
cursor: pointer;
}
.main:hover .main_back {
opacity: 0;
}
.main:hover .card {
margin: .2em;
border-radius: 10px;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
border: 1px solid rgba(255, 255, 255, 0.3);
background: rgba(255, 255, 255, 0.2);
}
.main:hover .card:nth-child(5) {
border: transparent;
}
.main:hover .text {
opacity: 0;
z-index: -3;
}
.main:hover .instagram {
opacity: 1;
}
.main:hover .twitter {
opacity: 1;
}
.main:hover .dribble {
opacity: 1;
}
.main:hover .codepen {
opacity: 1;
}
.main:hover .uiverse {
opacity: 1;
}
.m.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0