pixi实现按钮萤火虫粒子飞舞动画效果代码

代码语言:html

所属分类:粒子

代码描述:pixi实现按钮萤火虫粒子飞舞动画效果代码

代码标签: pixi 按钮 萤火虫 粒子 飞舞 动画

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

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

<style>
    @import url('https://fonts.googleapis.com/css?family=Indie+Flower');

* {
  box-sizing: border-box;
  cursor: default;
  outline: none;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: #171623;
  overflow: hidden;
}

canvas {
  display: block;
}

#background {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.table {
  display: table;
  width: 100%;
  height: 100%;
}

.cell {
  display: table-cell;
  vertical-align: middle;
  text-align: center;
  padding-top: 10px;
  cursor: pointer;
}

.excitement {
  transition: all 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: auto;
  width: 300px;
  height: 120px;
  border-radius: 10px;
  box-shadow: 0 5px 10px 5px rgba(0,0,0,0.2);
  background: #333333;
  overflow: hidden;
  cursor: pointer;
  z-index: 1000;
}

.excitement:hover {
  transform: scale(1.08);
}

.excitement:active {
  transform: scale(1);
}

.excitement::before {
  position: absolute;
  width: 250px;
  height: 180px;
  content: "";
  display: block;
  top: 0;
  margin-left: 138px;
  transform-style: flat;
  transform: skew(20deg);
  background: -moz-linear-gradient(top, hsla(0,0%,100%,0.1) 0%, hsla(0,0%,100%,0) 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,hsla(0,0%,100%,0.2)), color-stop(100%,hsla(0,0%,100%,0)));
  background: -webkit-linear-gradient(top, hsla(0,0%,100%,0.1) 0%,hsla(0,0%,100%,0) 100%);
  background: -o-linear-gradient(top, hsla(0,0%,100%,0.1) 0%,hsla(0,0%,100%,0) 100%);
  background: -ms-linear-gradient(top, hsla(0,0%,100%,0.1) 0%,hsla(0,0%,100%,0) 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#42ffffff', endColorstr='#00ffffff',GradientType=0 );
  background: linear-gradient(to bottom, hsla(0,0%,100%,0.1) 0%,hsla(0,0%,100%,0) 100%);
}

.excitement h1 {
  user-select: none;
  font-family: 'Indie Flower', cursive;
  text-shadow: 0 2px 2px black;
  color: #ffd800;
  font-size: 50px;
  letter-spacing: 3px;
  cursor: pointer;
}
</style>
</head>
<body>
<!-- partial:index.partial.html -->
<div id="background"></div>

<div class="excitement">
  <div class="table">
    <div class="cell">
      <h1>Fireflies!!!</h1>
    </div>
  </div>
</div>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery.2.11.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/pixi.4.4.3.js"></sc.........完整代码请登录后点击上方下载按钮下载查看

网友评论0