Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
140 lines (132 loc) · 4.33 KB
/
Copy pathindex.html
File metadata and controls
140 lines (132 loc) · 4.33 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>
<html lang="en-US" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>USD Rate Calculator</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #eef2f3;
margin: 0;
padding: 20px;
}
.container {
background: white;
padding: 20px;
padding-bottom: 0px;
border-radius: 12px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
width: 100%;
max-width: 400px;
text-align: center;
box-sizing: border-box;
}
h2 {
color: #333;
margin-bottom: 10px;
}
p {
font-size: 14px;
color: #666;
margin-bottom: 20px;
}
.input-group {
text-align: left;
margin-bottom: 15px;
}
label {
font-size: 14px;
font-weight: bold;
color: #444;
display: block;
margin-bottom: 5px;
}
input {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 16px;
box-sizing: border-box;
outline: none;
transition: border 0.3s ease-in-out;
}
input:focus {
border-color: #007bff;
box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}
.result {
margin-top: 15px;
font-size: 18px;
font-weight: bold;
color: #2c3e50;
background: #f8f9fa;
padding: 10px;
border-radius: 5px;
}
.footer {
margin-top: 20px;
font-size: 12px;
color: #555;
}
.footer a {
color: #007bff;
text-decoration: none;
font-weight: bold;
}
@media (max-width: 480px) {
.container {
padding: 15px;
}
input {
font-size: 14px;
padding: 8px;
}
h2 {
font-size: 20px;
}
}
</style>
</head>
<body>
<div class="container">
<h2>USD Rate Calculator</h2>
<p>Calculate how much you should receive today if your payment was billed at a previous exchange rate.</p>
<div class="input-group">
<label for="firstRate">USD Rate on First Date:</label>
<input type="number" id="firstRate" placeholder="Enter first USD rate" oninput="calculateAmount()">
</div>
<div class="input-group">
<label for="todayRate">USD Rate Today:</label>
<input type="number" id="todayRate" placeholder="Enter today's USD rate" oninput="calculateAmount()">
</div>
<div class="input-group">
<label for="billedAmount">Billed Amount in First Date:</label>
<input type="number" id="billedAmount" placeholder="Enter billed amount" oninput="calculateAmount()">
</div>
<div class="result" id="result">You should receive: --</div>
<div class="footer">
<p>View the project on <a href="https://github.com/BaseMax/MyMoneyInUSD" target="_blank">GitHub</a></p>
<p>© 2025, Max Base</p>
</div>
</div>
<script>
function calculateAmount() {
let firstRate = parseFloat(document.getElementById('firstRate').value);
let todayRate = parseFloat(document.getElementById('todayRate').value);
let billedAmount = parseFloat(document.getElementById('billedAmount').value);
if (isNaN(firstRate) || isNaN(todayRate) || isNaN(billedAmount)) {
document.getElementById('result').innerText = "Please enter valid numbers";
return;
}
let adjustedAmount = (billedAmount * todayRate) / firstRate;
document.getElementById('result').innerText = `You should receive: ${adjustedAmount.toFixed(2)} today.`;
}
</script>
</body>
</html>