forked from hyunleee/roul-fi-front
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstake.html
170 lines (160 loc) · 8.07 KB
/
stake.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Roul-Fi</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<style>
.container {
display: flex;
margin-top: 70px;
margin-bottom: 100px;
justify-content: center;
align-items: center;
}
.box1 {
flex: 1;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.box2 {
flex: 1;
margin-left: 1px;
justify-content: center; /* 수평 방향 가운데 정렬 */
align-items: center; /* 수직 방향 가운데 정렬 */
}
.nav-item{
margin-right: 30px;
font-size: 30px;
}
</style>
</head>
<body>
<nav class="navbar bg-body-tertiary">
<div class="container-fluid d-flex justify-content-between align-items-center">
<a class="navbar-brand" href="#" style="font-size: 38px;">
<img src="./images/Logo.png" alt="Logo" width="50" height="auth" class="d-inline-block align-text-top">
Roul-Fi
</a>
<ul class="navbar-nav d-flex flex-row">
<li class="nav-item" style="margin-right: 40px;">
<a class="nav-link" href="stake.html">Stake</a>
</li>
<li class="nav-item" style="margin-right: 40px;">
<a class="nav-link" href="play.html">Play</a>
</li>
<li class="nav-item" style="margin-right: 40px;">
<a class="nav-link" href="dashboard.html">Leaderboard</a>
</li>
<li class="nav-item" style="display: flex; justify-content: center; align-items: center; margin-top: 10px;" >
<p style="font-size:25px; color: rgb(0, 139, 185)" id="walletaddresshex"></p>
</li>
</ul>
</div>
</nav>
<section class="container" style="display: flex; flex-direction: column; justify-content: center; align-items: center;">
<div style="display: flex; justify-content: center; align-items: center;">
<div class="box1" style="display: flex; flex-direction: column;">
<div>
<img src="./images/stakeEth.png" alt="title1" width="470" height="auth">
</div>
<div style="background-color: rgba(44, 199, 251, 0.20); border-radius: 10px; padding: 20px; width: 650px; height: 400px; display: flex; flex-direction: column; justify-content: center; align-items: center;">
<div style="margin-bottom: 20px;">
<input type="text" placeholder="ETH staking amount" style="width: 550px; height: 45px; border-radius: 10px;">
</div>
<div>
<div style="width: 550px; height: 45px; text-align: center; background-color: #53717A; border-radius: 10px; padding-top: 10px; color: white; margin-bottom: 20px;">
<p>o.ooo ETH is in Neopin Wallet</p>
</div>
<div style="display: flex; flex-direction: column; align-items: center;">
<div style="display: flex; justify-content: space-between; width: 100%; margin-bottom: 10px;">
<p>You will receive</p>
<p>------------------------------</p>
<p>0.0rfETH</p>
</div>
<div style="display: flex; justify-content: space-between; width: 100%; margin-bottom: 10px;">
<p>Exchange rate</p>
<p>------------------------------</p>
<p>0.0rfETH</p>
</div>
<div style="display: flex; justify-content: space-between; width: 100%; margin-bottom: 10px;">
<p>Transaction fee</p>
<p>------------------------------</p>
<p>0.0rfETH</p>
</div>
<div style="display: flex; justify-content: space-between; width: 100%; margin-bottom: 10px;">
<p>Roul-Fi fee</p>
<p>------------------------------</p>
<p>0.0rfETH</p>
</div>
</div>
</div>
</div>
</div>
<div class="box2" style="margin-left: 120px; display: flex; justify-content: center; align-items: center; flex-direction: column;">
<div style="margin-bottom: 20px;">
<img src="./images/stakeStatistics.png" alt="dice" width="400" height="auth">
</div>
<div style="background-color: rgba(44, 199, 251, 0.20); border-radius: 10px; padding: 20px; margin-top: 20px; width: 600px;">
<div style="display: flex; justify-content: space-between;">
<p>You will receive</p>
<p>------------------------------</p>
<p>0.0rfETH</p>
</div>
<div style="display: flex; justify-content: space-between;">
<p>Exchange rate</p>
<p>------------------------------</p>
<p>0.0rfETH</p>
</div>
<div style="display: flex; justify-content: space-between;">
<p>Transaction fee</p>
<p>------------------------------</p>
<p>0.0rfETH</p>
</div>
<div style="display: flex; justify-content: space-between;">
<p>Roul-Fi fee</p>
<p>------------------------------</p>
<p>0.0rfETH</p>
</div>
</div>
<img src="./images/roule&rock2.png" alt="roule&rock2" width="500">
</div>
</div>
</section>
<div style="display: flex; justify-content: center; align-items: center" >
<p style="color:rgb(111, 111, 111)">Presented by BV24</p>
</div>
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<script>
function sliceHex(hexValue) {
// 헥스값을 문자열로 변환
let hexString = hexValue.toString();
// 만약에 입력값이 0x로 시작하는 형태라면 "0x"를 제거
if (hexString.startsWith('0x')) {
hexString = hexString.slice(2);
}
// 왼쪽 5개 문자 슬라이싱
let leftSlice = hexString.slice(0, 5);
// 오른쪽 3개 문자 슬라이싱
let rightSlice = hexString.slice(-3);
// 완전한 문자열로 조합하여 반환
return "0x" + leftSlice + "..." + rightSlice;
}
const wallet = async () => {
if(window.ethereum !== "undefined") {
const accounts = await ethereum.request({method: "eth_requestAccounts"});
const account = accounts[0];
console.log(`my contract: ${account}`);
var walletaddress = sliceHex(account);
console.log(walletaddress);
document.getElementById("walletaddresshex").innerHTML = walletaddress;
}
}
wallet();
</script>
</body>
</html>