css实现玻璃磨砂背景右侧菜单效果代码
代码语言:html
所属分类:背景
代码描述:css实现玻璃磨砂背景右侧菜单效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @import url('https://fonts.googleapis.com/css2?family=Halant:wght@700&family=Nunito+Sans:wght@300&display=swap'); *{ margin: 0; padding: 0; box-sizing: border-box; } body{ height: 100vh; width: 100vw; position: relative; background-color: #000; background-image: linear-gradient(to left, rgba(55,55,55,0.5), #050505); background-size: cover; background-position: center center; background-repeat: no-repeat; display: flex; align-items: center; justify-content: flex-start; padding-left: 16px; font-family: 'Halant', serif; line-height: 1.5; } h1{ max-width: 60vw; font-size: 24px; color: #d9dfd9; letter-spacing: 0.08rem; max-width: calc(100vw - 350px); } @media (max-width: 720px){ h1{ max-width: calc(100vw - 150px); font-size: 20px; line-height:1.8rem; } } h1 span{ font-family: 'Nunito Sans', sans-serif; font-size: 16px; font-weight: 300; display: block; } ul{ height: 100vh; width: 300px; position: absolute; right: 0px; top: 0px; background: rgba(255, 255, 255, 0.04); backdrop-filter: blur( 13.5px ); -webkit-backdrop-filter: blur(81.55px ); list-style: none; display: flex; flex-direction: column; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; } @media (max-width: 720px){ ul{ max-width: 250px; } } .btn-open{ background: unset; border: unset; position: absolute; top: 16px; right: 16px; } .btn-open svg{ stroke: #ddd; stroke-width: 3; cursor: pointer; } ul .btn-close{ background: unset; border: unset; position: absolute; top: 16px; right: 16px; } ul .btn-close svg{ stroke: #ddd; stroke-width: 3; cursor: pointer; } ul li{ text-transform: uppercase; width: 115px; height: auto; display: block; color: white; font-family: 'Nunito Sans', sans-serif; cursor: pointer; } ul li:hover{ text-decoration: underline} ul.close{ display: none; transform: translateX(-1000px) animation: close 350ms linear forwards; } ul.open{ animation: open 350ms linear forwards; } @keyframes open{ 0%{ display: flex; opacity: 0; transform: translateX(0) } 100%{ opacity: 1; transform: translateX(0) } } @keyframes close{ 0%{ display: flex; opacity: 1; } 100%{ disp.........完整代码请登录后点击上方下载按钮下载查看
网友评论0