全屏导航动画切换效果

代码语言:html

所属分类:菜单导航

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

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

<title>Fullscreen Nav - Vertical -  Variable fonts &amp; linear-gradients</title>

<style>
  @import url("https://fonts.googleapis.com/css2?family=Hepta+Slab:wght@1..900&display=swap");
.nav {
  position: absolute;
  z-index: 998;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  visibility: hidden;
  transition-property: visibility;
}
.nav .navList {
  width: 100%;
  height: 100%;
  display: flex;
  transition: all 1s;
}
.nav .navList a {
  margin: 0.1em;
  display: block;
  text-decoration: none;
  color: #ffffff88;
  letter-spacing: 1px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 25%;
  height: 85vh;
  box-shadow: 10px 10px 20px #000;
  transition: -webkit-transform 0.5s cubic-bezier(0.15, 0.1, 0.25, 1.3);
  transition: transform 0.5s cubic-bezier(0.15, 0.1, 0.25, 1.3);
  transition: transform 0.5s cubic-bezier(0.15, 0.1, 0.25, 1.3), -webkit-transform 0.5s cubic-bezier(0.15, 0.1, 0.25, 1.3);
  background-color: #222;
}
.nav .navList a span {
  -webkit-transform: rotate(-90deg);
          transform: rotate(-90deg);
  position: absolute;
  -webkit-animation: textBG 10s infinite;
          animation: textBG 10s infinite;
  font-size: 5vh;
  font-variation-settings: "wdth" 110, "wght" 800;
  transition: all 0.2s;
  padding: 5px;
  margin: 0 auto;
  display: inline-block;
  background: linear-gradient(-45deg, #8ab9ff 10%, #4567b2 25%, #8ab9ff 40%, #4567b2 55%, #8ab9ff 70%, #4567b2 85%);
  background-size: 400%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-backface-visibility: hidden;
}
.nav .navList a:nth-child(1) span {
  -webkit-animation-delay: 0s;
          animation-delay: 0s;
}
.nav .navList a:nth-child(2) span {
  -webkit-animation-delay: 0.1s;
          animation-delay: 0.1s;
}
.nav .navList a:nth-child(3) span {
  -webkit-animation-delay: 0.2s;
          animation-delay: 0.2s;
}
.nav .navList a:nth-child(4) span {
  -webkit-animation-delay: 0.3s;
          animation-delay: 0.3s;
}
.nav .navList a:nth-child(5) span {
  -webkit-animation-delay: 0.4s;
          animation-delay: 0.4s;
}
.nav .navList a:hover {
  background-color: #252525;
}
.nav .navList a:hover span {
  font-size: 7vh;
}
.nav .navList a:active {
  background-color: #2f2f2f;
}
.nav .navList a:first-child {
  margin-left: 10vh;
}
.nav .navList a:last-child {
  margin-right: 10vh;
}
.nav .navList a:nth-child(1) {
  transition-delay: 0s;
}
.nav .navList a:nth-child(2) {
  transition-delay: 0.1s;
}
.nav .navList a:nth-child(3) {
  transition-delay: 0.2s;
}
.nav .navList a:nth-child(4) {
  transition-delay: 0.3s;
}
.nav .navList a:nth-child(5) {
  transition-delay: 0.4s;
}
.nav .navList a:nth-child(odd) {
  -webkit-transform: translateY(-110%);
          transform: translateY(-110%);
  border-bottom-left-radius: 0em;
  border-top-right-radius: 0em;
}
.nav .navList a:nth-child(even) {
  -webkit-transform: translateY(150%);
          transform: translateY(150%);
  border-top-left-radius: 0em;
  border-bottom-right-radius: 0em;
}
.nav.active {
  visibility: visible;
}
.nav.active .navList a {
  opacity: 1;
}
.nav.active .navList a:nth-child(odd) {
  -webkit-transform: translateY(10%) skewY(15deg);
          transform: translateY(10%) skewY(15deg);
}
.nav.active .navList a:nth-child(even) {
  -webkit-transform: translateY(5%) skewY(-15deg);
          transform: translateY(5%) skewY(-15deg);
}

.nav-toggle {
  position: fixed;
  z-index: 999;
  cursor: pointer;
  top: 2vw;
  right: 2vw;
  width: 70px;
  height: 70px;
  overflow: hidden;
  -webkit-transform: rotate(35deg);
          transform: rotate(35deg);
  transition: all 0.2s;
}
.nav-toggle:hover {
  -webkit-transform: rotate(15deg);
          transform: rotate(15deg);
}
.nav-toggle:hover::after {
  width: 30%;
  -webkit-transform: translate(-104%, 20px) rotate(-120deg);
          transform: translate(-104%, 20px) rotate(-120deg);
}
.nav-toggle:hover::before {
  width: 30%;
  -webkit-transform: translate(-33%, 22px) rotate(140deg);
          transform: translate(-33%, 22px) rotate(140deg);
}
.nav-toggle:before, .nav-toggle:after, .nav-toggle span {
  opacity: 0.8;
  position.........完整代码请登录后点击上方下载按钮下载查看

网友评论0