Commit b9208b7e by doszhang

dos

parent e34f8a72
......@@ -90,6 +90,11 @@ function pixelValue(value)
{
return value + 'px';
}
function remValue(value)
{
return value / 20 + 'rem';
}
/*
Returns a duration value for the falling animation.
*/
......@@ -109,9 +114,9 @@ function createALeaf()
var image = document.createElement('img');
/* Randomly choose a leaf image and assign it to the newly created element */
image.src = window.base_resource_url + '/image2/snow-' + randomInteger(1, 3) + '.png';
leafDiv.style.top = "-100px";
leafDiv.style.top = "-5rem";
/* Position the leaf at a random location along the screen */
leafDiv.style.left = pixelValue(randomInteger(0, 500));
leafDiv.style.left = remValue(randomInteger(0, 500));
/* Randomly choose a spin animation */
var spinAnimationName = (Math.random() < 0.5) ? 'clockwiseSpin' : 'counterclockwiseSpinAndFlip';
/* Set the -webkit-animation-name property with these values */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment