-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
96 lines (85 loc) · 2.73 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>margin calculator</title>
</head>
<body>
<section>
<!-- Rounded switch -->
<label class="switch">
<input
type="checkbox"
id="nightModeCheckbox"
onclick="checkNightMode()"
/>
<span class="slider round"></span>
</label>
<br />
<label
for="totalLabel"
title="the total amount of money deposited in your account"
>total: </label
><br />
<input type="text" id="totalId" name="totalName" /><br /><br />
<label
for="specifiedMoneyLabel"
title="the amount of money you want to specify to this position"
>specified Money: </label
><br />
<input
type="text"
id="specifiedMoneyId"
name="specifiedMoneyName"
/><br /><br />
<label for="riskLabel" title="risk(percentage)">risk: </label><br />
<input type="text" id="riskId" name="riskName" /><br /><br />
<label for="rewardLabel" title="reward(percentage)">reward: </label><br />
<input type="text" id="rewardId" name="rewardName" /><br /><br />
<label for="leverageLabel" title="position's leverage">leverage: </label
><br />
<input type="text" id="leverageId" name="leverageName" /><br /><br />
<label
for="fractionLabel"
title="the fraction of your total money that you're willing to risk
(example:7 would risk 1/7 of your total money)"
>fraction: </label
><br />
<input
type="text"
id="fractionId"
name="fractionName"
value="7"
/><br /><br />
<button style="color: black" type="button" onclick="calculate()">
calculate!</button
><br />
<hr />
<p style="display: inline">your margin must be less than</p>
<p id="lessThanId"></p>
<p style="display: inline">
in worst case scenario , yout loss is gonna be
</p>
<p id="worstId"></p>
<p style="display: inline">
in best case scenario , your reward is gonna be about
</p>
<p id="bestId"></p>
</section>
<script src="script.js"></script>
<script>
function checkNightMode() {
if (document.getElementById("nightModeCheckbox").checked) {
// night mode on
document.body.classList.toggle("body_nightMode");
// document.getElementsByTagName("p").classList.toggle("p_nightMode");
} else {
//night mode is off
document.body.classList.remove("body_nightMode");
}
}
</script>
</body>
</html>