TweenMax实现按钮跟随动画特效

代码语言:html

所属分类:菜单导航

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

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
html, body {
  height: 100%;
  font-family: 'Lato', sans-serif;
}

.item {
  width: 50%;
  height: 75%;
  display: flex;
  justify-content: center;
  align-items: center;
  float: left;
  position: relative;
}
.item:before {
  font-weight: bold;
  font-size: 35px;
  position: absolute;
  right: 25px;
  top: 15px;
  color: #333;
}

.item-1 {
  background: #F0F0F0;
}
.item-1:before {
  content: '#1';
}
.item-1 .wrap {
  background: #fff;
  border-radius: 20px;
  padding: 30px 37px;
  display: inline-block;
  position: relative;
  box-shadow: 0px 20px 61px -14px rgba(0, 0, 0, 0.2);
}
.item-1 .align {
  display: inline-block;
  margin-right: 35px;
  cursor: pointer;
}
.item-1 .align span {
  background: #E1E1E1;
  display: block;
  margin-bottom: 6px;
  width: 27px;
  height: 4px;
  border-radius: 10px;
}
.item-1 .align span:last-child {
  margin-bottom: 0;
}
.item-1 .align__left span:last-child {
  width: 12px;
  float: left;
}
.item-1 .align__center span:last-child {
  width: 13px;
  position: relative;
  left: 50%;
  -webkit-transform: translateX(-50%);
          transform: translateX(-50%);
}
.item-1 .align__right span:last-child {
  width: 13px;
  float: right;
}
.item-1 .align__justify {
  margin-right: 0;
}
.item-1 .align-bar {
  position: absolute;
  top: 30px;
  left: 0;
  width: 100%;
  opacity: 0;
  margin-right: 0;
  pointer-events: none;
}
.item-1 .align-bar span {
  background: #383838;
}

.item-2 {
  background: #D7DDE9;
}
.item-2:before {
  content: '#2';
}
.item-2 .wrap {
  background: #fff;
  border-radius: 20px;
  padding: 22px 37.........完整代码请登录后点击上方下载按钮下载查看

网友评论0