手机翻转导航效果
代码语言:html
所属分类:菜单导航
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> @import url("https://fonts.googleapis.com/css?family=Abril+Fatface|Roboto:400,500&display=swap"); html { box-sizing: border-box; } *, *:before, *:after { box-sizing: inherit; } body, html { height: 100%; min-height: 100%; } body { background: #e0e2ef; font-size: 16px; display: flex; justify-content: center; align-items: center; font-family: "Roboto", sans-serif; line-height: 1.45; } h1 { font-family: "Abril Fatface", cursive; font-size: 5rem; } h2 { font-size: 1rem; } .phone { background: black; border-radius: 40px; border: 10px solid #21262b; box-shadow: 0 0 20px rgba(0, 0, 0, 0.4); height: 600px; overflow: hidden; -webkit-perspective: 600px; perspective: 600px; position: relative; width: 310px; } .phone::before { background: #21262b; content: ""; height: 20px; left: 50%; position: absolute; -webkit-transform: translateX(-50%); transform: translateX(-50%); width: 50%; z-index: 2; border-radius: 0 0 15px 15px; } .phone .container { width: 100%; height: 100%; position: relative; transition: -webkit-transform 0.75s cubic-bezier(0.23, 1, 0.32, 1); transition: transform 0.75s cubic-bezier(0.23, 1, 0.32, 1); transition: transform 0.75s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 0.75s cubic-bezier(0.23, 1, 0.32, 1); -webkit-transform-style: preserve-3d; transform-style: preserve-3d; } .phone .container.--is-flipped { -webkit-transform: rotateY(180deg); transform: rotateY(180deg); } .phone .container.--is-flipped .menu button { -webkit-transform: scale(1); transform: scale(1); } .phone .container.--is-flipped nav, .phone .container.--is-flipped h1 { opacity: 1; -webkit-animation: animationFrames linear 1s; animation: animationFrames linear 1s; -webkit-animation-iteration-count: 1; animation-iteration-count: 1; -webkit-transform-origin: 50% 50%; transform-origin: 50% 50%; } @-webkit-keyframes animationFrames { 0% { opacity: 0; } 100% { opacity: 1; } } @keyframes animationFrames { 0% { opacity: 0; } 100% { opacity: 1; } } .phone .content, .phone .menu { position: absolute; height: 100%; width: 100%; -webkit-backface-visibility: hidden; backface-visibility: hidden; padding: 2em; display: flex; flex-direction: column; } .phone .content button, .phone .menu button { position: absolute; bottom: 2em; outline: none; right: 2em; border-radius: 100%; width: 5em; -webkit-backface-visibility: hidden; backface-visibility: hidden; height: 5em; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); display: flex; align-items: center; justify-content:.........完整代码请登录后点击上方下载按钮下载查看
网友评论0