From d63d9fdb673a2d951d9b47067bbcc6437b2cbfc6 Mon Sep 17 00:00:00 2001 From: qrhlhplhp <80515002+qrhlhplhp@users.noreply.github.com> Date: Wed, 26 Oct 2022 17:22:44 +0900 Subject: [PATCH] add APMC --- APMC/index.html | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ APMC/main.js | 27 +++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 APMC/index.html create mode 100644 APMC/main.js diff --git a/APMC/index.html b/APMC/index.html new file mode 100644 index 0000000..5b9a3e6 --- /dev/null +++ b/APMC/index.html @@ -0,0 +1,49 @@ + + +
+ + + +apple | ++ | +
---|---|
population | ++ | +
APM | ++ | +
APM≦0 | grinding poverty |
---|---|
0<APM≦1 | normal poverty |
1<APM≦10 | honorable poverty |
10<APM≦100 | little rich |
100<APM≦1000 | normal rich |
1000<APM | extreme rich |
Apple Per Man Calculator, The APMC was developed by Qrhlhphp in order to show you the nature of poverty.
+21st century is filled with lots of poverty. It made us injure each other, and the wars caused have made our poverty furthermore terrible.
+You have thoughts that it is a very difficult to solve the issue of poverty, which are all wrong. It is not so much complex thing as a obvious thing.
+It is natural that you should distrust my words. But first try the APMC. You will find the nature of poverty immediately.
+ + + \ No newline at end of file diff --git a/APMC/main.js b/APMC/main.js new file mode 100644 index 0000000..720250b --- /dev/null +++ b/APMC/main.js @@ -0,0 +1,27 @@ +let calcul = document.getElementById("calcul"); +let goki = document.getElementById("goki"); +let buri = document.getElementById("buri"); +let apu = document.getElementById("apu"); +let popu = document.getElementById("popu"); +let apm = document.getElementById("apm"); + +apu.innerText = 10; +popu.innerText = 3; +apm.innerText = 10 / 3; + +calcul.addEventListener('click', calculate); + +window.document.onkeydown = function(event){ + if (event.key === 'Enter') { + calculate(); + } +} + +function calculate(){ + apu.innerText = goki.value == "" ? 0 : goki.value; + popu.innerText = buri.value == "" ? 0 : buri.value; + if(buri.value == 0) + apm.innerText = "you"; + else + apm.innerText = goki.value / buri.value; +} \ No newline at end of file