-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
138 lines (134 loc) · 7.13 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width"
name="viewport">
<title>Provably Fair</title>
<link rel="stylesheet" href="./styles/index.css">
<script src="./js/vue.js"></script>
<script src="./js/crypto-js/crypto-js.js" async></script>
<script src="./js/bignumber.js"></script>
<script src="./js/decimal.js"></script>
<script src="./js/fair_verification.js"></script>
</head>
<body>
<div id="root">
<div class="wrap">
<div class="header flex-middle">
<h1>Provably Fair</h1>
<h2>giveaway verification</h2>
<div v-if="!lotteryType">BLOCKCHIAN BASED</div>
</div>
<div class="content">
<div class="view-box">
<h2 v-show="!generate" style="margin-bottom: 0;">> Waiting for input <i>_</i></h2>
<div v-show="generate" id="view"></div>
</div>
<!-- single -->
<form class="from-box flex-middle" v-if="lotteryType">
<div class="from-item">
<div class="content-box flex-middle">
<label for="server">ServerSeed</label>
<input id="server" type="text" v-model:value="serverValue" v-on:blur="" class="form-control"
placeholder="Input serverseed" />
</div>
<v-warning v-show="isShowWarning&&!serverValue" text="Please enter a server seed">
</v-warning>
</div>
<div class="from-item">
<div class="content-box flex-middle">
<label for="client">ClientSeed</label>
<input id="client" type="text" v-model:value="clientValue" class="form-control"
placeholder="Input clientseed">
</div>
<v-warning v-show="isShowWarning&&!clientValue" text="Please enter a client seed">
</v-warning>
</div>
<div class="from-item">
<div class="content-box flex-middle">
<label for="uid">PID</label>
<input id="uid" type="text" v-model:value="uidValue" class="form-control"
placeholder="Will be available after all tasks are done">
</div>
<v-warning v-show="isShowWarning&&!uidValue" text="Please enter a PID">
</v-warning>
</div>
<div class="from-item">
<div class="content-box flex-middle">
<label for="server">Chance of Winning<span>(Setup by the giveaway sponsor)</span></label>
<div class="input-box odds">
<input id="server" type="number" v-model:value="oddsValue" class="form-control"
placeholder="Input chance of winning">
</div>
</div>
<v-warning v-show="isShowWarning&&(oddsValue<=0||oddsValue>100)"
text="Please enter a number >= 0.01%">
</v-warning>
</div>
<button type="button" v-on:click="singleVerify">Verify</button>
</form>
<!-- group -->
<form class="from-box flex-middle" v-else>
<div class="from-item">
<div class="content-box flex-middle">
<label for="server">ServerSeed</label>
<input id="server" type="text" v-model:value="serverValue" class="form-control"
placeholder="Input serverseed" />
</div>
<v-warning v-show="isShowWarning&&!serverValue" text="Please enter server seed">
</v-warning>
</div>
<div class="from-item">
<div class="content-box flex-middle">
<label for="server">ClientSeed(ETH block hash)</label>
<input id="server" type="text" v-model:value="ethHashValue" class="form-control"
placeholder="Input clientseed">
</div>
<v-warning v-show="isShowWarning&&!ethHashValue" text="Please enter ETH block hash">
</v-warning>
</div>
<div class="from-item">
<div class="content-box flex-middle">
<label for="server">Number of Participants</label>
<input id="server" type="number" v-model:value="participantValue" class="form-control"
placeholder="Input number of participants">
</div>
<v-warning v-show="isShowWarning&&participantValue<=0"
text="Please enter the number of participants">
</v-warning>
</div>
<div class="from-item">
<div class="content-box flex-middle">
<label for="server">Number of Winners</label>
<input id="server" type="number" v-model:value="winnerValue" class="form-control"
placeholder="Input number of winners">
</div>
<v-warning v-show="isShowWarning&&winnerValue<=0" text="Please enter the number of winners">
</v-warning>
</div>
<div class="from-item">
<div class="content-box flex-middle">
<label for="server">PID</label>
<input id="server" type="number" v-model:value="myParticipantValue" class="form-control"
placeholder="Will be available after all tasks are done">
</div>
<v-warning v-show="isShowWarning&&(myParticipantValue<0||myParticipantValue==='')"
text="Please enter your participation number">
</v-warning>
</div>
<button type="button" v-on:click="groupVerify">Verify</button>
</form>
</div>
<div class="footer flex-middle">
<p>Open source & Custodial on</p>
<a href="https://github.com/cctip/fair_verification" target="_blank">
<img src="./assets/images/github.png" alt="github">
</a>
</div>
</div>
</div>
</body>
<script src="./index.js"></script>
</html>