-
Notifications
You must be signed in to change notification settings - Fork 3
/
owner.html
88 lines (86 loc) · 2.63 KB
/
owner.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
<!DOCTYPE html>
<html>
<head>
<title>MetaMask Integration</title>
<script src="https://cdn.jsdelivr.net/npm/@metamask/detect-provider"></script>
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
/>
<style>
.panel {
border-radius: 20px;
}
.panel-heading {
border-radius: 20px 20px 0 0;
}
.panel-body {
height: 300px;
background-size: cover;
background-position: center;
}
/* Added cursor pointer and hover effect for panels */
.panel:hover {
cursor: pointer;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
</style>
</head>
<body>
<!-- Added navbar with button -->
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Owner Portal</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li>
<button id="connectButton" class="btn btn-default navbar-btn">
Connect to MetaMask
</button>
</li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<!-- Added onclick attribute for panels -->
<div class="col-md-6" onclick="window.location.href='room1.html'">
<div class="panel panel-default">
<div class="panel-heading">Room 1</div>
<div
class="panel-body"
style="background-image: url('assets/spiral_pic.png');"
></div>
</div>
</div>
<!-- Added onclick attribute for panels -->
<div class="col-md-6" onclick="window.location.href='room2.html'">
<div class="panel panel-default">
<div class="panel-heading">Room 2</div>
<div
class="panel-body"
style="background-image: url('assets/2floor_pic.png');"
></div>
</div>
</div>
</div>
</div>
<script>
const connectButton = document.getElementById("connectButton");
connectButton.addEventListener("click", async () => {
const provider = await detectEthereumProvider();
if (provider) {
console.log("MetaMask is installed!");
const accounts = await ethereum.request({
method: "eth_requestAccounts",
});
console.log(accounts[0]);
} else {
console.log("Please install MetaMask!");
}
});
</script>
</body>
</html>