gsap+svg实现动态水滴填充tabbar导航条效果代码

代码语言:html

所属分类:菜单导航

代码描述:gsap+svg实现动态水滴填充tabbar导航条效果代码

代码标签: 水滴 填充 tabbar 导航 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">


  
  
<style>
#tabbar {
  --c-color: #763FEE;
  --c-background: #FFFFFF;
  --indicator-x: 34px;
  --indicator-circle-o: 1;
  --indicator-circle-y: 0px;
  -webkit-tap-highlight-color: transparent;
  border-radius: 31px;
  overflow: hidden;
  position: relative;
  background: var(--c-background);
}
#tabbar .indicator {
  position: absolute;
  z-index: 1;
  left: 0;
  bottom: 0;
  display: block;
  width: 68px;
  height: 72px;
  fill: var(--c-color);
  transform: translateX(var(--indicator-x));
}
#tabbar .indicator path {
  transform: translateY(2px);
}
#tabbar .indicator circle {
  opacity: var(--indicator-circle-o);
  transform: translateY(var(--indicator-circle-y)) translateZ(0);
}
#tabbar ul {
  padding: 0;
  margin: 0;
  list-style: none;
  width: 375px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
}
#tabbar ul li {
  --icon-y: 0px;
  --icon-s: 1;
  --icon-circle: 0px;
}
#tabbar ul li:not(:first-child) {
  margin-left: 26px;
}
#tabbar ul li:not(:last-child) {
  margin-right: 26px;
}
#tabbar ul li.active {
  --icon-circle: 28px;
}
#tabbar ul li button {
  display: block;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  outline: none;
  background: none;
  border: none;
  position: relative;
  -webkit-appearance: none;
  transform: translateY(var(--icon-y)) scale(var(--icon-s)) translateZ(0);
}
#tabbar ul li button:before {
  content: "";.........完整代码请登录后点击上方下载按钮下载查看

网友评论0