-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex1.html
119 lines (104 loc) · 4.05 KB
/
index1.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
<!doctype html>
<html lang="en">
<head>
<title>MediSpace Login</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body class="img js-fullheight" style="background-image: url(public/Branding/login.jpeg);">
<section class="ftco-section">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-6 text-center mb-5">
<h2 class="heading-section">MediSpace Login</h2>
</div>
</div>
<div class="row justify-content-center">
<div class="col-md-6 col-lg-4">
<div class="login-wrap p-0">
<h3 class="mb-4 text-center">Have an account?</h3>
<form action="#" class="signin-form">
<div class="form-group">
<input type="text" class="form-control" placeholder="Username" required>
</div>
<div class="form-group">
<input id="password-field" type="password" class="form-control" placeholder="Password" required>
<span toggle="#password-field" class="fa fa-fw fa-eye field-icon toggle-password"></span>
</div>
<div class="form-group">
<button id="connectButton" type="button" class="form-control btn btn-primary submit px-3">Connect Wallet</button>
</div>
<div class="form-group d-md-flex">
<div class="w-50">
<label class="checkbox-wrap checkbox-primary">Remember Me
<input type="checkbox" checked>
<span class="checkmark"></span>
</label>
</div>
<div class="w-50 text-md-right">
<!-- <a href="#" style="color: #fff">Forgot Password</a> -->
</div>
</div>
</form>
<div class="form-group">
<!-- <button type="submit" class="form-control btn btn-primary submit px-3">Sign Up</button> -->
</div>
<p class="w-100 text-center">— Or Sign In With —</p>
<div class="social d-flex text-center">
<a href="#" class="px-2 py-2 mr-md-1 rounded"><span class="ion-logo-facebook mr-2"></span> Phantom </a>
<a href="#" class="px-2 py-2 ml-md-1 rounded"><span class="ion-logo-twitter mr-2"></span> Trust Wallet </a>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- blockchain -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/web3/1.3.0/web3.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@metamask/legacy-web3@latest/dist/metamask.web3.min.js"></script>
<script>
const connectButton = document.getElementById('connectButton');
connectButton.addEventListener('click', async () => {
if (typeof window.ethereum!== 'undefined') {
try {
// Request account access if needed
await ethereum.request({ method: 'eth_requestAccounts' });
// Accounts now exposed
const accounts = await ethereum.request({ method: 'eth_accounts' });
console.log('Found accounts:', accounts);
// Send sign-in request
const signInData = {
username: 'your_username',
password: 'your_password',
ethereumAddress: accounts[0]
};
// Replace with your API endpoint
const url = 'https://your-api-endpoint.com/signin';
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(signInData)
})
.then(response => response.json())
.then(data => console.log('Sign-in response:', data))
.catch(error => console.error('Error:', error));
} catch (error) {
console.error('Error:', error);
}
} else {
console.log('MetaMask not detected.');
}
});
</script>
<script src="js/jquery.min.js"></script>
<script src="js/popper.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/main.js"></script>
<!-- <script src="js/blockchain.js"></script> -->
</body>
</html>