Skip to content

Commit

Permalink
Revert "[O] Use two methods to calculate cup size (#919)"
Browse files Browse the repository at this point in the history
This reverts commit 3610684.
  • Loading branch information
Cryolitia committed Oct 28, 2023
1 parent 4af8eb9 commit d331876
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 99 deletions.
58 changes: 9 additions & 49 deletions content/zh-cn/cup-calculator.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ description: "罩杯计算器"
border-image-outset: 0px;
}
</style>
*由于按照国际通用罩杯计算方法修改了计算法,所以计算结果与原来相比可能偏小,不必担心。*

**运算都在您的本地完成,不收集任何数据**

Expand All @@ -39,25 +40,12 @@ description: "罩杯计算器"

数字 n 代表罩杯 (A=1、B=2、C=3依此类推)。例如,胸围和下胸围差为15 cm (n=2)表示B罩杯。

中国尺码计算方法:

- 下胸围 + 11cm + n × 2cm = 胸围

- 罩杯 n = (胸围 - 下胸围 - 5) / 2.5

数字 n 代表罩杯 (A=1、B=2、C=3依此类推)。例如,胸围和下胸围差为10 cm (n=2)表示B罩杯。

<button onclick="cup()" type="submit">提交</button>

<p id="result">国际通用罩杯: </p>
<p id="resultcn">中国尺码: </p>
<p id="result"></p>

<script type="text/javascript">
function cup() {
//Initial
window.document.getElementById("result").innerHTML = "国际通用罩杯: ";
window.document.getElementById("resultcn").innerHTML = "国内罩杯: ";
//Calculate
var val1 = Number(window.document.getElementById("val1").value) || NaN;
var val2 = Number(window.document.getElementById("val2").value) || NaN;
var val3 = Number(window.document.getElementById("val3").value) || NaN;
Expand All @@ -66,15 +54,13 @@ description: "罩杯计算器"
var under = (val1 + val2 )/2;
var upper = (val3 + val4 + val5)/3;
var cup = ( upper - under - 11 ) / 2;
var cupcn = upper - under;
var valid = true;
//Judgement

if (isNaN(cup)) {
window.document.getElementById("result").innerHTML = "数值错误,再检查检查吧";
valid = false;
return;
} else if (cup<=0){
window.document.getElementById("result").innerHTML += "小妹妹你还不需要穿内衣哦";
valid = false;
window.document.getElementById("result").innerHTML = "小妹妹你还不需要穿内衣哦";
return;
} else if (cup<1){
cup = "AA,买少女小背心去吧";
} else if (cup<=2){
Expand All @@ -88,42 +74,16 @@ description: "罩杯计算器"
} else if (cup<6){
cup = "E";
}else{
window.document.getElementById("result").innerHTML += "你胸大你说了算(罩杯超出 MtF.wiki 预设)";
valid = false;
}
if (isNaN(cupcn)) {
window.document.getElementById("resultcn").innerHTML = "数值错误,再检查检查吧";
valid = false;
} else if (cupcn <= 5) {
window.document.getElementById("resultcn").innerHTML += "小妹妹你还不需要穿内衣哦";
valid = false;
} else if (cupcn <= 7.5) {
cupcn = "AA,买少女小背心去吧";
} else if (cupcn <= 10) {
cupcn = "A";
} else if (cupcn <= 12.5) {
cupcn = "B";
} else if (cupcn <= 15) {
cupcn = "C";
} else if (cupcn <= 17.5) {
cupcn = "D";
} else if (cupcn <= 20) {
cupcn = "E";
} else {
window.document.getElementById("resultcn").innerHTML += "你胸大你说了算(罩杯超出 MtF.wiki 预设)";
valid = false;
}
if (!valid)
window.document.getElementById("result").innerHTML = "你胸大你说了算(罩杯超出 MtF.wiki 预设)";
return;
}
if (isNaN(under)) {
window.document.getElementById("result").innerHTML = "数值错误,再检查检查吧";
window.document.getElementById("resultcn").innerHTML = "数值错误,再检查检查吧";
return;
} else{
under = Math.ceil(under/5)*5;
}
window.document.getElementById("result").innerHTML += under + cup;
window.document.getElementById("resultcn").innerHTML += under + cupcn;
window.document.getElementById("result").innerHTML = under + cup;
return;
}
</script>
59 changes: 9 additions & 50 deletions content/zh-hant/cup-calculator.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,12 @@ description: "胸圍計算"

數字 n 代表罩杯 (A=1、B=2、C=3依此類推)。例如,胸圍和下胸圍差為15 cm (n=2)表示B罩杯。

中國尺碼計算方法:

- 下胸圍 + 11cm + n × 2cm = 胸圍

- 罩杯 n = (胸圍 - 下胸圍 - 5) / 2.5

數字 n 代表罩杯 (A=1、B=2、C=3依此類推)。例如,胸圍和下胸圍差為10 cm (n=2)表示B罩杯。

<button onclick="cup()" type="submit">計算</button>

<p id="result">國際通用罩杯: </p>
<p id="resultcn">中國尺碼: </p>
<p id="result"></p>

<script type="text/javascript">
function cup() {
//Initial
window.document.getElementById("result").innerHTML = "國際通用罩杯: ";
window.document.getElementById("resultcn").innerHTML = "國內罩杯: ";
//Calculate
var val1 = Number(window.document.getElementById("val1").value) || NaN;
var val2 = Number(window.document.getElementById("val2").value) || NaN;
var val3 = Number(window.document.getElementById("val3").value) || NaN;
Expand All @@ -67,18 +54,16 @@ description: "胸圍計算"
var under = (val1 + val2 )/2;
var upper = (val3 + val4 + val5)/3;
var cup = ( upper - under - 11 ) / 2;
var cupcn = upper - under;
var valid = true;
//Judgement

if (isNaN(cup)) {
window.document.getElementById("result").innerHTML = "輸入有誤,再檢查一下吧";
valid = false;
return;
} else if (cup<=0){
window.document.getElementById("result").innerHTML += "小妹妹妳還不需要穿內衣唷";
valid = false;
window.document.getElementById("result").innerHTML = "小妹妹妳還不需要穿內衣唷";
return;
} else if (cup<1){
cup = "AA,購買少女內衣";
} else if (cup<=2){
} else if (cup<2){
cup = "A";
} else if (cup<3){
cup = "B";
Expand All @@ -89,42 +74,16 @@ description: "胸圍計算"
} else if (cup<6){
cup = "E";
}else{
window.document.getElementById("result").innerHTML += "妳胸大妳說了算(罩杯超出 MtF.wiki 預設)";
valid = false;
}
if (isNaN(cupcn)) {
window.document.getElementById("resultcn").innerHTML = "輸入有誤,再檢查一下吧";
valid = false;
} else if (cupcn <= 5) {
window.document.getElementById("resultcn").innerHTML += "小妹妹妳還不需要穿內衣唷";
valid = false;
} else if (cupcn <= 7.5) {
cupcn = "AA,买少女小背心去吧";
} else if (cupcn <= 10) {
cupcn = "A";
} else if (cupcn <= 12.5) {
cupcn = "B";
} else if (cupcn <= 15) {
cupcn = "C";
} else if (cupcn <= 17.5) {
cupcn = "D";
} else if (cupcn <= 20) {
cupcn = "E";
} else {
window.document.getElementById("resultcn").innerHTML += "妳胸大妳說了算(罩杯超出 MtF.wiki 預設)";
valid = false;
}
if (!valid)
window.document.getElementById("result").innerHTML = "妳胸大妳說了算(罩杯超出 MtF.wiki 預設)";
return;
}
if (isNaN(under)) {
window.document.getElementById("result").innerHTML = "輸入有誤,再檢查一下吧";
window.document.getElementById("resultcn").innerHTML = "輸入有誤, 再檢查一下吧";
return;
} else{
under = Math.ceil(under/5)*5;
}
window.document.getElementById("result").innerHTML += under + cup;
window.document.getElementById("resultcn").innerHTML += under + cupcn;
window.document.getElementById("result").innerHTML = under + cup;
return;
}
</script>

0 comments on commit d331876

Please sign in to comment.