Skip to content

Commit 3d6f9ee

Browse files
committed
merge conflict resolution
1 parent 5f2806e commit 3d6f9ee

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

js/secrets.js

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,29 @@ function setup() {
2424
var cols = Math.floor(width / size);
2525
var radius = Math.floor(Math.max(width, height) / Math.max(rows - 1, cols - 1)) / 2;
2626

27+
if(isMobile && !isOtherMediaQuery) {
28+
radius = Math.floor(height / (rows + 2));
29+
}
30+
31+
makeGrid(rows, cols);
32+
shapes = makeFlowers(radius);
33+
addSvgsToCells(size, padding);
34+
offsetEvenRows(size + padding);
35+
}
36+
37+
function addSvgsToCells(size, padding) {
38+
$(".cell").each(function (index, object) {
39+
var two = new Two({
40+
width: size + padding,
41+
height:size + padding
42+
}).appendTo(object);
2743
var shape = pickFlower(shapes);
28-
shape.translation.set(hi * two.width, vi * two.height);
29-
flowers.push(shape);
44+
shape.translation.set(two.width / 2, two.height / 2);
3045
two.add(shape);
31-
}
46+
two.update();
47+
});
3248
}
33-
two.update();
3449

35-
for (var f in flowers) {
36-
var flower = flowers[f];
37-
console.log(flower.id);
38-
$(flower._renderer.elem)
39-
.click(function(e) {
40-
flower.fill = "blue";
41-
})
4250
function offsetEvenRows(size) {
4351
$(".row").each(function (index, object) {
4452
if (index % 2) {

0 commit comments

Comments
 (0)