-
-
Notifications
You must be signed in to change notification settings - Fork 228
Expand file tree
/
Copy pathindex.html
More file actions
72 lines (68 loc) · 1.9 KB
/
index.html
File metadata and controls
72 lines (68 loc) · 1.9 KB
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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
<title>MetaMask Connect Install Modal Web</title>
<script type="module" src="/build/sdk-install-modal-web.esm.js"></script>
<script nomodule src="/build/sdk-install-modal-web.js"></script>
<style>
.nav {
padding: 20px;
background: #f5f5f5;
margin-bottom: 20px;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100000;
}
.nav a {
margin-right: 15px;
color: #333;
text-decoration: none;
}
.nav a:hover {
text-decoration: underline;
}
.component-container {
padding: 20px;
margin-top: 60px;
}
</style>
</head>
<body>
<div class="nav">
<a href="#install">Install Modal</a>
<a href="#otp">OTP Modal</a>
</div>
<div class="component-container">
<div id="install" style="display: none">
<h2>Install Modal</h2>
<mm-install-modal
link="https://example.com/install"
connect-version="1.0.0"
prefer-desktop="true"
></mm-install-modal>
</div>
<div id="otp" style="display: none">
<h2>OTP Modal</h2>
<mm-otp-modal></mm-otp-modal>
</div>
</div>
<script>
function showComponent() {
const hash = window.location.hash || '#install';
document.querySelectorAll('.component-container > div').forEach(div => {
div.style.display = 'none';
});
const componentDiv = document.querySelector(hash);
if (componentDiv) {
componentDiv.style.display = 'block';
}
}
window.addEventListener('hashchange', showComponent);
showComponent();
</script>
</body>
</html>