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;
animation-delay: 436ms;
}
.star-top:nth-child(21) {
top: calc(50% - -109px);
left: calc(80% - 228px);
-webkit-animation-delay: 920ms;
animation-delay: 920ms;
}
.star-top:nth-child(22) {
top: calc(50% - 13px);
left: calc(80% - 283px);
-webkit-animation-delay: 1331ms;
animation-delay: 1331ms;
}
.star-top:nth-child(23) {
top: calc(50% - -95px);
left: calc(80% - 18px);
-webkit-animation-delay: 3240ms;
animation-delay: 3240ms;
}
.star-top:nth-child(24) {
top: calc(50% - -4px);
left: calc(80% - 27px);
-webkit-animation-delay: 3664ms;
animation-delay: 3664ms;
}
.star-top:nth-child(25) {
top: calc(50% - 124px);
left: calc(80% - 70px);
-webkit-animation-delay: 4853ms;
animation-delay: 4853ms;
}
.star-top:nth-child(26) {
top: calc(50% - 190px);
left: calc(80% - 246px);
-webkit-animation-delay: 4660ms;
animation-delay: 4660ms;
}
.star-top:nth-child(27) {
top: calc(50% - -65px);
left: calc(80% - 80px);
-webkit-animation-delay: 4686ms;
animation-delay: 4686ms;
}
.star-top:nth-child(28) {
top: calc(50% - -110px);
left: calc(80% - 189px);
-webkit-animation-delay: 776ms;
animation-delay: 776ms;
}
.star-top:nth-child(29) {
top: calc(50% - 152px);
left: calc(80% - 165px);
-webkit-animation-delay: 405ms;
animation-delay: 405ms;
}
.star-top:nth-child(30) {
top: calc(50% - -137px);
left: calc(80% - 159px);
-webkit-animation-delay: 1841ms;
animation-delay: 1841ms;
}
.star-bottom {
position: absolute;
left: 0px;
width: 1px;
height: 20px;
opacity: 0;
border-radius: 50%;
background: #5729ff;
box-shadow: 0 0 2px 1px purple;
animation: stars 1.25s linear infinite reverse;
}
.star-bottom:nth-child(1) {
top: calc(20% - -42px);
left: calc(80% - 219px);
-webkit-animation-delay: 3383ms;
animation-delay: 3383ms;
}
.star-bottom:nth-child(2) {
top: calc(20% - -182px);
left: calc(80% - 261px);
-webkit-animation-delay: 4439ms;
animation-delay: 4439ms;
}
.star-bottom:nth-child(3) {
top: calc(20% - 113px);
left: calc(80% - 140px);
-webkit-animation-delay: 3266ms;
animation-delay: 3266ms;
}
.star-bottom:nth-child(4) {
top: calc(20% - -25px);
left: calc(80% - 2px);
-webkit-animation-delay: 3766ms;
animation-delay: 3766ms;
}
.star-bottom:nth-child(5) {
top: calc(20% - 124px);
left: calc(80% - 150px);
-webkit-animation-delay: 517ms;
animation-delay: 517ms;
}
.star-bottom:nth-child(6) {
top: calc(20% - -189px);
left: calc(80% - 204px);
-webkit-animation-delay: 3156ms;
animation-delay: 3156ms;
}
.star-bottom:nth-child(7) {
top: calc(20% - -178px);
left: calc(80% - 82px);
-webkit-animation-delay: 9ms;
animation-delay: 9ms;
}
.star-bottom:nth-child(8) {
top: calc(20% - 80px);
left: calc(80% - 145px);
-webkit-animation-delay: 1513ms;
animation-delay: 1513ms;
}
.star-bottom:nth-child(9) {
top: calc(20% - -23px);
left: calc(80% - 35px);
-webkit-animation-delay: 4733ms;
animation-delay: 4733ms;
}
.star-bottom:nth-child(10) {
top: calc(20% - -172px);
left: calc(80% - 107px);
-webkit-animation-delay: 2072ms;
animation-delay: 2072ms;
}
.star-bottom:nth-child(11) {
top: calc(20% - 150px);
left: calc(80% - 107px);
-webkit-animation-delay: 2607ms;
animation-delay: 2607ms;
}
.star-bottom:nth-child(12) {
top: calc(20% - 13px);
left: calc(80% - 187px);
-webkit-animation-delay: 1278ms;
animation-delay: 1278ms;
}
.star-bottom:nth-child(13) {
top: calc(20% - 104px);
left: calc(80% - 124px);
-webkit-animation-delay: 3387ms;
anim.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0