js+css模拟手机app左侧抽屉式导航菜单弹出效果代码
代码语言:html
所属分类:菜单导航
代码描述:js+css模拟手机app左侧抽屉式导航菜单弹出效果代码
代码标签: js+css 模拟 手机 app 左侧 抽屉式 导航 菜单 弹出
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.6.4.0.css"> <style> @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500&family=Roboto:wght@300;400;500;700;900&display=swap"); *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; } h1, h2, h3 { font: inherit; } :root { --light-gray-100: hsl(205, 5%, 98%); --light-gray-200: hsl(205, 7%, 90%); --light-gray-300: hsl(205, 12%, 83%); --bg--base: hsl(205, 20%, 93%); --bg-content: hsl(205, 10%, 98%); --text: hsl(205, 7%, 46%); --text-light: hsl(205, 7%, 60%); --blue--accent-1: hsl(203, 80%, 52%); --blue--accent-2: hsl(208, 77%, 43%); --font--base: "Poppins", sans-serif; --font--accent: "Roboto", sans-serif; } body { text-rendering: optimizeSpeed; font: 400 16px/1.3 var(--font--base); } .wrapper { display: grid; place-content: center; min-block-size: 100vh; background-color: var(--bg--base); padding: 1rem; } .layout-container { --width: 23.4375rem; --height: 41.6875rem; inline-size: var(--width); block-size: var(--height); background-color: var(--bg-content); contain: strict; position: relative; border-radius: 1.5rem; box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px; } .overlay-sidebar { inset: 0; width: inherit; height: inherit; position: fixed; z-index: 99; transition: background-color 266ms; } .active { background-color: #0004; transition: background-color 266ms ease-in; } nav { display: flex; block-size: var(--height); inline-size: calc(var(--width) * 0.8); } .toggle-button { margin: 1rem; position: absolute; display: inline-grid; padding: 0.25rem; border: 0; cursor: pointer; background-color: #0000; } .menu-icon-svg { fill: #333; width: 2.5ch; as.........完整代码请登录后点击上方下载按钮下载查看
网友评论0