canvas爱心表白线条循环动画效果代码

代码语言:html

所属分类:表白

代码描述:canvas爱心表白线条循环动画效果代码

代码标签: canvas 爱心 表白 线条 循环 动画

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

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

<head>
    <meta charset="UTF-8">
<style>
    canvas {  display: block;  margin: 0 auto;}
</style>
</head>

<body>
<canvas></canvas>

    <script >
        let canvas = document.querySelector('canvas'),
	width = 300,
	height = 300,
	ctx = canvas.getContext('2d'),
	pSystemSize = 30,
	deform = {a:4, s:0.4, min:-200, max:200, dir:1},
	repaint = 'rgba(255,255,255,.1)';

const mcos = Math.cos,
	  msin = Math.sin,
	  mpow = Math.pow,
	  mrandom = Math.random,
	  PI180=Math.PI / 180,
	  tau = Math.PI * 2;

canvas.width = width;
canvas.height = height;
ctx.lineWidth = 1;

const ParticleSystem = function(num){
	this.colour = '#f00';
	this.numParticles = num;
	this.allParticles = [];
	this.x = width * .5;
	this.y = height * .5;
	this.gen.........完整代码请登录后点击上方下载按钮下载查看

网友评论0