gsap实现手机端移动端底部菜单滑动切换效果代码
代码语言:html
所属分类:菜单导航
代码描述:gsap实现手机端移动端底部菜单滑动切换效果代码,结合svg实现圆滑的过渡切换效果。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.min.css"> <style> body { background: #37474f; justify-content: center; align-items: center; margin: 0; overflow: hidden; } #dowebok { min-width: 100%; min-height: 100vh; background-color: #ffcc80; display: flex; margin: 0 auto; justify-content: flex-end; flex-direction: column; overflow: hidden; position: relative; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); } #navbar { width: 100%; height: 60px; background-color: #fff; position: absolute; } #bubbleWrapper { position: absolute; display: flex; justify-content: space-around; width: 100%; bottom: 25px; } .bubble { background-color: #fff; width: 50px; height: 50px; bottom: 85px; border-radius: 50%; z-index: 1; transform: translateY(120%); display: flex; justify-content: center; align-items: center; } .icon { opacity: 0; } #bubble1 { transform: translateY(0%); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); } #bubble1>span { opacity: 0.7; } #bgWrapper { filter: url(#goo); width: 100%; height: 100px; position: absolute; bottom: 60px; } #bg { background-color: #ffcc80; width: 120%; height: 100%; margin-left: -10%; } #bgBubble { position: absolute; background-color: #ffcc80; width: 70px; height: 70px; border-radius: 50%; bottom: -50px; left: 12.5%; transform: translateX(-50%); } #menuWrapper { position: absolute; width: 100%; display: flex; justify-content: space-around; } .menuElement { width: 25%; height: 60px; line-height: 60px; text-align: center; opacity: 0.4; cursor: pointer; } .menuElement:hover { opacity: 0.5; } #contentWrapper { position: absolute; top: 50%; width: 100%; transform: translateY(-50%); display: flex; justify-content: center; align-items: center; } #contentWrapper h2 { color: #fff; font-family: sans-serif; font-weight: 400; } .content { display: none; opacity: 0; } </style> </head> <body> <div id="dowebok"> <div id="navbar"> <div id="bubbleWrapper"> <div id="bubble1" class="bubble"> <span class="icon"><i class="fas fa-home"></i></span> </div> <div id="bubble2" class="bubble"> <span class="icon"><i class="fab fa-twitter"></i></span> </div> <div id="bubble3" class="bubble"> <span class="icon"><i class="fas fa-bell"></i></span> </div> <div id="bubble4" class="bubble"> .........完整代码请登录后点击上方下载按钮下载查看
网友评论0