html爱心特效代码

New Document

/*
* RequestAnimationFrame polyfill by Erik Mller
*/
(function(){var b=0;var c=[“ms”,“moz”,“webkit”,“o”];for(var a=0;a

/*
* Point class
*/
var Point = (function() {
function Point(x, y) {
this.x = (typeof x !== ‘undefined’) x : 0;
this.y = (typeof y !== ‘undefined’) y : 0;
}
Point.prototype.clone = function() {
return new Point(this.x, this.y);
};
Point.prototype.length = function(length) {
if (typeof length == ‘undefined’)
return Math.sqrt(this.x * this.x + this.y * this.y);
this.normalize();
this.x *= length;
this.y *= length;
return this;
};
Point.prototype.normalize = function() {
var length = this.length();

你可能感兴趣的:(前端,html,javascript,开发语言,ecmascript)