div+css实现伸缩透明的左侧菜单栏效果代码
代码语言:html
所属分类:菜单导航
代码描述:div+css实现伸缩透明的左侧菜单栏效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.6.4.0.css">
<style>
@import url("https://fonts.googleapis.com/css2?family=Mulish:wght@400;500;600&family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap");
/* DEFAULT VALUES */
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
nav {
user-select:none;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
-o-user-select:none;
}
nav > ul,
nav > ul > li {
outline: 0;
}
nav > ul > li > a {
text-decoration: none;
}
body {
min-height: 100vh;
background: linear-gradient(90deg, #aea4e3, #d3ffe8);
}
/* MAIN MENU */
.main-menu {
position:fixed;
top: 0;
left: 0;
height: 100%;
width: 60px;
overflow:hidden;
background: #0009;
transition: width .05s linear;
-webkit-transition: width .05s linear;
z-index: 10;
padding-top: 10px;
}
.main-menu:hover {
width: 180px;
overflow:visible;
}
.main-menu > ul > li {
position: relative;
display: block;
width: 180px;
}
.main-menu > ul > li > a {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
color:#999;
font-size: 1rem;
transition:all .1s linear;
-webkit-transition:all .1s linear;
padding: 10px 0;
}
.nav-icon {
width: 60px;
height: 20px;
font-size: 20px;
text-align: center;
}
.nav-text {
width: 120px;
height: 20px;
font-family: "Mulish", sans-serif;
}
.logout {
position: absolute;
left: 0;
bottom: 0;
}
.main-menu li:hover > a, .main-menu li.active > a, .main-menu li > a:focus {
text-decoration: none;
color: #fff;
background-color: rgb(29, 79, 215, 0.7);
}
/* ANIMATED BACKGROUND */
.container {
background:#1F2024;
min-height: 100vh;
overflow: hidden;
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.blob-c {
min-height: 100vh;
overflow: hidden;
position:absolute;
width: 100%;
filter: blur(40px);
/* background: rgba(255,255,255,0.1) */
}
.shape-blob {
background:#26C3F9;
height: 60px;
width: 80px;
border-radius: 40% 50% 30% 40%;
animation:
transform 18s ease-in-out infinite both alternate,
movement_one 12s ease-in-out infinite both;
opacity:.7;
position: absolute;
left: 75%;
top: 40%;
}
.shape-blob.one{
background:#0085FF;
height: 150px;
width: 200px;
left: 10px;
top: 10px;
transform: rotate(-180deg);
animation: transform 8s ease-in-out infinite both alternate, movement_two 20s ease-in-out infinite both;
}
.shape-blob.six{
background:#0EAFFF;
height: 70px;
width: 100px;
left: 160px;
top: 200px;
transform: rotate(-180deg);
animation: transform 5s ease-in-out infinite both alternate, movement_two 5s ease-in-out infinite both;
}
.shape-blob.four{
background:#4EAEFF;
height: 100px;
width: 80px;
left: 350px;
top: 60px;
transform: rotate(-180deg);
.........完整代码请登录后点击上方下载按钮下载查看
网友评论0