sketch实现爱心圆点表白动画效果代码

代码语言:html

所属分类:表白

代码描述:sketch实现爱心圆点表白动画效果代码

代码标签: sketch 爱心 表白 动画

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

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

<head>
    <meta charset="UTF-8">
    <style>
        * {
	margin:0;
	padding:0;
	-webkit-touch-callout:none;
	-webkit-user-select:none;
	-khtml-user-select:none;
	-moz-user-select:none;
	-ms-user-select:none;
	user-select:none
}
html,body {
	margin:0;
	padding:0;
	width:100%;
	height:100%;
	overflow:hidden;
	background:#ebe9e1;
	background:-webkit-gradient(radial,center center,0px,center center,100%,color-stop(0%,#FFF),color-stop(100%,#ebe9e1));
	background:-webkit-radial-gradient(center,ellipse cover,#FFF 0,#ebe9e1 100%);
	background:-moz-radial-gradient(center,ellipse cover,#FFF 0,#ebe9e1 100%);
	background:-ms-radial-gradient(center,ellipse cover,#FFF 0,#ebe9e1 100%);
	background:-o-radial-gradient(center,ellipse cover,#FFF 0,#ebe9e1 100%);
	background:radial-gradient(ellipse at center,#FFF 0,#ebe9e1 100%)
}
#stats {
	position:absolute;
	z-index:10;
	left:10px;
	top:10px
}
    </style>
</head>

<body>
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/sketch.min.js"></script>
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/Stats-16.js"></script>
    <script>
        var stats, particles = [];
 Math.range = function(b, a) {
     if (!a) {
         a = b;
         b = 0
     }
     return b + Math.random() * (a - b)
 };
 Math.chance = function(a) {
     if (!a) {
         a = 0.5
     }
     return Math.random() < a
 };

 function toRGB(a) {
     var b = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);
     return b ? {
         r: parseInt(b[1], 16),
         g: parseInt(b[2], 16),
         b: parseInt(b[3], 16)
     } : null
 }

 function Particle() {
     this.isActive = (Math.chance(0.5))
 }
 Particle.COLORS = ["#ff0000", "#daede6", &quo.........完整代码请登录后点击上方下载按钮下载查看

网友评论0