All this to avoid doing one subtraction (km before, km now) then multiplication (result times average litter/km) in your head.
That's a LOT of effort to be lazy.
Nothing a notebook and a pencil can't fix, of course, but an app is more fun.
I don't think it's laziness, I think it's an excuse to do a personal hobby project. Makes perfect sense to me.
Of course, and I do things like that too. I didn't mean to be critical only to give back some perspective precisely when it's NOT about learning.
echo <input id=kmbefore><input id=kmafter onleave='alert( (kmafter.value - kmbefore.value) * priceperlitterperkm )'>
> index.html to make it available to anyone, Worldwide, for free!
For the fancy version I'd make priceperlitterperkm URL parameter to make it work not just for my area. But that's like an entire additional like of code.
My point being... I'd make a Web page, on app, no deployment, no tracking.
ssh homeserver 'echo hi >> /var/www/self-published/index.html' and voila. I'll probably share my gist this way from the CLI.
ssh homeserver "echo '$(ls)' >> /var/www/self-published/index.html" if I want to run a command locally first, not on homeserver (notice the " vs ').
echo <input id=kmbefore><input id=kmafter onleave='alert( (kmafter.value - kmbefore.value) * priceperlitterperkm )'>
> index.html to make it available to anyone, Worldwide, for free!
You are conveniently leaving out that you already must have:* a server running 24/7 on the internet, paid for each month
* purchased, setup and keep paying every year a domain name
* configured a web server in that server, ideally with automated SSL certificate issue and renewal
- a place with electricity
- an Internet connection
- a computer, no matter how small (it can literally be a-cig)
which isn't true for literally every one but clearly for OP was.
You don't need a server in the cloud though, like I said a home server is enough.
Also, alerts are terrible UX. At least put some effort into your example.
I do believe though that being able to do a subtraction and a multiplication, even if both roughly approximated, for an adult in our current societies (as in not living like an hermit in the woods) is a very useful skill, even if just not get scammed while going shopping or to know how many items one can buy.
Again this isn't reciting the first 100 digits or Pi or doing (12345-12158) * 0.3223 in your head in .1s, rather it's about (~12300-12100) * .3 and knowing you should put about ~20 bucks in, not 1 buck nor 100, and if you want to be "safe" or "kind" to others you put 30 bucks, a very safe upper bound and be done with it.
OK maybe the 1st time you have to write it down. Maybe you even put your phone out and use the calculator but it should after a couple of times become pretty straightforward.
edit: if you don't have dyscalculia I think it's worth couple of seconds in your life because the ability does improve with practice and it's helpful in plenty of places.