Sparticles实现雪花飞舞动画效果

代码语言:html

所属分类:粒子

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

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

<title> - Obligatory Falling Snow ... but with Sparticles.js</title>

<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Mountains+of+Christmas:400,700|Heebo:100,300,400,500,700,800,900'>
<style>
  * {
  box-sizing: border-box;
}

body, html {
  color: white;
  background: #1e2021;
  padding: 0;
  margin: 0;
  font-family: "Heebo", sans-serif;
  height: 100%;
  width: 100%;
  background-image: linear-gradient(rgba(30, 32, 33, 0.2), rgba(30, 32, 33, 0.8)), url("http://repo.bfw.wiki/bfwrepo/image/5df0355083a46.png");
  background-size: cover;
  background-position: bottom center;
}

main {
  width: 100%;
  height: 100%;
  position: relative;
  padding-top: 30px;
  z-index: 1;
}

.stats {
  position: absolute;
  left: 10px;
  top: 0;
}

#app canvas {
  z-index: -1;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}

h1, p {
  text-align: center;
  margin: 0 auto;
  max-width: 400px;
}

h1 {
  font-size: 50px;
  font-weight: 100;
  font-family: "Mountains of Christmas", cursive;
  margin: 0 auto .........完整代码请登录后点击上方下载按钮下载查看

网友评论0