-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.html
167 lines (142 loc) · 3.87 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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<!DOCTYPE html>
<html>
<head>
<title>EOS Paper Wallet</title>
<script src="eosjs-ecc.js"></script>
<script src="qr.js"></script>
</head>
<body>
<h1 class="no-print">EOS Paper Wallet</h1>
<div style="outline-style: solid; outline-width: thin;">
<div class="qr">
<h3 style="margin:0; padding-left:10.5px;">Public Key</h3>
<canvas style="padding-left: 10px;" id="publicKeyCanvas"></canvas>
</div>
<div class="logo-container">
<img class="logo-image" src="eos_cafe_calgary.png" alt="EOS Cafe">
</div>
<div class="qr">
<h3 style="margin-top:20px;margin-bottom: 0;padding-left:10.5px;">Private Key </h1>
<canvas style="padding-left: 10px;" id="privateKeyCanvas"></canvas>
</div>
<div class="key-text">
<h3 style="margin-bottom: 0px;">Public Key <span style="color:green">(SHARE)</span></h1>
<div id="publicKey"> </div>
<h3 style="margin-bottom: 0px;">Private Key <span style="color:red">(DON'T SHARE)</span></h1>
<div id="privateKey"></div>
</div>
</div>
<button class="button button_primary no-print" style="margin-top:25px" onclick="initialize();"> Re-Generate </button>
<button class="button button_primary no-print" onclick="window.print();"> Print </button>
<a href="https://github.com/eoscafe/eos-paper-wallet" target="_blank">
<button class="button button_primary no-print"> Full Source Code </button>
</a>
<script>
var ecc = eosjs_ecc
function initialize(){
// Create a new random private key
ecc.randomKey().then(privateWif => {
let publicKey = ecc.privateToPublic(privateWif)
document.getElementById("publicKey").textContent = publicKey;
var qr = new QRious({
element: document.getElementById('publicKeyCanvas'),
value: publicKey,
size: 150
});
document.getElementById("privateKey").textContent = privateWif;
var qr = new QRious({
element: document.getElementById('privateKeyCanvas'),
value: privateWif,
size: 150
});
})
}
initialize()
</script>
<style type="text/css" scoped>
html {
box-sizing: border-box;
}
*,
*:before,
*:after {
box-sizing: border-box;
}
body {
font-size: 1rem;
font-family: "Helvetica Neue", Arial, sans-serif;
line-height: 1.5;
width:700px;
}
.content {
margin: 64px auto;
width: 94%;
max-width: 600px;
text-align: center;
}
.button {
display: inline-block;
margin: 0;
padding: 0.75rem 1rem;
border: 0;
border-radius: 0.317rem;
background-color: #aaa;
color: #fff;
text-decoration: none;
font-weight: 700;
font-size: 1rem;
line-height: 1.5;
font-family: "Helvetica Neue", Arial, sans-serif;
cursor: pointer;
-webkit-appearance: none;
-webkit-font-smoothing: antialiased;
}
.button:hover {
opacity: 0.85;
}
.button:active {
box-shadow: inset 0 3px 4px hsla(0, 0%, 0%, 0.2);
}
.button:focus {
outline: thin dotted #444;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.button_primary {
background-color: #1fa3ec;
}
.button_secondary {
background-color: #e98724;
}
.logo-container {
width:37%;
display:inline-block;
padding-left: 15px;
vertical-align:top;
}
.logo-image {
padding-top: 50px;
margin-left: 10px;
width: 200px;
}
.qr {
width:30%;
display:inline-block;
padding-left: 15px;
}
.key-text {
padding-left: 27px;
display: block;
vertical-align: top;
padding-bottom: 20px;
}
@media print
{
.no-print, .no-print *
{
display: none !important;
}
}
</style>
</body>
</html>