css实现苹果手机下拉菜单效果代码
代码语言:html
所属分类:菜单导航
代码描述:css实现苹果手机下拉菜单效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> @import url(https://fonts.googleapis.com/css?family=Ek+Mukta:200); body { margin: 0; line-height: 1.4; background: #E1E1E1; } .window { position: relative; display: block; width: 360px; height: 567px; margin: 100px auto 0; box-shadow: 0 0 65px 15px rgba(0, 0, 0, 0.2); overflow: hidden; border-radius: 3px; background: #F1F1F1; } .window .header { position: absolute; display: block; top: 0; left: 0; height: 50px; width: 100%; background: rgba(0, 0, 0, 0.8); overflow: hidden; transition: all 0.5s ease-out, background 1s ease-out; transition-delay: 0.2s; z-index: 1; } .window .header .burger-container { position: relative; display: inline-block; height: 50px; width: 50px; cursor: pointer; transform: rotate(0deg); transition: all 0.3s cubic-bezier(0.4, 0.01, 0.165, 0.99); -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; } .window .header .burger-container #burger { width: 18px; height: 8px; position: relative; display: block; margin: -4px auto 0; top: 50%; } .window .header .burger-container #burger .bar { width: 100%; height: 1px; display: block; position: relative; background: #FFF; transition: all 0.3s cubic-bezier(0.4, 0.01, 0.165, 0.99); transition-delay: 0s; } .window .header .burger-container #burger .bar.topBar { transform: translateY(0px) rotate(0deg); } .window .header .burger-container #burger .bar.btmBar { transform: translateY(6px) rotate(0deg); } .window .header .icon { display: inline-block; position: absolute; height: 100%; line-height: 50px; width: 50px; height: 50px; text-align: center; color: #FFF; font-size: 22px; left: 50%; transform: translateX(-50%); } .window .header .icon.icon-bag { right: 0; top: 0; left: auto; transform: translateX(0px); transition: transform 0.5s cubic-bezier(0.4, 0.01, 0.165, 0.99); transition-delay: 0.65s; } .window .header ul.menu { position: relative; display: block; padding: 0px 48px 0; list-style: none; } .window .header ul.menu li.menu-item { border-bottom: 1px solid #333; margin-top: 5px; transform: scale(1.15) translateY(-30px); opacity: 0; transition: transform 0.5s cubic-bezier(0.4, 0.01, 0.165, 0.99), opacity 0.6s cubic-bezier(0.4, 0.01, 0.165, 0.99); } .window .header ul.menu li.menu-item:nth-child(1) { transition-delay: 0.49s; } .window .header ul.menu li.menu-item:nth-child(2) { transition-delay: 0.42s; } .window .header ul.menu li.menu-item:nth-child(3) { transition-delay: 0.35s; } .window .header ul.menu li.menu-item:nth-child(4) { transition-delay: 0.28s; } .window .header ul.menu li.menu-item:nth-child(5) { transition-delay: 0.21s; } .window .header ul.menu li.menu-item:nth-child(6) { transition-delay: 0.14s; } .window .header ul.menu li.menu-item:nth-child(7) { transition-delay: 0.07s; } .window .header ul.menu li.menu-item a { display: block; position: relative; color: #FFF; font-family: "Ek Mukta", sans-serif; font-weight: 100; text-decoration: none; font-size: 22px; line-height: 2.35; font-weight: 200; width: 100%; } .window .header.menu-opened { height: 100%; background-color: #000; transition: all 0.3s ease-in, background 0.5s ease-in; transition-delay: 0.25s; } .window .header.menu-opened .burger-container { transform: rotate(90deg); } .window .header.menu-opened .burger-container #burger .bar { transition: all 0.4s cubic-bezier(0.4, 0.01, 0.165, 0.99); transition-delay: 0.2s; } .window .header.menu-opened .burger-container #burger .bar.topBar { transform: translateY(4px) rotate(45deg); } .window .header.menu-opened .burger-container #burger .bar.btmBar { transfor.........完整代码请登录后点击上方下载按钮下载查看
网友评论0