css实现简洁菜单悬浮切换效果代码
代码语言:html
所属分类:菜单导航
代码描述:css实现简洁菜单悬浮切换效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link href="https://fonts.googleapis.com/css?family=Lato:100,100i,300,300i,400,400i,700,700i,900,900i|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i|Varela+Round" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Varela+Round" rel="stylesheet"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/normalize.5.0.css"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/font-awesome-4.7.0/css/font-awesome.min.css"> <style> html, body { height: 100%; } body { background: linear-gradient(45deg, #b9baff, #e7e7ff); background-attachment: fixed; margin: 0; padding: 0 0 0 0; color: #929292; } * { box-sizing: border-box; } *::after, *::before { box-sizing: inherit; } h2 { margin: 0; color: #031615; font-family: "Nunito", sans-serif; font-size: 22px; font-weight: 800; } ul { list-style: none; padding: 0; margin: 0; } a { text-decoration: none; color: inherit; } .background { height: 100%; position: relative; overflow: hidden; } .background span { display: block; } .background span.triangle-outline, .background span.triangle-outline--small { width: 0; height: 0; border: 50px solid transparent; border-top: 90px solid #fff; position: absolute; } .background span.triangle-outline::after, .background span.triangle-outline--small::after { content: ""; display: block; width: 0; height: 0; border: 50px solid transparent; border-top: 90px solid #d4d5ff; position: absolute; top: -109px; left: -50px; transform: scale(0.5); } .background span.triangle-outline { top: 60px; left: 60px; } .background span.triangle-outline--small { transform: scale(0.5) rotate(40deg); opacity: 0.7; right: 100px; bottom: 250px; } .background span.circle-outline, .background span.circle-outline--transparent { width: 110px; height: 110px; background: transparent; border-radius: 50%; border: 20px solid #fff; position: absolute; bottom: -55px; } .background span.circle-outline { bottom: -55px; left: 130px; } .background span.circle-outline--transparent { opacity: 0.4; top: -45px; right: -50px; } .background span.circle { width: 25px; height: 25px; background: #fff; opacity: 0.5; border-radius: 50%; position: absolute; bottom: 30px; left: 80px; } .background span.x { width: 10px; height: 60px; border-radius: 15px; position: absolute; top: 280px; right: 200px; background: #fff; transform: rotate(45deg); opacity: 0.8; } .background span.x::after { content: ""; display: block; width: 10px; height: 60px; border-radius: 15px; position: absolute; transform: rotate(90deg); background: #fff; } .menu-ui { position: absolute; bottom: 0; left: 0; right: 0; margin: auto; width: 340px; height: 90%; background: #fff; border-radius: 8px 8px 0 0; box-shadow: 0 10px 94px -45px #000; overflow: hidden; } .menu-ui .menu-wrapper { height: 100%; display: flex; flex-direction: column; position: relative; } .menu-ui .menu-wrapper .top-icons { width: 100%; position: absolute; z-index: 2; } .menu-ui .menu-wrapper .top-icons .icons-wrapper { padding: 1.3rem 1.6rem; display: flex; align-items: center; } .menu-ui .menu-wrapper .top-icons .icons-wrapper .ion-ios-settings { color: #cecfff; font-size: 30px; cursor: pointer; transition: all 500ms ease-in-out; } .menu-ui .menu-wrapper .top-icons .icons-wrapper .ion-ios-settings:hover { transform: rotate(-90deg); } .menu-ui .menu-wrapper .top-icons .icons-wrapper .bar-icon { margin-left: auto; direction: rtl; width: 35px; cursor: pointer; } .menu-ui .menu-wrapper .top-icons .icons-wrapper .bar-icon span { display: block; width: 30px; height: 4px; background: #cecfff; border-radius: 50px; transition: all 600ms ease; } .menu-ui .menu-wrapper .top-icons .icons-wrapper .bar-icon span:not(:last-child) { margin-bottom: 0.35rem; } .menu-ui .menu-wrapper .top-icons .icons-wrapper .bar-icon span:nth-child(1) { width: 14px; } .menu-ui .menu-wrapper .top-icons .icons-wrapper .bar-icon span:nth-child(1):after { left: -19px; } .menu-ui .menu-wrapper .top-icons .icons-wrapper .bar-icon span:nth-child(2) { width: 8px; } .menu-ui .menu-wrapper .top-icons .icons-wrapper .bar-icon span:nth-child(2):after { left: -13px; } .menu-ui .menu-wrapper .top-icons .icons-wrapper .bar-icon span:nth-child(3) { width: 22px; } .menu-ui .menu-wrapper .top-icons .icons-wrapper .bar-icon span:nth-child(3):after { left: -27px; } .menu-ui .menu-wrapper .top-icons .icons-wrapper .bar-icon span:after { content: ""; display: block; width: 4px; height: 4px; background: #cecfff; border-radius: 50%; position: relative; left: -30px; transition: all 400ms ease; } .menu-ui .menu-wrapper .top-icons .icons-wrapper .bar-icon:hover span { width: 30px; } .menu-ui .menu-wrapper .top-icons .icons-wrapper .bar-icon:hover span:nth-child(1):after { width: 16px; border-radius: 50px; left: 0px; } .menu-ui .menu-wrapper .top-icons .icons-wrapper .bar-icon:hover span:nth-child(2):after { width: 22px; border-radius: 50px; left: 0; } .menu-ui .menu-wrapper .top-icons .icons-wrapper .bar-icon:hover span:nth-child(3):after { width: 8px; border-radius: 50px; left: 0; } .menu-ui .menu-wrapper .profile-info { height: 300px; display: flex; flex-direction: column; justify-content: center; align-items: center; box-shadow: 0px 10px 40px rgba(0, 0, 0, 0.05); z-index: 1; } .menu-ui .menu-wrapper .profile-info .profile-img { width: 90px; height: 90px; position: relative; background: #f1f1f1; border-radius: 50%; text-align: center; } .menu-ui .menu-wrapper .profile-info .profile-img::after { content: ""; display: block; width: 18px; height: 18px; background: linear-gradient(to bottom, #88eb87, #22c221); border-radius: 50%; border: 3px solid #fff; position: absolute; bottom: 2px; right: 6px; } .menu-ui .menu-wrapper .profile-info .profile-img img { width: 100%; border-radius: 50%; .........完整代码请登录后点击上方下载按钮下载查看
网友评论0