Skip to content

Commit 48d0dda

Browse files
committed
added shadows
1 parent a73cc0b commit 48d0dda

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

public/js/ui.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ var circlePath = new Path.Circle({
4545
center: [0, 0],
4646
radius: 10,
4747
fillColor: 'white',
48-
strokeColor: 'white'
48+
strokeColor: 'white',
49+
shadowColor: 'cyan',
50+
shadowBlur: 10,
51+
shadowOffset: [(Math.floor(Math.random() * 4) - 2), (Math.floor(Math.random() * 4) - 2)]
4952
});
5053

5154
var symbol = new Symbol(circlePath);
@@ -57,7 +60,8 @@ for (var i = 0; i < count; i++) {
5760
var placedSymbol = symbol.place(center);
5861
// placedSymbol.fillColor.hue += (Math.random() * 8)
5962
placedSymbol.scale(i / count);
60-
placedSymbol.direction = 2 * Math.PI * Math.random()
63+
placedSymbol.direction = 2 * Math.PI * Math.random();
64+
if (i === 50) console.log(placedSymbol);
6165
}
6266

6367
// The onFrame function is called up to 60 times a second:
@@ -67,14 +71,12 @@ function onFrame(event) {
6771
for (var i = 0; i < count; i++) {
6872
var item = project.activeLayer.children[i];
6973

70-
// Move the item 1/20th of its width to the right. This way
74+
// Move the item 1/20th of its width in the direction of its motion. This way
7175
// larger circles move faster than smaller circles:
7276
var speed = item.bounds.width / 30;
7377
item.position.x += Math.cos(item.direction) * speed;
7478
item.position.y += Math.sin(item.direction) * speed;
7579

76-
//item.position.x += item.bounds.width / 20;
77-
7880
// If the item has left the view on the right, move it back
7981
// to the left:
8082
if (item.bounds.left > view.size.width) {

0 commit comments

Comments
 (0)