-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
343 lines (332 loc) · 15.2 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<style>
a label { cursor: pointer; }
</style>
</head>
<body>
<nav class="light-blue lighten-1" role="navigation">
<div class="nav-wrapper container"><a id="logo-container" href="#" class="brand-logo">LuckyHub: MVP</a>
<ul class="right hide-on-med-and-down">
<li><a href="#">Navbar Link</a></li>
</ul>
<ul id="nav-mobile" class="sidenav">
<li><a href="#">Navbar Link</a></li>
</ul>
<a href="#" data-target="nav-mobile" class="sidenav-trigger"><i class="material-icons">menu</i></a>
</div>
</nav>
<div class="container" id="loading">
<div class="section no-pad-bot">
<div class="container">
<br><br>
<h4 class="header center orange-text">Loading</h4>
<div class="row center">
<h5 class="header col s12 light">Requirements</h5>
<ul class="collection">
<li class="collection-item">
<i id="loadingCheck1" class="material-icons tiny check red-text">check</i>
<label id="loadingText1" class="red-text">Metamask should be installed</label>
</li>
<li class="collection-item">
<i id="loadingCheck2" class="material-icons tiny check red-text">check</i>
<label id="loadingText2" class="red-text">Metamask accounts should be unlocked</label>
</li>
<li class="collection-item">
<i id="loadingCheck3" class="material-icons tiny check red-text">check</i>
<label id="loadingText3" class="red-text">Ropsten Testnet should be selected</label>
</li>
<li class="collection-item">
<i id="loadingCheck4" class="material-icons tiny check red-text">check</i>
<label id="loadingText4" class="red-text">IPFS Node should be connected <span id="ipfsID"></span></label>
</li>
</ul>
<div class="preloader-wrapper big active">
<div class="spinner-layer spinner-orange">
<div class="circle-clipper left">
<div class="circle"></div>
</div>
<div class="gap-patch">
<div class="circle"></div>
</div>
<div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
</div>
</div>
<br><br>
<br><br>
</div>
</div>
</div>
<div id="loaded" style="display:none">
<div class="section no-pad-bot">
<div class="container">
<br><br>
<h4 class="header center orange-text"><span id="loadedAccount"></span></h4>
<div class="row center">
<ul class="collection">
<li class="collection-item">
<i id="loadedCheck1"
class="material-icons tiny check red-text">check</i>
<label id="loadedText1" class="red-text">Public Key should be stored</label>
<div id="rsaModalTxWaiting" style="display: none">
Waiting for Transaction <span id="rsaModalTxWaitingLink"></span>
</div>
</li>
<li class="collection-item">
<i id="loadedCheck4" class="material-icons tiny check red-text">check</i>
<label id="loadedText4" class="red-text">IPFS Node should be connected <span id="ipfsID2"></span></label>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="section">
<div class="row">
<div class="col s12 m6 center">
<h6><a href="#" onclick="createNewLotteryModal(); return false;">Create Lottery</a></h6>
<h6>already created</h6>
<div id="lotteriesTxWaiting" style="display: none">
Waiting for Transaction <span id="lotteriesTxWaitingLink">12321321341354123213213413541232132134135412321321341354</span>
</div>
<div id="lotteriesLoading" class="preloader-wrapper big active">
<div class="spinner-layer spinner-orange">
<div class="circle-clipper left">
<div class="circle"></div>
</div>
<div class="gap-patch">
<div class="circle"></div>
</div>
<div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
</div>
<div id="lotteriesLoaded">
Loading
</div>
</div>
<div class="col s12 m6 center">
<h6 id="menuStep1">
<a href="#" onclick="buyTicketModal(); return false;">Step 1. Buy Ticket</a>
</h6>
<h6 id="menuStep2" style="display: none">
<a href="#" onclick="gotWinner(); return false;">Step 2. Find a Winner</a>
</h6>
<h6 id="menuStep3" style="display: none">
<a href="#" onclick="createNewMessageModal(); return false;">Step 3. Contact Owner </a>
and <a href="#" onclick="allowEscrow(); return false;">Confirm Prize and Unlock Money to Owner </a>
</h6>
<h6 id="menuStep3_2" style="display: none">
<a href="#" onclick="createNewMessageModal(); return false;">Step 3. Contact Winner (only owner could read / write)</a>
</h6>
<h6 id="menuStep4" style="display: none">
<a href="#" onclick="escrow(); return false;">Step 4. Escrow Money to Owner </a>
</h6>
<h6 id="menuStep5" style="display: none">
<a href="#" onclick="return false;">Lottery is Finished and Destructed </a>
</h6>
<h6>current status</h6>
<div id="ticketsTxWaiting" style="display: none">
Waiting for Transaction <span id="ticketsTxWaitingLink"></span>
</div>
<div id="ticketsLoading" class="preloader-wrapper big active">
<div class="spinner-layer spinner-orange">
<div class="circle-clipper left">
<div class="circle"></div>
</div>
<div class="gap-patch">
<div class="circle"></div>
</div>
<div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
</div>
<div id="ticketsLoaded">
Loading
</div>
</div>
</div>
</div>
<br><br>
</div>
</div>
<footer class="page-footer orange">
<div class="container">
<div class="row">
<div class="col l6 s12">
<h5 class="white-text">LuckyHub</h5>
<p class="grey-text text-lighten-4">Some description will be here,
<a href="https://github.com/travist/jsencrypt" target="_blank" class="white-text pink accent-4">RSA lib used</a>
</p>
</div>
<div class="col l3 s12">
<h5 class="white-text">Info</h5>
<ul>
<li><a class="white-text" target="_blank"
href="https://ropsten.etherscan.io/address/0x43d928330c365056232bdd3bd3f88e5d06f0cfbf">Lotteries
Contract</a></li>
<li><a class="white-text" target="_blank"
href="https://ropsten.etherscan.io/address/0xc4574d249e6b64c235fec4cc3daed0a1e4f569b3">Members
Contract</a></li>
</ul>
</div>
<div class="col l3 s12">
<h5 class="white-text">Connect</h5>
<ul>
<li><a class="white-text" href="https://telegram.me/vadymhr" target="_blank">@VadymHr</a></li>
<li><a class="white-text" href="https://telegram.me/turtus" target="_blank">@Turtus</a></li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
Made by <a class="orange-text text-lighten-3" href="http://blocksoftlab.com">Blocksoft</a>
</div>
</div>
</footer>
<!-- Modal Structure -->
<div id="rsaModal" class="modal">
<div class="modal-content">
<h4>RSA Generation in progress</h4>
<div id="rsaModalLoading" class="preloader-wrapper big active">
<div class="spinner-layer spinner-orange">
<div class="circle-clipper left">
<div class="circle"></div>
</div>
<div class="gap-patch">
<div class="circle"></div>
</div>
<div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
</div>
<div id="rsaModalLoaded">
</div>
</div>
<div class="modal-footer">
<a href="#!" onclick="savePublicPrivate(); return false;" class="waves-effect waves-light btn"><i
class="material-icons left">cloud</i>Send Public Key to the Contract</a>
<a href="#!" class="modal-close waves-effect waves-red btn-flat">Close</a>
</div>
</div>
<div id="newLotteryModal" class="modal">
<div class="modal-content">
<h4>Lottery Creation</h4>
<div class="row">
<div class="input-field col s12">
<input id="newLotteryModalName" type="text" value="Demo Lottery" class="validate">
<label for="newLotteryModalName">Name (visible for all)</label>
</div>
</div>
<div class="row">
<div class="input-field col s6">
<input id="newLotteryModalTickets" type="text" value="10" class="validate">
<label for="newLotteryModalTickets">Tickets Total Number</label>
</div>
<div class="input-field col s6">
<input id="newLotteryModalTicketPrice" type="text" value="0.01" class="validate">
<label for="newLotteryModalTicketPrice">Ticket Price (ETH)</label>
</div>
</div>
</div>
<div class="modal-footer">
<a href="#!" onclick="saveNewLotteryModal(); return false;" class="waves-effect waves-light btn"><i
class="material-icons left">cloud</i>Create Lottery in Contract</a>
<a href="#!" class="modal-close waves-effect waves-red btn-flat">Close</a>
</div>
</div>
<div id="buyTicketModal" class="modal">
<div class="modal-content">
<h4>Buy Ticket</h4>
<div class="row">
<div class="input-field col s12">
<input id="buyTicketModalNumber" type="text" class="validate" value="1">
<label for="buyTicketModalNumber">Number of Tickets to Buy, current price = <span id="buyTicketModalPrice"></span> per Ticket</label>
</div>
</div>
</div>
<div class="modal-footer">
<a href="#!" onclick="saveBuyTicketModal(); return false;" class="waves-effect waves-light btn"><i
class="material-icons left">cloud</i>Buy</a>
<a href="#!" class="modal-close waves-effect waves-red btn-flat">Close</a>
</div>
</div>
<div id="newMessageModal" class="modal">
<div class="modal-content">
<h4>New Message Add</h4>
<div id="newMessageModalTxWaiting" style="display: none">
Waiting for Transaction <span id="newMessageModalTxWaitingLink">12321321341354123213213413541232132134135412321321341354</span>
</div>
<div id="newMessageModalLoading" class="preloader-wrapper big active" style="display: none; position: absolute">
<div class="spinner-layer spinner-orange">
<div class="circle-clipper left">
<div class="circle"></div>
</div>
<div class="gap-patch">
<div class="circle"></div>
</div>
<div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<textarea class="materialize-textarea" id="newMessageModalText"></textarea>
</div>
</div>
<div class="row">
<div id="messagesLoading" class="preloader-wrapper big active">
<div class="spinner-layer spinner-orange">
<div class="circle-clipper left">
<div class="circle"></div>
</div>
<div class="gap-patch">
<div class="circle"></div>
</div>
<div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
</div>
<div id="messagesLoaded">
Loading
</div>
</div>
</div>
<div class="modal-footer">
<a href="#!" onclick="saveNewMessageModal(); return false;" class="waves-effect waves-light btn"><i
class="material-icons left">cloud</i>Encrypt Message and Send to Owner</a>
<a href="#!" class="modal-close waves-effect waves-red btn-flat">Close</a>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script src="https://unpkg.com/ipfs-http-client/dist/index.min.js"></script>
<script src="./js/rsa/jsencrypt.min.js"></script>
<script src="./js/index.js"></script>
<script src="./js/htmls/members.js"></script>
<script src="./js/htmls/lotteries.js"></script>
<script src="./js/htmls/tickets.js"></script>
<script src="./js/htmls/messages.js"></script>
<script>
window.addEventListener('load', function () {
init();
});
document.addEventListener('DOMContentLoaded', function () {
const elems = document.querySelectorAll('.modal');
const instances = M.Modal.init(elems, {});
});
</script>
</body>
</html>