svg+css实现可折叠垂直菜单导航条代码

代码语言:html

所属分类:菜单导航

代码描述:svg+css实现可折叠垂直菜单导航条代码,点击右侧按钮宽度可缩小。

代码标签: svg css 可折叠 垂直 菜单 导航条 代码

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

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
<style>
    @import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap'); body {
    margin: 0;
    background: url('//repo.bfw.wiki/bfwrepo/image/652f365b334c0.png');
    background-size: cover;
}

* {
    font-family: 'Inter', sans-serif;
}

div#Drob_windows {
    width: 100%;
    height: 12px;
    border-radius: 15px 15px 0 0;
    position: absolute;
    top: 0;
    left: 0;
}

div#Drob_windows_bottom {
    width: 100%;
    height: 12px;
    border-radius: 0 0 15px 15px;
    position: absolute;
    bottom: 0;
    left: 0;
}

div#Drob_windows_right {
    width: 12px;
    height: 100%;
    border-radius: 0 15px 15px 0;
    position: absolute;
    bottom: 0;
    top: 0;
    right: 0;
}

div#Drob_windows_left {
    width: 12px;
    height: 100%;
    border-radius: 15px 0 0 15px;
    position: absolute;
    bottom: 0;
    top: 0;
    left: 0;
}

div#Drob_windows:hover, div#Drob_windows_bottom:hover, div#Drob_windows_left:hover, div#Drob_windows_right:hover {
    cursor: all-scroll;
}

.li_Menu_Title {
    font-weight: 600;
    color: white;
    margin-left: 25px;
    line-height: 2;
    transition: 2s;
}

svg.li_Menu_Icon {
    width: 30px;
    height: 30px;
}

li.li_Menu {
    display: flex;
    margin-top: 25px;
}

.TitleTop {
    color: #a1a6ac;
    font-size: 0.9rem;
    padding: 15px 0;
    position: relative;
}

.MenuSidebar {
    position: absolute;
    top: 145px;
    border-top: 1px solid #6868686b;
    width: 82%;
}

.WindowsTik {
    display: flex;
}

.InfoCo {
    position: absolute;
    top: 72px;
    display: flex;
}

.InfoCo_Title {
    color: white;
    line-height: 3.3;
    margin-left: 10px;
    transition: 2s;
}

.InfoCo_Logo_Box {
    background-color: white;
    width: 35px;
    height: 35px;
    padding: 8px;
    border-radius: 100%;
    position: relative;
}

img.InfoCo_Logo {
    width: 30px;
    height: 30px;
    margin: auto;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}

.IconSwitcher {
    width: 35px;
    height: 20px;
    margin: auto;
    fill: white;
}

.SwitcherSidebar {
    width: 35px;
    height: 35px;
    background-color: rgb(40 40 40 / 34%);
    position: absolute;
    right: 29px;
    float: right;
    border-radius: 100%;
    border: 1px solid #ffffff12;
    line-height: 2.7;
    cursor: pointer;
}

.TikSidebar {
    display: flex;
    padding-top: 11px;
}

.TikSidebar div {
    width: 15px;
    height: 15px;
    margin-right: 10px;
    border-radius: 100%;
}

.TikSidebar div:nth-child(1) {
    background: #ff5c4c;
}

.TikSidebar div:nth-child(2) {
    background: #ffbf38;
}

.TikSidebar div:nth-child(3) {
    background: #66e14f;
}

.MainSidebar {
    width: 270px;
    height: 650px;
    background-color: rgb(10 10 10 / 34%);
    backdrop-filter: blur(23px);
    position: fixed;
    right: 0;
    left: 0;
    top: 34px;
    bottom: 0;
    margin: 0 auto;
    border-radius: 15px;
    border: 1px solid #ffffff12;
    padding: 24px 31px;
    animation-duration: 1s;
}

li.li_Menu_top:nth-child(1) {
    margin-top: 0;
}

.KeyMainSidebar {
    animation-name: MainSidebar;
}

.KeyMainSidebar_back {
    animation-name: MainSidebar_back;
}

@keyframes MainSidebar {
    from {
        width: 270px;
    }

    to {
        width: 27px;
    }
}

@keyframes MainSidebar_b.........完整代码请登录后点击上方下载按钮下载查看

网友评论0