New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step branch #1

Merged
merged 261 commits into from Jul 21, 2016
Commits
Jump to file or symbol
Failed to load files and symbols.
+7 −9
Diff settings

Always

Just for now

Viewing a subset of changes. View all

inline more numbers. change 10\'s to 9\'s. move Z initializer to loop…

… to init it to 0 now it wont be init to 600 anymore
  • Loading branch information...
pvdz committed Feb 22, 2016
commit c69a70bd20ca6b36f115a1bc98ef1b09540a9d04
Copy path View file
@@ -227,14 +227,12 @@ <h1>
c.textAlign = 'center';
c.textBaseline = 'middle';
swapRate = 150; // 150*fps at rAF (so usually about 150*30=4500ms)
Z=atomloop = 600; // turn rate of atom arches. 600 seems sweet spot.
qfoxTextRelativeHeight = 10;
fitty = M2/qfoxTextRelativeHeight; // circle of atom
fitty = M2/9; // circle of atom
pixels = [];
for (i = K*K; --i;) pixels.push({
// init in centre
for (i = K*K; Z=--i;) pixels.push({
// pixel values are initialized to a number, the actual number isnt super relevant so we use that to save one byte per other var initializers
x: atomvx = 5, // atomvx = speed of atom
y: atomvy = 3, // atomvy = speed of atom
@@ -251,7 +249,7 @@ <h1>
});
(function R() {
if (Z++ % swapRate < 1) {
if (Z++ % 150 < 1) {
// this changes the current symbol
sn = FLOOR(RANDOM() * elements.length);
@@ -265,7 +263,7 @@ <h1>
c[fillStyle] = colors[0];
// could init `i` to 1 instead of 0 here (we wouldnt notice the diff)
c[fillText](s[1] == ' ' ? s[0] : s[0] == '_' ? 'Uu' + s[1] : s, M2, M2, M);
c.font = M/qfoxTextRelativeHeight + pxserif;
c.font = M/9 + pxserif;
c[fillStyle] = colors[1];
c[fillText](qfoxnl, M2, M * F);
qw = c.measureText(qfoxnl)[width]/2;
@@ -297,7 +295,7 @@ <h1>
for (i = 0; p = pixels[i++];) {
q = p.q;
k = (u = p.u) % 3;
targetx = u ? atomx + COS(b=u%atomloop) * fitty * (k==1?2:k*tp||tp) : q ? p.X + stw : p.X ;
targetx = u ? atomx + COS(b=u%600) * fitty * (k==1?2:k*tp||tp) : q ? p.X + stw : p.X ;
targety = u ? atomy + SIN(b) * fitty * (k*tp||2) : q ? p.Y + sth : p.Y;
// update speed, add a little random to keep it jittery
ProTip! Use n and p to navigate between commits in a pull request.