旋转导航菜单效果
代码语言:html
所属分类:菜单导航
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title> - Rotated Nav Animation - #043 of #100Days100Projects</title> <link rel='stylesheet' href='http://repo.bfw.wiki/bfwrepo/css/font-awesome-4.7.0/css/font-awesome.min.css'> <style> @import url('https://fonts.googleapis.com/css?family=Muli&display=swap'); @import url('https://fonts.googleapis.com/css?family=Lato&display=swap'); * { box-sizing: border-box; } body { background-color: #333; color: #222; font-family: 'Lato', sans-serif; margin: 0; } .container { background-color: #fafafa; transform-origin: top left; transition: transform 0.5s linear; padding: 50px; width: 100vw; min-height: 100vh; } .circle-container { position: fixed; top: -100px; left: -100px; } .container.show-nav { transform: rotate(-20deg); } .circle { background-color: #ff7979; border-radius: 50%; position: relative; height: 200px; width: 200px; transition: transform 0.5s linear; } .container.show-nav .circle { transform: rotate(-70deg); } .circle button { background: transparent; border: 0; color: #fff; font-size: 26px; position: absolute; top: 50%; left: 50%; height: 100px; } .circle button:focus { outline: none; } .circle button#open { left: 60%; } .circle button#close { top: 60%; transform: rotate(90deg); transform-origin: top left; } nav { color: #fff; position: fixed; bottom: 40px; left: 0; z-index: 100; } nav ul { list-style-type: none; padding-left: 30px; } nav ul li { margin: 40px 0; text-transform: uppercase; transform: translateX(-100%); transition: transform 0.4s cubic-bezier(.28,.27,.65,1.25); transition-delay: 0s; } .container.show-nav + nav li { transform: translateX(0); transition-delay: 0.3s; } nav ul li i { font-size: 20px; margin-right: 10px; } nav ul li + li { margin-left: 15px; transform: translateX(-150%); } nav ul li + li + li { margin-left: 30px; transform: translateX(-200%); } .content { max-width: 1000px; margin: 50px auto; } .content h1 { margin: 0; } .content small { color: #555; font-style: italic; } .content p { color: #333; line-height: 1.5; } .content img { max-width: 100%; } /* SOCIAL PANEL CSS */ .social-panel-container { position: fixed; right: 0; bottom: 80px; transform: translateX(100%); transition: transform 0.4s ease-in-out; } .social-panel-container.visible { transform: translateX(-10px); } .social-panel { background-color: #fff; border-radius: 16px; box-shadow: 0 16px 31px -17px rgba(0,31,97,0.6); border: 5px solid #001F61; display: flex; flex-direction: column; justify-content: center; align-items: center; font-family: 'Muli'; position: relative; height: 169px; width: 370px; max-width: calc(100% - 10px); } .social-panel button.close-btn { border: 0; color: #97A5CE; cursor: pointer; font-size: 20px; position: absolute; top: 5px; right: 5px; } .social-panel button.close-btn:focus { outline: none; } .social-panel p { background-color: #001F61; border-radius: 0 0 10px 10px; color: #fff; font-size: 14px; line-height: 18px; padding: 2px 17px 6px; position: absolute; top: 0; left: 50%; margin: 0; transform: translateX(-50%); text-align: center; width: 235px; } .social-panel p i { margin: 0 5px; } .social-panel p a { color: #FF7500; text-decoration: none; } .social-panel h4 { margin: 20px 0; color: #97A5CE; font-family: 'Muli'; font-size: 14px; line-height: 18px; text-transform: uppercase; } .social-panel ul { display: flex; list-style-type: none; padding: 0; margin: 0; } .social-panel ul li { margin: 0 10px; } .social-panel ul li a { border: 1px solid #DCE1F2; border-radius: 50%; color: #001F61; font-size: 20px; display: flex; justify-content: center; align-items: center; height: 50px; width: 50px; text-decoration: none; } .social-panel ul li a:hover { border-color: #FF6A00; box-shadow: 0 9px 12px -9px #FF6A00; } .floating-btn { border-radius: 26.5px; background-color: #001F61; border: 1px solid #001F61; box-shadow: 0 16px 22px -17px #03153B; color: #fff; cursor: pointer; font-size: 16px; line-height: 20px; padding: 12px 20px; position: fixed; bottom: 20px; right: 20px; z-index: 999; } .floating-btn:hover { background-color: #ffffff; color: #001F61; } .floating-btn:focus { outline: none; } .floating-text { background-color: #001F61; border-radius: 10px 10px 0 0; color: #fff; font-family: 'Muli'; padding: 7px 15px; position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); text-align: center; z-index: 998; } .floating-text a { color: #FF7500; text-decoration: none; } @media screen and (max-width: 480px) { .social-panel-container.visible { transform: translateX(0px); } .floating-btn { right: 10px; } } </style> </head> <body translate="no"> <div class="container" id.........完整代码请登录后点击上方下载按钮下载查看
网友评论0