3 ms·
This is really cool! Can you explain how you factored the velocity and also how the backend works here?
by sarthakjshetty 7y ago
This is really cool! Can you explain how you factored the velocity and also how the backend works here?
- TheDong 7y agoThe velocity is the actual speed you're earning money. The time it takes to earn one dollar at that wage is the time it takes for one dollar to scroll off the screen. $7.25 an hour means you earn a dollar every 8 minutes, so it takes about 8 mintues for one dollar on the top row to disappear off the side. If you look at the code for the site, it's not obfuscated, so you can see all the math: speed={this.perHour(7.25)} .... perHour(amount) { return amount / 60 / 60; } .... let offset = (1/dollarsPerRow * dollarWidth * speed * Date.now()/1000) % dollarWidth; Those are the key bits. Also, there is no backend. It's all written in frontend react. Again, it's not obfuscated, you can poke around easily enough.
- thulecitizen 7y agoSo fun when it’s all our there to learn from. I can’t wait for the web to be an archive of torrented Git-versioned repositories à la Ceptr.org.