Skip to content

Commit e91aeb1

Browse files
committed
added dynamic row offset and spin animation back
1 parent d6af86d commit e91aeb1

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

css/secrets.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ svg {
1313
}
1414

1515
.cell:hover, .cell:visited, .cell:focus {
16-
/* animation: loaderAnim 5s ease-in-out infinite normal forwards; */
16+
animation: spinFlowers 5s ease-in-out infinite normal forwards;
1717
padding: 0;
1818
margin: 0;
1919
}
2020

2121

22-
/* @keyframes loaderAnim {
22+
@keyframes spinFlowers {
2323
0% {
2424
transform:rotate(0deg);
2525
}
@@ -29,7 +29,7 @@ svg {
2929
100% {
3030
transform:rotate(0deg);
3131
}
32-
} */
32+
}
3333

3434
/* @media only screen and (max-width: 600px) {
3535
.row:nth-child(2n) {

js/2secrets.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function setup() {
2828
makeGrid(rows, cols);
2929
shapes = makeFlowers(radius);
3030
addSvgsToCells(size, padding);
31+
offsetEvenRows(size + padding);
3132
// fixCellPosiiton();
3233
// addOnClickToCells();
3334
}
@@ -80,6 +81,15 @@ function addOnClickToCells() {
8081
});
8182
}
8283

84+
function offsetEvenRows(size) {
85+
$(".row").each(function (index, object) {
86+
if (index % 2) {
87+
$(object).css("position", "relative");
88+
$(object).css("left", size / 2 * -1 + "px");
89+
}
90+
});
91+
}
92+
8393
function makeGrid(rows, cols) {
8494
$('body').empty();
8595
for (var r = 0; r < rows; r++) {

secrets.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
</head>
99
<body>
1010
</body>
11-
<script src="./js/secrets.js"></script>
11+
<script src="./js/2secrets.js"></script>
1212
</html>

0 commit comments

Comments
 (0)