tinycolor实现彩色方块闪现canvas动画效果代码

代码语言:html

所属分类:动画

代码描述:tinycolor实现彩色方块闪现canvas动画效果代码

代码标签: 方块 闪现 canvas 动画 效果

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

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>

<style>
html { overflow-x: hidden; overflow-y: auto; }
body {
  background: #333;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
</head>
<body>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/tinycolor.min.js"></script>

<canvas id="cnv"></canvas>

<script type="text/javascript">
(function() {
  var App, Pixr, Random, Utils, Vec, log, rnd, twopi, utl;

  Vec = (function() {
    var degrees2radian, radian2degrees;

    class Vec {
      constructor(x, y) {
        this.x = x || 0;
        this.y = y || 0;
        if (!(this instanceof Vec)) {
          new this(x, y);
        }
      }

      add(v) {
        this.x += v.x;
        this.y += v.y;
        return this;
      }

      sub(v) {
        this.x -= v.x;
        this.y -= v.y;
        return this;
      }

      mul(v) {
        this.x *= v.x;
        this.y *= v.y;
        return this;
      }

      div(v) {
        this.x /= v.x;
        .........完整代码请登录后点击上方下载按钮下载查看

网友评论0