<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jSnow</title>
<!--
Options:
http://localhost/_myhome/tools/jSnow/opt.php?bg=202020&num=50&size=30&speed=2&flake=*,@,$&cl=100&ch=255
-->
<?php
	if ($_GET['bg'] <> '') {
		$background = '#'.$_GET['bg'];
	} else {
		$background = '#000000';
	}
	if ($_GET['flakes'] <> '') {
		$flakes = $_GET['flakes'];
	} else {
		$flakes = 30;
	}
	if ($_GET['num'] <> '') {
		$num = $_GET['num'];
	} else {
		$num = 30;
	}
	if ($_GET['fnum'] <> '') {
		$fnum = $_GET['fnum'];
	} else {
		$fnum = 5;
	}
	if ($_GET['size'] <> '') {
		$flakeMaxSize = $_GET['size'];
	} else {
		$flakeMaxSize = 20;
	}
	if ($_GET['speed'] <> '') {
		$fallingSpeedMax = $_GET['speed'];
	} else {
		$fallingSpeedMax = 3;
	}
	if ($_GET['flake'] <> '') {
		$flake_str = $_GET['flake'];
	} else {
		$flake_str = '*,&hearts;,♪,★';
	}
	if ($_GET['cl'] <> '') {
		$cl = floor($_GET['cl']);
	} else {
		$cl = 0;
	}
	if ($_GET['ch'] <> '') {
		$ch = floor($_GET['ch']);
	} else {
		$ch = 255;
	}
	$flake_ary = explode(',', $flake_str);
	foreach ($flake_ary as $flake) {
		if ($flakeCode <> '') $flakeCode .= ',';
		$flakeCode .= '"'.$flake.'"';
	}
	for ($ix=0; $ix<$fnum; $ix++) {
		if ($flakeColor <> '') $flakeColor .= ',';
		$flakeColor .= '"rgb('.mt_rand($cl, $ch).','.mt_rand($cl, $ch).','.mt_rand($cl, $ch).')"';
	}
?>
<script type="text/javascript" src="../../scripts/jquery.js"></script>
<script type="text/javascript" src="jsnow.js"></script>
<style type="text/css">
html,body {background:<?= $background ?>;position:relative;padding:0;margin:0;}
</style>
<script type="text/javascript">
$(function() {
	$().jSnow({
	flakes:<?= $flakes ?>,
	flakeMaxSize:<?= $flakeMaxSize ?>,
	flakeMinSize:10,
	fallingSpeedMax:<?= $fallingSpeedMax ?>,
	fallingSpeedMin:1,
	flakeCode:[<?= $flakeCode ?>],
	flakeColor:[<?= $flakeColor ?>]});
});
</script>
</head>
<body>
<div id="body">
</div>
</body>
</html>
