-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
94 lines (91 loc) · 4.22 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
<!DOCTYPE html>
<html>
<head>
<title>Offer Wall</title>
<script src="https://cdn.ethers.io/lib/ethers-5.2.umd.min.js" type="application/javascript"></script>
<script src="https://code.jquery.com/jquery-3.6.0.slim.js" integrity="sha256-HwWONEZrpuoh951cQD1ov2HUK5zA5DwJ1DNUXaM6FsY=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>
<script src="https://unpkg.com/bootstrap-table@1.19.1/dist/bootstrap-table.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/bootstrap-table@1.19.1/dist/bootstrap-table.min.css">
<script type="module" src="./public/js/main.js"></script>
<link rel="stylesheet" href="./public/css/main.css" />
</head>
<body>
<div id="offerWall">
<h1 class="mx-3">Offer Wall</h1>
<div class="loginBtn">
<p id="address"></p>
<button id="btn-login">Metamask Login</button>
<button id="btn-logout" class="float-right">Logout</button>
</div>
<div id="toolbar">
<button id="addBtn" class="btn btn-secondary">Add Offer</button>
</div>
<table id="table">
<thead>
<tr>
<th data-field="id">Token ID</th>
<th data-field="name">Offer Name</th>
<th data-field="reward">Offer Reward</th>
<th data-field="count">Offer Count</th>
<th data-field="level">Require Level</th>
<th data-field="token">Require Token</th>
<th data-formatter="TableActions">Actions</th>
</tr>
</thead>
</table>
</div>
<div id="loading">
<img src="./public/images/loading.gif">
</div>
<div class="modal fade" id="newOfferModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Add Offer</h5>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="offerName">Offer Name*</label>
<input type="text" class="form-control" id="offerName" require placeholder="Enter offer name">
</div>
<div class="form-group">
<label for="offerReward">Offer Reward*</label>
<input type="text" class="form-control" id="offerReward" require placeholder="Enter offer reward">
</div>
<div class="form-group">
<label for="offerCount">Offer Count*</label>
<input type="text" class="form-control" id="offerCount" require placeholder="Enter offer count">
</div>
<div class="form-group">
<label for="contract">Contract Address*</label>
<input type="text" class="form-control" id="contract" require placeholder="Enter contract address">
</div>
<div class="form-group">
<label for="level">Require Level</label>
<input type="text" class="form-control" id="level" placeholder="Enter require level">
</div>
<div class="form-group">
<label for="token">Require Token</label>
<input type="text" class="form-control" id="token" placeholder="Enter require token address">
</div>
</form>
</div>
<div class="modal-footer">
<button id="submitBtn" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</div>
</body>
</html>
<script>
function TableActions (value, row, index) {
return [
'<button id="takeBtn" class="btn btn-link" data-tokenid="'+row.id+'">Take</button>',
'<button id="claimBtn" class="btn btn-link" data-tokenid="'+row.id+'">Claim</button>'
].join('');
}
</script>