ionicons+css实现魔术放大镜滑动导航条菜单效果代码
代码语言:html
所属分类:菜单导航
代码描述:ionicons+css实现魔术放大镜滑动导航条菜单效果代码
代码标签: ionicons css 魔术 放大镜 滑动 导航条 菜单
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap'); * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; } body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: #06021b; } .navigation { position: relative; width: 400px; height: 70px; background: linear-gradient(155deg, #192b6e, #a6307c); display: flex; justify-content: center; align-items: center; border-radius: 10px; } .navigation ul { display: flex; width: 350px; } .navigation ul li { position: relative; width: 70px; height: 70px; list-style: none; z-index: 1; } .navigation ul li a { position: relative; display: flex; justify-content: center; align-items: center; flex-direction: column; width: 100%; text-align: center; font-weight: 500; } .navigation ul li a .icon { position: relative; display: block; line-height: 75px; font-size: 1.5em; text-align: center; color: #fff; transition: .5s; } .navigation ul li.active a .icon { transform: translateY(-32px); } .navigation ul li a .text { position: absolute; color: #fff; font-weight: 400; font-size: .75em; letter-spacing: .05em; opacity: 0; transform: translateY(20px); transition: .5s; } .navigation ul li.active a .text { opacity: 1; transform: translateY(10px); } .navigation ul li a .circle { position: absolute; display: block; width: 50px; height: 50px; background: transparent; border-radius: 50%; border: 1.8px solid #fff; transform: translateY(-37px) scale(0); } .navigation ul li.active a .circle { transition: .5s; transition-delay: .5s; transform: translateY(-37px) scale(1); } .indicator { position: absolute; top: -50%; width: 70px; height: 70px; background: linear-gradient(0deg, #ffa576,#0951eb); border: 6px solid #06021b; border-radius: 50%; display: flex; justify-content: center; align-items: center; transition: .5s; } .indicator::before { content: ''; position: absolute; top: 50%; left: -22px; width: 20px; height: 20px; background: transparent; border-top-right-radius: 20px; box-shadow: 1px -10px 0 #06021b; } .indicator::after { content: ''; position: absolute; top: 50%; right: -22px; width: 20px; height: 20px; background: transparent; border-top-left-radius: 20px; box-shadow: -1px -10px 0 #06021b; } .navigation ul li:nth-child(1).active~.indicator { transform: translateX(calc(70px * 0)); } .navigation ul li:nth-child(2).active~.indicator { transform: translateX(calc(70px * 1)); } .navigation ul li:nth-child(3).active~.indicator { transform: translateX(calc(70px * 2)); } .navigation ul li:n.........完整代码请登录后点击上方下载按钮下载查看
网友评论0