纯css雪人下雪特效

代码语言:html

所属分类:布局界面

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

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
body {
  overflow: hidden;
}
.snowFall {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 11;
  display: flex;
  justify-content: center;
  -webkit-transform: scale(2) rotate(12deg);
          transform: scale(2) rotate(12deg);
}
.snowFall div {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  margin: 3vh;
  height: 8vh;
  width: 8vh;
  top: -30vh;
  border-radius: 50%;
  background-color: white;
  --scaleVar: 0.5;
  --delayVar: 0;
  -webkit-animation: fallAnim 3000ms linear infinite;
          animation: fallAnim 3000ms linear infinite;
}
.delayMe div {
  -webkit-animation-delay: 1200ms;
          animation-delay: 1200ms;
}
.snowFall div:nth-of-type(2n) {
  -webkit-animation-delay: -200ms;
          animation-delay: -200ms;
  -webkit-animation-duration: 3200ms;
          animation-duration: 3200ms;
  --scaleVar: 0.3;
}
.snowFall div:nth-of-type(3n) {
  -webkit-animation-delay: -300ms;
          animation-delay: -300ms;
  -webkit-animation-duration: 2800ms;
          animation-duration: 2800ms;
  --scaleVar: 0.4;
}
.biggerSnow {
  -webkit-transform: scale(4);
          transform: scale(4);
  -webkit-filter: blur(0.2vh);
          filter: blur(0.2vh);
}
.delayMe div:nth-of-type(2n) {
  -webkit-animation-delay: 1500ms;
          animation-delay: 1500ms;
}
.delayMe div:nth-of-type(3n) {
  -webkit-animation-delay: 900ms;
          animation-delay: 900ms;
}
.snowFall div::after,
.snowFall div::before {
  content: "";
  position: absolute;
  width: 50%;
  height: 50%;
  top: -250%;
  border-radius: 50%;
  background-color: white;
}
.snowFall div::before {
  top: -150%;
  left: -150%;
}
.snowFall div:nth-of-type(2n)::after {
  top: -250%;
}
.snowFall div:nth-of-type(2n)::before {
  left: -350%;
}
.snowFall div:nth-of-type(3n)::after {
  top: -350%;
}
.snowFall div:nth-of-type(3n)::before {
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0