-
-
Notifications
You must be signed in to change notification settings - Fork 36
/
demo.connect.html
86 lines (77 loc) · 3.2 KB
/
demo.connect.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="https://depay.com/favicon.png"/>
<title>Development</title>
<script defer async src="dist/umd/index.bundle.js"></script>
<link rel="stylesheet" href="https://unpkg.com/bootstrap@4.1.0/dist/css/bootstrap.css">
<style>
.btn-primary {
color: #fff;
background-color: #ea357a !important;
border: 1px solid #ea357a !important;
padding: 0.35rem 1.2rem !important;
box-shadow: none;
outline: none;
}
.btn-primary:hover {
box-shadow: inset 0 0 18px rgba(0,0,0,0.1) !important;
}
</style>
</head>
<body style="background-color: #FAFAFA;">
<div class="container py-4">
<div class="py-2 pb-3 text-center">
<a href="https://depay.com" target="_blank">
<img alt="DePay Logo" class="navbar-logo shadow-sm" src="https://depay.com/logo.svg" style="height: 50px; width: 50px; border-radius: 999px;"/>
</a>
</div>
<div class="row px-2 text-center">
<div class="d-block col-md-4"></div>
<div class="d-block d-md-inline-block p-2 col-12 col-md-4">
<div class="px-0 py-4 rounded-lg bg-white border">
<div class="col px-0">
<div class="overflow-auto" style="min-height: 140px;">
<h5 class="px-4">Connect</h5>
<div class="px-4">
<div class="text-secondary ">Connect a wallet</div>
</div>
<div class="d-block d-md-inline-block p-2 col-12 col-md-4">
<div class="px-0 py-4 rounded-lg">
<div class="col px-0">
<div>
<img style="display: none" id="walletlogo"/>
</div>
<div class="pt-3">
<h4 id="walletname"></h4>
</div>
</div>
</div>
</div>
</div>
<div class="px-4 pt-3">
<button class='btn btn-primary' id="connectButton">Try it</button>
<script>
var button = document.getElementById("connectButton");
button.addEventListener("click",async function(e){
let { account, accounts, wallet } = await DePayWidgets.Connect()
document.getElementById("walletname").innerHTML = wallet.name
document.getElementById("walletlogo").setAttribute('src', wallet.logo)
document.getElementById("walletlogo").setAttribute('style', 'width: 60px; height: 60px')
document.getElementById("connectButton").innerHTML = 'Connect another wallet'
});
</script>
</div>
</div>
</div>
</div>
<div class="d-block col-md-4"></div>
</div>
</div>
<div class="px-2 pt-3 text-center" style="opacity: 0.5">
Learn more about <a href="https://depay.com" target="_blank">DePay</a>
</div>
</body>
</html>