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-left: auto;
margin-right: auto;
}
.ui-tics {
position: absolute;
left: 0;
right: 0;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
display: flex;
align-items: center;
justify-content: center;
user-select: none;
}
.ui-tics .tic {
background: rgba(89, 178, 158, 0.3);
width: 1px;
height: 10px;
position: relative;
display: inline-block;
margin: 0 3px;
white-space: nowrap;
}
.ui-tics .tic:before {
content: "";
width: inherit;
height: 2px;
left: 0;
background: #00ffc3;
position: absolute;
}
.ui-inner-border {
position: absolute;
width: 40vw;
border-right: 3px solid #59b29e;
border-left: 3px solid #59b29e;
will-change: transform;
}
.ui-inner-border.t {
border-top: 3px solid #59b29e;
height: 9px;
}
.ui-inner-border.b {
border-bottom: 3px solid #59b29e;
height: 9px;
}
.ui-box {
position: relative;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
}
.ui-box .ui-fx {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
border: 1px solid rgba(89, 178, 158, 0.3);
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
display: flex;
align-items: center;
}
.ui-box .ui-fx .ui-corner {
width: 1vw;
height: 1vw;
position: absolute;
}
.ui-box .ui-fx .ui-corner:nth-of-type(1) {
top: -4px;
left: -4px;
border-left: 1px solid #f63b4c;
border-top: 1px solid #f63b4c;
}
.ui-box .ui-fx .ui-corner:nth-of-type(2) {
top: -4px;
right: -4px;
border-right: 1px solid #f63b4c;
border-top: 1px solid #f63b4c;
}
.ui-box .ui-fx .ui-corner:nth-of-type(3) {
bottom: -4px;
right: -4px;
border-bottom: 1px solid #f63b4c;
border-right: 1px solid #f63b4c;
}
.ui-box .ui-fx .ui-corner:nth-of-type(4) {
bottom: -4px;
left: -4px;
border-bottom: 1px solid #f63b4c;
border-left: 1px solid #f63b4c;
}
.ui-box .ui-inner-border {
position: absolute;
height: 80%;
width: 9px;
border-top: 3px solid #59b29e;
border-bottom: 3px solid #59b29e;
}
.ui-box .ui-inner-border.l {
left: 3vw;
border-left: 3px solid #59b29e;
border-right: none;
}
.ui-box .ui-inner-border.r {
right: 3vw;
border-right: 3px solid #59b29e;
border-left: none;
}
.ui-box .ui-batts {
position: absolute;
white-space: nowrap;
display: flex;
align-items: center;
justify-content: center;
}
.ui-box .ui-batts .batt {
background: #59b29e;
}
.ui-box .ui-batts.l, .ui-box .ui-batts.r {
flex-direction: column;
}
.ui-box .ui-batts.l .batt, .ui-box .ui-batts.r .batt {
display: block;
width: 12px;
height: 3px;
margin: 70px 0;
}
.ui-box .ui-batts.l {
left: -6px;
}
.ui-box .ui-batts.r {
right: -6px;
}
.ui-box .ui-batts.t, .ui-box .ui-batts.b {
left: 50%;
transform: translate(-50%, 0);
}
.ui-box .ui-batts.t .batt, .ui-box .ui-batts.b .batt {
width: 3px;
height: 12px;
margin: 0 70px;
display: inline-block;
}
.ui.........完整代码请登录后点击上方下载按钮下载查看
网友评论0