css+svg实现底部tab导航条切换选项卡显示卡片列表数据效果代码
代码语言:html
所属分类:选项卡
代码描述:css+svg实现底部tab导航条切换选项卡显示卡片列表数据效果代码
代码标签: css svg 底部 tab 导航条 切换 选项卡 显示 卡片 列表
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400&display=swap'); :root { --icon: #fff; --dark: #1e1f26; --tran: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) 0s; --font: 'Lato', Arial, Helvetica, serif; } body { width: 100vw; height: 100vh; display: flex; justify-content: center; align-items: center; overflow: hidden; margin: 0; font-family: var(--font); background-color: #7f5a83; background-image: linear-gradient(315deg, #7f5a83 0%, #0d324d 74%); } .content { height: 350px; display: flex; justify-content: center; align-items: center; position: relative; width: 350px; background: linear-gradient(0deg, #fff6, #fff2, #fff2); border-radius: 5px; max-height: 96vh; } nav.bar { display: flex; justify-content: center; align-items: flex-end; width: calc(100% - 30px); height: 65px; bottom: 10px; position: absolute; } nav.bar:before, nav.bar:after { content: ""; width: 6px; height: 65px; background: var(--dark); position: absolute; left: -5px; bottom: 0; border-radius: 5px 0 0 5px; } nav.bar:after { left: inherit; right: -5px; border-radius: 0 5px 5px 0; } input { display: none; } label { text-decoration: none; text-transform: uppercase; font-size: 10px; width: 50px; height: 50px; text-align: center; display: inline-grid; color: var(--dark); position: relative; transition: var(--tran); cursor: pointer; align-items: end; background-repeat: no-repeat; background-size: 25px 25px; background-position: 12px 10px; bottom: 7px; margin: 0 10px; z-index: 4; } label:hover { color: #fff; height: 55px; } input:checked + label { height: 70px; padding-bottom: 10px; } .selector { width: 100%; height: 90px; position: absolute; bottom: 0; left: 0; z-index: 0; transition: var(--tran); overflow: hidden; } .selector:before { content: ""; background: radial-gradient(circle at 50% 0%, #fff0 25px, var(--dark) 26px 100%), radial-gradient(circle at 50% 25px, var(--dark) 0 20px, #fff0 21px 100%), radial-gradient(circle at calc(50% + 0px) 23px, #0009 15px, #fff0 23px 100%), radial-gradient(circle at calc(50% - 0px) 30px, #fff8 15px, #fff0 23px 100%); width: 200%; height: 100%; position: absolute; bottom: 0; left: 0; z-index: -1; transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) 0s; background-repeat: no-repeat; background-size: 100% 65px, 100% 100%, 100% 100%, 100% 100%; background-position: 0 100%, 0 0, 0 0, 0 0; } #m-search:checked ~ .selector:before { left: calc(-50% - 105px); } #m-popular:checked ~ .selector:before { left: calc(-50% - 36px ); } #m-forked:checked ~ .selector:before { left: calc(-50% + 34px ); } #m-loved:checked ~ .selector:before { left: calc(-50% + 105px); } /*** Icons ***/ label:before, label:after { content: ""; position: absolute; box-sizing: border-box; transition: all 0.5s ease 0s; } /*** Search ***/ label[for=m-search]:before { width: 16px; height: 16px; left: 12px; top: 11px; border: 3px solid var(--icon); border-radius: 100%; transition: var(--tran); } label[for=m-search]:after { width: 11px; height: 4px; left: 28px; top: 24px; transition: var(--tran); background: var(--icon); transform-origin: left top; transform: rotate(45deg); border-radius: 0 5px 5px 0; } /*** Popular ***/ label[for=m-popular]:before { width: 26px; height: 26px; left: 11px; top: 10px; transition: var(--tran); border-radius: 1px; background: var(--icon); clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); } /*** Forked ***/ label[for=m-forked]:before { width: 25px; height: 25px; left: 12px; top: 10px; z-index: 1; border-radius: 0; transition: var(--tran); background: conic-gradient(from 90deg at 0 0, var(--icon) 0 25%, #fff0 0 100%), radial-gradient(#fff0 1px, var(--icon) 2px 3px, #fff0 4px 100% ), radial-gradient(#fff0 1px, var(--icon) 2px 3px, #fff0 4px 100% ), radial-gradient(#fff0 1px, var(--icon) 2px 3px, #fff0 4px 100% ); background-repeat: no-repeat; background-size: 2px 13px, 12px 12px, 12px 12px, 12px 12px; background-position: 4px 6px, -1px -2px, -1px 15px, 13px -1px; } label[for=m-forked]:after { width: 15px; height: 10px; left: 17px; top: 17px; z-index: 0; transition: var(--tran); transition-property: --icon !important; border-right: 2px solid var(--icon); border-bottom: 2px solid var(--icon); border-radius: 0 0 10px 0; } /*** Loved ***/ label[for=m-loved]:before { width: 22px; height: 22px; left: 10px; top: 0px; transition: var(--tran); background: radial-gradient(circle at 7px 7px, var(--icon) 0 6px, #fff0 7px 100%), radial-gradient(circle at 15px 15px, var(--icon) 0 6px, #fff0 7px 100%), linear-gra.........完整代码请登录后点击上方下载按钮下载查看
网友评论0