css实现时空穿梭动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现时空穿梭动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
* {
padding: 0px;
margin: 0px;
box-sizing: border-box;
}
body {
display: -webkit-box;
display: flex;
-webkit-box-pack: center;
justify-content: center;
-webkit-box-align: center;
align-items: center;
height: 100vh;
width: 100vw;
background: #390946;
background: radial-gradient(circle, #390946 0%, #38125b 8%, #14001d 36%, black 100%);
overflow: hidden;
}
.container {
position: fixed;
top: 50%;
left: 50%;
border-radius: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
/*rotation can be added for additional affect
animation: rotation 15s linear infinite;*/
}
.wrapper {
position: fixed;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
width: 500px;
height: 500px;
-webkit-perspective: 25px;
perspective: 25px;
}
.hole {
position: relative;
width: 500px;
height: 500px;
border-radius: 50%;
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transform: translateZ(-150px);
transform: translateZ(-150px);
background: transparent;
}
.space-bottom {
position: absolute;
width: 500px;
height: 500px;
border-top-left-radius: 50%;
border-top-right-radius: 50%;
background: transparent;
z-index: 2;
-webkit-transform: rotateX(-80deg) translateZ(250px);
transform: rotateX(-80deg) translateZ(250px);
}
.space-top {
position: absolute;
width: 500px;
height: 500px;
background: transparent;
border-bottom-left-radius: 50%;
border-bottom-right-radius: 50%;
-webkit-transform: rotateX(80deg) translateZ(250px);
transform: rotateX(80deg) translateZ(250px);
}
.space-left {
position: absolute;
width: 500px;
height: 500px;
border: solid 0px;
border-radius: 50%;
-webkit-transform: rotateY(-80deg) translateZ(250px);
transform: rotateY(-80deg) translateZ(250px);
}
.space-right {
position: absolute;
width: 500px;
height: 500px;
border: solid 0px;
border-radius: 50%;
-webkit-transform: rotateY(80deg) translateZ(250px);
transform: rotateY(80deg) translateZ(250px);
}
.star-top {
position: absolute;
left: 0px;
width: 1px;
height: 20px;
opacity: 0;
border-radius: 50%;
background: #5729ff;
box-shadow: 0 0 2px 1px purple;
-webkit-animation: stars 1.25s linear infinite;
animation: stars 1.25s linear infinite;
}
.star-top:nth-child(1) {
top: calc(50% - -74px);
left: calc(80% - 269px);
-webkit-animation-delay: 1567ms;
animation-delay: 1567ms;
}
.star-top:nth-child(2) {
top: calc(50% - 159px);
left: calc(80% - 71px);
-webkit-animation-delay: 785ms;
animation-delay: 785ms;
}
.star-top:nth-child(3) {
top: calc(50% - 36px);
left: calc(80% - 261px);
-webkit-animation-delay: 1066ms;
animation-delay: 1066ms;
}
.star-top:nth-child(4) {
top: calc(50% - 26px);
left: calc(80% - 228px);
-webkit-animation-delay: 2066ms;
animation-delay: 2066ms;
}
.star-top:nth-child(5) {
top: calc(50% - -36px);
left: calc(80% - 67px);
-webkit-animation-delay: 4435ms;
animation-delay: 4435ms;
}
.star-top:nth-child(6) {
top: calc(50% - -154px);
left: calc(80% - 7px);
-webkit-animation-delay: 2636ms;
animation-delay: 2636ms;
}
.star-top:nth-child(7) {
top: calc(50% - 134px);
left: calc(80% - 197px);
-webkit-animation-delay: 334ms;
animation-delay: 334ms;
}
.star-top:nth-child(8) {
top: calc(50% - 38px);
left: calc(80% - 33px);
-webkit-animation-delay: 2764ms;
animation-delay: 2764ms;
}
.star-top:nth-child(9) {
top: calc(50% - -15px);
left: calc(80% - 60px);
-webkit-animation-delay: 4395ms;
animation-delay: 4395ms;
}
.star-top:nth-child(10) {
top: calc(50% - -62px);
left: calc(80% - 135px);
-webkit-animation-delay: 3587ms;
animation-delay: 3587ms;
}
.star-top:nth-child(11) {
top: calc(50% - -10px);
left: calc(80% - 201px);
-webkit-animation-delay: 2691ms;
animation-delay: 2691ms;
}
.star-top:nth-child(12) {
top: calc(50% - -156px);
left: calc(80% - 144px);
-webkit-animation-delay: 3475ms;
animation-delay: 3475ms;
}
.star-top:nth-child(13) {
top: calc(50% - 126px);
left: calc(80% - 44px);
-webkit-animation-delay: 4482ms;
animation-delay: 4482ms;
}
.star-top:nth-child(14) {
top: calc(50% - 98px);
left: calc(80% - 117px);
-webkit-animation-delay: 753ms;
animation-delay: 753ms;
}
.star-top:nth-child(15) {
top: calc(50% - -5px);
left: calc(80% - 3px);
-webkit-animation-delay: 3158ms;
animation-delay: 3158ms;
}
.star-top:nth-child(16) {
top: calc(50% - 184px);
left: calc(80% - 182px);
-webkit-animation-delay: 1222ms;
animation-delay: 1222ms;
}
.star-top:nth-child(17) {
top: calc(50% - 138px);
left: calc(80% - 137px);
-webkit-animation-delay: 1820ms;
animation-delay: 1820ms;
}
.star-top:nth-child(18) {
top: calc(50% - -7px);
left: calc(80% - 66px);
-webkit-animation-delay: 4875ms;
animation-delay: 4875ms;
}
.star-top:nth-child(19) {
top: calc(50% - 164px);
left: calc(80% - 258px);
-webkit-animation-delay: 2702ms;
animation-delay: 2702ms;
}
.star-top:nth-child(20) {
top: calc(50% - 132px);
left: calc(80% - 180px);
-webkit-animation-delay: 436ms;
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0