├── README.md ├── index.html └── screenshot.png /README.md: -------------------------------------------------------------------------------- 1 | # calorie 2 | 3 | ![screenshot](screenshot.png) 4 | 5 | Calorie deficit tracking web app. 6 | 7 | You burn calories at a certain rate just by living - this is your base metabolic rate. For example for me that's roughly 2000 kcal/day. You can find [calculators](https://www.calculator.net/bmr-calculator.html) online. So, by default, your body will burn e.g. 2000 kcal/day. Then if you eat food you take in calories. And if you exercise you burn calories. If you are in a net deficit, you lose weight. 8 | 9 | On top of that, you have a certain weight loss goal. For example for me that might be 500 kcal/day of deficit, so that every week you burn 7 * 500 = 3500 kcal, which is roughly 1 pound of fat. 10 | 11 | So the idea is to have two counters that simply show your current deficit next to your goal. When you eat, you press +100kcal button until you add all the calories you ate. For example when I eat a Big Mac, I press +100kcal button 5 times. When you exercise, you do the opposite. So if I went to the gym and ran for 30 min, the treadmill is showing me that I burned about 400 kcal, so I press -100kcal button 4 times. 12 | 13 | I leave this little web app always open at the corner of my screen. At any point in time it shows me how much food I am allowed to eat to stay on my deficit goal. Alternatively if I know I am about to eat 1000 kcal, it shows me how many calories I have to go run for in order to not go over my goal. 14 | 15 | Losing weight then becomes as simple as making sure that your number stays green (i.e. your deficit is inline with your goal) and does not turn red. 16 | 17 | That's it! Depending on your base metabolic rate, go into [index.html](index.html) and edit the variable 18 | 19 | ```javascript 20 | const hourlyCalorieBurn = 2000 / 24.0; // burned per hour 21 | ``` 22 | 23 | Change it from 2000 to whatever it is for you. Then decide what your deficit goal per day is, and edit it here: 24 | 25 | ```javascript 26 | const hourlyCalorieTargetDeficit = 500 / 24.0; // burned per hour 27 | ``` 28 | 29 | Simply open up index.html in your browser and you are good to go. 30 | 31 | ### License 32 | 33 | MIT 34 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Calorie Status 7 | 8 | 63 | 64 | 65 | 66 |
67 |

Calorie Status

68 |
69 |

0

70 |

0

71 |
72 | 73 | 74 | 75 |
76 | 77 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karpathy/calorie/c030afbe9f38e7d0464d2a5d8a1871106dae4acd/screenshot.png --------------------------------------------------------------------------------