js+css实现垂直滑动菜单导航条效果代码
代码语言:html
所属分类:菜单导航
代码描述:js+css实现垂直滑动菜单导航条效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Quicksand:400,500,700&display=swap'> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.5.11.2.css"> <style> *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } .container { background-color: #ffe7d1; min-height: 100vh; display: flex; align-items: center; justify-content: center; font-family: "Quicksand", sans-serif; } .navigation { position: relative; border-radius: 24px; overflow: hidden; box-shadow: 0 20px 60px rgba(52, 143, 108, 0.3); } .navigation__list { list-style: none; padding: 0; margin: 0; background-color: #348f6c; border-radius: 24px; padding: 32px 20px; min-width: 220px; box-shadow: 0 30px 45px rgba(52, 143, 108, 0.4); overflow: hidden; } .navigation__link { display: block; text-decoration: none; color: white; padding: 14px 12px 16px; font-weight: 400; display: flex; align-items: center; flex-direction: row; transition: all ease 0.3s; will-change: color, transform; } .navigation__icon { margin-right: 12px; width: 20px; stroke: #e3ca93; } .navigation__item { z-index: 2; position: relative; } .navigation__item.active .navigation__link { color: #348f6c; } .navigation__separator { background-color: white; width: calc(100% - 12px); height: 54px; position: absolute; top: 32px; left: 12px; border-radius: 26px 0 0 26px; transition: all ease 0.3s; will-change: transform; } .navigation__separator-before { position: absolute; width: 20px; height: 20px; background-color: white; bottom: 100%; right: 0; } .navigation__separator-before::before { content: ""; position: absolute; width: 40px; height: 40px; border-radius: 50%; background-color: #348f6c; bottom: 0; right: 0; } .navigation__separator-after { position: absolute; width: 20px; height: 20px; background-color: white; top: 100%; right: 0; } .navigation__separator-after::before { content: ""; position: absolute; width: 40px; height: 40px; border-radius: 50%; background-color: #348f6c; top: 0; right: 0;.........完整代码请登录后点击上方下载按钮下载查看
网友评论0