Skip to content

Commit

Permalink
Remove animation
Browse files Browse the repository at this point in the history
  • Loading branch information
zessx committed Feb 8, 2018
1 parent ead54f7 commit e21273d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
6 changes: 5 additions & 1 deletion assets/css/layout/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ main {
z-index: 3;
padding: calc(100vh + 5em) 0 5em;
min-height: 200vh;
font-size: 0.6rem;
font-size: 0.8rem;
text-align: center;
letter-spacing: 0.5em;

Expand Down Expand Up @@ -151,6 +151,10 @@ main {
margin: 1em auto;
padding: 1px 0 0;
}

@include media($from: desktop) {
font-size: 1rem;
}
}

#hint {
Expand Down
33 changes: 19 additions & 14 deletions assets/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,29 @@ function backgroundInit()


view.onFrame = function(event) {
if (event.count % 5 == 0) {
for (var i = 0; i < NB_POINTS; i++) {
points[i].y += points[i].speed;
if (points[i].y >= window.innerHeight) {
points[i].speed -= ACCELERATION;
} else if (points[i].y <= 0) {
points[i].speed += ACCELERATION;
} else {
points[i].speed = Math.max(Math.min(points[i].speed + Math.random() * 2 * ACCELERATION - ACCELERATION, MAX_SPEED), -MAX_SPEED);
}
for (var j = 0; j < NB_PATHS; j++) {
paths[j].segments[i].point.y = points[i].y;
}
}
if (event.count == 0) {
for (var j = 0; j < NB_PATHS; j++) {
paths[j].smooth();
}
}
// if (event.count % 5 == 0) {
// for (var i = 0; i < NB_POINTS; i++) {
// points[i].y += points[i].speed;
// if (points[i].y >= window.innerHeight) {
// points[i].speed -= ACCELERATION;
// } else if (points[i].y <= 0) {
// points[i].speed += ACCELERATION;
// } else {
// points[i].speed = Math.max(Math.min(points[i].speed + Math.random() * 2 * ACCELERATION - ACCELERATION, MAX_SPEED), -MAX_SPEED);
// }
// for (var j = 0; j < NB_PATHS; j++) {
// paths[j].segments[i].point.y = points[i].y;
// }
// }
// for (var j = 0; j < NB_PATHS; j++) {
// paths[j].smooth();
// }
// }
}
}

Expand Down
2 changes: 1 addition & 1 deletion public/app.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/app.js

Large diffs are not rendered by default.

0 comments on commit e21273d

Please sign in to comment.