-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.html
76 lines (69 loc) · 1.72 KB
/
main.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hash160 Demo</title>
<style>
body {
background: linear-gradient(135deg, #9d50bb, #6e48aa);
background-attachment: fixed;
color: #fff;
font-family: 'Arial', sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
}
.container {
background-color: rgba(106, 57, 171, 0.8);
padding: 30px;
border-radius: 15px;
text-align: center;
width: 400px;
}
h1 {
color: #fff;
font-size: 32px;
}
label,
p {
font-size: 18px;
margin-bottom: 15px;
margin-top: 15px;
}
input {
width: 80%;
padding: 12px;
font-size: 18px;
border: none;
border-radius: 5px;
margin-top: 10px;
}
p {
color: #ffa07a;
font-weight: bold;
}
</style>
</head>
<body>
<div class="container">
<h1>Hash160 Calculator</h1>
<label for="dataInput">Enter data:</label>
<input type="text" id="dataInput" oninput="calculateHash()" />
<p id="output"></p>
</div>
<script type="module">
import hash160 from './index.js'
window.calculateHash = async () => {
const data = document.getElementById('dataInput').value
const hashResult = await hash160(data)
document.getElementById(
'output'
).innerText = `Hash160 of "${data}" is: ${hashResult}`
}
</script>
</body>
</html>