一个超炫的htm5效果.超炫

时间:2025-04-14 20:39:52
<!DOCTYPE html>
<html xmlns="http:///1999/xhtml" lang="en">
<head>
<title>star</title>
<script type="text/javascript">
 = function () {
	C = ; // cache Math objects
	S = ;
	U = 0;
	w = window;
	j = document;
	d = ("c");
	c = ("2d");
	W =  = ;
	H =  = ;
	(0, 0, W, H); // resize <canvas> and draw black rect (default)
	 = "lighter"; // switch to additive color application
	 = 0.2;
	 = "round";
	var bool = 0, 
		t = 0; // theta
	 = function (e) {
		if() {
			if(D==9) { D=()*15; f(1); }
			clearTimeout(T);
		}
		X = ; // grab mouse pixel coords
		Y = ;
		a=0; // previous 
		b=0; // previous  
		A = X, // original 
		B = Y; // original 
		R=(/W * 999>>0)/999;
		r=(/H * 999>>0)/999;
		U=/H * 360 >>0;
		D=9;
		g = 360 *  / 180;
		T = setInterval(f = function (e) { // start looping spectrum
			();
			 = "source-over"; // switch to additive color application
			if(e!=1) {
				 = "rgba(0,0,0,0.02)";
				(0, 0, W, H); // resize <canvas> and draw black rect (default)
			}
			();
			i = 25; while(i --) {
				();
				if(D > 450 || bool) { // decrease diameter
					if(!bool) { // has hit maximum
						bool = 1;
					}
					if(D < 0.1) { // has hit minimum
						bool = 0;
					}
					t -= g; // decrease theta
					D -= 0.1; // decrease size
				}
				if(!bool) {
					t += g; // increase theta
					D += 0.1; // increase size
				}
				q = (R / r - 1) * t; // create hypotrochoid from current mouse position, and setup variables (see: /wiki/Hypotrochoid)
				x = (R - r) * C(t) + D * C(q) + (A + (X - A) * (i / 25)) + (r - R); // center on xy coords
				y = (R - r) * S(t) - D * S(q) + (B + (Y - B) * (i / 25));
				if (a) { // draw once two points are set
					(a, b);
					(x, y)
				}
				 = "hsla(" + (U % 360) + ",100%,50%,0.75)"; // draw rainbow hypotrochoid
				();
				a = x; // set previous 
				b = y; // set previous 
			}
			U -= 0.5; // increment hue
			A = X; // set original 
			B = Y; // set original 
		}, 16);
	}
	 = function(e) { a=b=0; R += 0.05 }
	({pageX:300, pageY:290})
}

</script>
</head>


<body style="margin:0px;padding:0px;width:100%;height:100%;overflow:hidden;">
<canvas ></canvas>
</body>
</html>