vue+three+gsap实现一个炫酷的科幻风格屏幕动画效果代码

代码语言:html

所属分类:动画

代码描述:vue+three+gsap实现一个炫酷的科幻风格屏幕动画效果代码

代码标签: vue three gsap 炫酷 科幻 风格 屏幕 动画

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

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

<head>
  <meta charset="UTF-8">
  
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/reset.min.css">
  
  
<style>
@font-face {
  font-family: "TTSquaresCondensed-Thin";
  src: url("//repo.bfw.wiki/bfwrepo/font/TTSquaresCondensed-Thin.eot");
  src: url("//repo.bfw.wiki/bfwrepo/font/TTSquaresCondensed-Thin.eot?#iefix") format("embedded-opentype"), url("//repo.bfw.wiki/bfwrepo/font/TTSquaresCondensed-Thin.woff2") format("woff2"), url("//repo.bfw.wiki/bfwrepo/font/TTSquaresCondensed-Thin.woff") format("woff"), url("//repo.bfw.wiki/bfwrepo/font/TTSquaresCondensed-Thin.ttf") format("truetype");
}
html {
  overflow: hidden;
}

body {
  font: 1em "TTSquaresCondensed-Thin";
  background: #0f0026;
  color: #afe3d7;
  overflow: hidden;
  opacity: 0;
}

h1 {
  font: normal 6.875em/1.25 "TTSquaresCondensed-Thin";
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

#header {
  padding: 0;
  height: 100vh;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  perspective: 300px;
}
#header .wrap {
  display: flex;
  justify-content: center;
  transform-style: preserve-3d;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
#header h1 {
  font-size: 8vw;
  line-height: 1;
}
#header h1 .word2,
#header h1 em {
  font-style: normal;
  color: #00ffc3;
  text-shadow: 0 0 10px #00ffc3;
}
#header .ui-mini-text {
  grid-row: 3/4;
  grid-column: 3/4;
  justify-self: flex-start;
  align-self: center;
  position: relative;
  left: -10%;
}
#header .ui-tics {
  position: absolute;
}
#header .ui-tics.t {
  bottom: 15vh;
}
#header .ui-tics.b {
  top: 15vh;
  transform: scaleY(-1);
}
#header .ui-inner-border.t {
  top: 7vh;
}
#header .ui-inner-border.b {
  bottom: 7vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#header button {
  cursor: pointer;
  margin: auto;
  background: #0f0026;
  border: 1px solid #00ffc3;
  padding: 0;
  width: 48px;
  height: 48px;
  outline: none;
  transition: all 1s ease-in-out;
  transform: scale(1);
  color: #afe3d7;
  border-radius: 100%;
  position: absolute;
}
#header button .border {
  width: inherit;
  height: inherit;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border: 1px solid #00ffc3;
  box-shadow: 0 0 10px #00ffc3;
  -webkit-animation: 2.3s zoomFade cubic-bezier(0.21, 0.61, 0.35, 1) infinite;
          animation: 2.3s zoomFade cubic-bezier(0.21, 0.61, 0.35, 1) infinite;
  border-radius: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
#header button svg {
  display: block;
  width: 16px;
  height: 16px;
  margin: auto;
  -o-object-fit: contain;
     object-fit: contain;
  fill: #f63b4c;
  position: relative;
  left: -1px;
  transition: all 0.3s linear;
}

#header button:hover {
  transform: scale(1.25);
  border-color: #afe3d7;
  transition: all 0.3s ease-out;
}
#header button:hover .border {
  border: 1px solid #00ffc3;
}

@-webkit-keyframes zoomFade {
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

@keyframes zoomFade {
  100% {
    transform: scale(2);
    opacity: 0;
  }
}
.ui-grid {
  position: relative;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  display: grid;
  pointer-events: none;
  grid-template-columns: 15% 70% 15%;
  grid-template-rows: 25% 50% 25%;
}

.ui-grid .ui-box {
  grid-row: 2/3;
  grid-column: 2/3;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.title {
  position: relative;
}
.title .line:first-of-type > .word:first-of-type > .char:first-of-type::before {
  content: "";
  position: absolute;
  top: -1vh;
  left: -1vw;
  width: 0.75vw;
  height: 0.75vw;
  border-left: 2px solid #f63b4c;
  border-top: 2px solid #f63b4c;
  -webkit-animation: 0.1s blink linear infinite 0.2s;
          animation: 0.1s blink linear infinite 0.2s;
}
.title .line:last-of-type > .word:last-of-type > .char:last-of-type::after {
  content: "";
  position: absolute;
  bottom: -1vh;
  right: -2vw;
  width: 1.5vw;
  height: 1.5vw;
  border-top: 2px solid #f63b4c;
  border-radius: 2px 0 0 0;
  -webkit-animation: 0.1s blink linear infinite 0.2s;
          animation: 0.1s blink linear infinite 0.2s;
}

section {
  padding: 10vh 0;
}
section .col-wide {
  width: 65%;
  margin-left: auto;
  margin-right: auto;
}
section .col-narrow {
  width: 50%;
  margin-.........完整代码请登录后点击上方下载按钮下载查看

网友评论0