Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
98 lines (96 loc) · 2.76 KB
/
Copy pathindex.html
File metadata and controls
98 lines (96 loc) · 2.76 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>내삽 계산기</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f0f0;
}
table {
border-collapse: collapse;
width: 80%;
max-width: 500px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
td {
padding: 10px 20px;
text-align: center;
}
input {
width: calc(100% - 20px);
padding: 10px;
font-size: 1.2em;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
button {
width: 100%;
padding: 10px;
font-size: 1.2em;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
@media (max-width: 600px) {
table {
width: 100%;
}
td {
padding: 15px;
}
input, button {
padding: 15px;
font-size: 1.5em;
}
}
</style>
</head>
<body>
<table border="1">
<tr>
<th>VALUE</th>
<th>SETTING</th>
</tr>
<tr>
<td><input type="number" id="val1"></td>
<td><input type="number" id="set1"></td>
</tr>
<tr>
<td><input type="number" id="val2"></td>
<td><input type="number" id="set2"></td>
</tr>
<tr>
<td><input type="number" id="val3"></td>
<td id="result" style="background-color: lightgreen;"></td>
</tr>
<tr>
<td colspan="2"><button onclick="calculate()">Calculate</button></td>
</tr>
</table>
<script>
function calculate() {
var val1 = parseFloat(document.getElementById('val1').value);
var set1 = parseFloat(document.getElementById('set1').value);
var val2 = parseFloat(document.getElementById('val2').value);
var set2 = parseFloat(document.getElementById('set2').value);
var val3 = parseFloat(document.getElementById('val3').value);
var result = set1 + ((set2 - set1) * (val3 - val1) / (val2 - val1));
document.getElementById('result').innerText = result.toFixed(2);
}
</script>
</body>
</html>