ionicon+css实现滑动菜单导航条效果代码

代码语言:html

所属分类:菜单导航

代码描述:ionicon+css实现滑动菜单导航条效果代码

代码标签: ionicon css 滑动 菜单 导航条

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

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


<style>
 @import url('https://fonts.googleapis.com/css?family=Poppins:100,200,300,400,500,600,700,800,900');

*
{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}
body
{
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #222327;
}
.navigation
{
  position: relative;
  width: 400px;
  height: 70px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #333;
  border-radius: 10px;
}
.navigation ul
{
  position: relative;
  display: flex;
  width: 350px;
}
.navigation ul li
{
  position: relative;
  list-style: none;
  width: 70px;
  height: 70px;
  z-index: 1;
}
.navigation ul li a
{
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: 100%;
  text-align: center;
  font-weight: 500;
}
.navigation ul li a .icon
{
  position: relative;
  display: block;
  font-size: 1.5em;
  line-height: 75px;
  transition: 0.5s;
  color: rgba(255,255,255,0.5);
}
.navigation ul li.active a .icon
{
  transform: translateY(-8px);
  color: #29fd53;
}
.navigation ul li a .text
{
  position: absolute;
  opacity: 0;
  font-weight: 600;
  font-size: 0.5em;
  color: #222327;
  transition: 0.5s;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transform: translateY(0px);
}
.navigation ul li.active a .text
{
  transform: translateY(13px);
  opacity: 1;
}
.indicator
{
  position: absolute;
  width: 70px;
  height: 70px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: 0.5s;
}
.indicator::before
{
  content: '';
  position: absolute;
  bottom: 13px;
  width: 80%;
  height: 14px;
  background: #29fd53;
  border-radius: 10px;
}
.navigation ul li:nth-child(2).active ~ .indicator
{
  transform: translateX(calc(70px * 1));
}
.navigation ul li:nth-child(3).active ~ .indicator
{
  transform: translateX(calc(70px * 2));
}
.navigation ul li:nth-child(4).active ~ .indicator
{
  transform: translateX(calc(70px * 3));
}
.navigation ul li:nth-child(5).active ~ .indicator
{
  transfor.........完整代码请登录后点击上方下载按钮下载查看

网友评论0