css实现夜色星空动画效果代码

代码语言:html

所属分类:动画

代码描述:css实现夜色星空动画效果代码

代码标签: 星空 动画 效果

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


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

<head>

  <meta charset="UTF-8">
  

  
  
  
<style>
* {
    margin: 0;
    padding: 0;
}


body {
    font-family: sans-serif;
    height: 100vh;
    width: 100vw;
}

.nature-tree-container {
    overflow: hidden;
    margin: 100px auto;
    position: relative;
    width: 600px;
    height: 600px;
    background: linear-gradient(#1b246a 0, #584bb5 30%, #584bb5 31%, #b878a0 100%);
}

.moon {
    background: linear-gradient(#fcfaff, #ede4f5);
    height: 100px;
    width: 100px;
    border-radius: 50%;
    position: absolute;
    left: 30%;
    box-shadow: 10px 10px 10px #877dd0,
    -10px 10px 10px #877dd0,
    10px -10px 10px #877dd0,
    -10px -10px 10px #877dd0,
    5px 5px 5px #9585d0,
    -5px 5px 5px #9585d0,
    5px -5px 5px #9585d0,
    -5px -5px 5px #9585d0;

    
}

.left-mountain {
    width: 100%;
    height: 60%;
    background: linear-gradient(90deg, #6b3a82, #533281);
    border-radius: 50%;
    position: absolute;
    bottom: -38%;
    left: -23%;
    z-index: 3;

}
.right-mountain {
    width: 100%;
    height: 60%;
    background: linear-gradient(90deg, #744090, #4b2f73);
    border-radius: 50%;
    position: absolute;
    bottom: -38%;
    right: -23%;
    z-index: 4;
}

.tree {
    position: absolute;
    background: linear-gradient(#8f4cad, #3a194c);
    width: 90px;
    height: 90px;
    border-radius: 50%;
    -webkit-box-reflect: below 50px -webkit-gradient(linear, right top, right bottom, from(transparent), to(rgba(255, 255, 255, 0.4)));
}

.tree::after {
    content: "";
    background: #2f123d;
    height: 50%;
    width: 15%;
    position: absolute;
    bottom: -48%;
    left: 50%;
    transform: translate(-50%, 0);
    clip-path: polygon(20% 0, 80% 0, 100% 100%, 0% 100%);
}

.tree-3 {
    right: -50%;
    bottom: 100%;
    animation: animate-tree-3 1s forwards;
    -webkit-animation-delay.........完整代码请登录后点击上方下载按钮下载查看

网友评论0