-
Notifications
You must be signed in to change notification settings - Fork 0
/
swap.html
197 lines (163 loc) · 11.8 KB
/
swap.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Swap</title>
<link rel="stylesheet" href="assets/css/header.css" />
<link rel="stylesheet" href="assets/css/swap.css" />
<style>
</style>
</head>
<body>
<div id="header"></div>
<div class="main">
<div class="page_top_space_div"></div>
<div class="swap_box_div">
<div class="swap_box">
<!-- swap all modal box -->
<div class="swap_all_modal_box">
<div class="select_from_network_box" id="select_from_network_box">
<div class="close_box_icon">
<h2>Select Network</h2>
<svg id="select_from_network_box_close_icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="m50 462c5 5 9 7 16 7 7 0 12-2 17-7l173-173 173 173c5 5 10 7 17 7 7 0 11-2 16-7 10-9 10-23 0-33l-173-173 173-173c10-10 10-24 0-33-9-10-23-10-33 0l-173 173-173-173c-10-10-24-10-33 0-10 9-10 23 0 33l173 173-173 173c-10 10-10 24 0 33z" fill="#ffffff"/></svg>
</div>
<div class="network_name_text_div">
<small>Network Name</small>
</div>
<div class="network_list">
<ul>
<li class="comming_soon_parent_ele" onclick="change_from_network_logo('Ethereum')"><img src="assets/images/network/ethereum.svg" alt="">Ethereum</li>
<li class="comming_soon_parent_ele" onclick="change_from_network_logo('BNB')"><img src="assets/images/network/bnb.svg" alt="">BNB</li>
<li class="comming_soon_parent_ele" onclick="change_from_network_logo('Linea')"><img src="assets/images/network/linea.svg" alt="">Linea</li>
<li class="comming_soon_parent_ele" onclick="change_from_network_logo('Mantle')"><img src="assets/images/network/mantle.svg" alt="">Mantle</li>
<li onclick="change_from_network_logo('Polygon')"><img src="assets/images/network/polygon.svg" alt="">Polygon</li>
</ul>
</div>
</div>
<div class="select_from_network_box" id="spend_token_box">
<div class="close_box_icon">
<h2>Select Token</h2>
<svg id="select_token_spend_box_close_icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="m50 462c5 5 9 7 16 7 7 0 12-2 17-7l173-173 173 173c5 5 10 7 17 7 7 0 11-2 16-7 10-9 10-23 0-33l-173-173 173-173c10-10 10-24 0-33-9-10-23-10-33 0l-173 173-173-173c-10-10-24-10-33 0-10 9-10 23 0 33l173 173-173 173c-10 10-10 24 0 33z" fill="#ffffff"/></svg>
</div>
<div class="network_name_text_div">
<small>Spend Token Name</small>
</div>
<div class="network_list">
<ul>
<li onclick="change_spend_token_logo('ethereum')" ><img src="assets/images/token/ethereum.svg" alt="">Ethereum</li>
<li onclick="change_spend_token_logo('linea')" ><img src="assets/images/token/linea.svg" alt="">Linea</li>
<li onclick="change_spend_token_logo('bnb')" ><img src="assets/images/token/bnb.svg" alt="">BNB</li>
<li onclick="change_spend_token_logo('mantle')" ><img src="assets/images/token/mantle.svg" alt="">Mantle</li>
<li onclick="change_spend_token_logo('matic')" ><img src="assets/images/token/matic.svg" alt="">Matic</li>
</ul>
</div>
</div>
<div class="select_from_network_box" id="recieve_token_box">
<div class="close_box_icon">
<h2>Select Token</h2>
<svg id="select_token_recieve_box_close_icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="m50 462c5 5 9 7 16 7 7 0 12-2 17-7l173-173 173 173c5 5 10 7 17 7 7 0 11-2 16-7 10-9 10-23 0-33l-173-173 173-173c10-10 10-24 0-33-9-10-23-10-33 0l-173 173-173-173c-10-10-24-10-33 0-10 9-10 23 0 33l173 173-173 173c-10 10-10 24 0 33z" fill="#ffffff"/></svg>
</div>
<div class="network_name_text_div">
<small>Recieve Token Name</small>
</div>
<div class="network_list">
<ul>
<li onclick="change_recieve_token_logo('ethereum')" ><img src="assets/images/token/ethereum.svg" alt="">Ethereum</li>
<li onclick="change_recieve_token_logo('linea')" ><img src="assets/images/token/linea.svg" alt="">Linea</li>
<li onclick="change_recieve_token_logo('bnb')" ><img src="assets/images/token/bnb.svg" alt="">BNB</li>
<li onclick="change_recieve_token_logo('mantle')" ><img src="assets/images/token/mantle.svg" alt="">Mantle</li>
<li onclick="change_recieve_token_logo('matic')" ><img src="assets/images/token/matic.svg" alt="">Matic</li>
</ul>
</div>
</div>
</div>
<!-- token Swap box -->
<h2 class="swap_box_heading_h4"><b>Swap</b></h2>
<div class="select_network_tab_div">
<label for="open_from_chainlist_box" class="select_form_box network_s_three">
<input hidden type="checkbox" id="open_from_chainlist_box">
<div style="display: flex; justify-content: start; align-items: center;">
<img class="network_logo from_network_logo" src="assets/images/network/linea.svg" alt="">
<span class="form_swap_net_name_span">Linea</span>
</div>
<svg class="down_arrow down_arrow_width" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" x="0" y="0" viewBox="0 0 451.847 451.847" style="enable-background:new 0 0 512 512" xml:space="preserve" class=""><g><path d="M225.923 354.706c-8.098 0-16.195-3.092-22.369-9.263L9.27 151.157c-12.359-12.359-12.359-32.397 0-44.751 12.354-12.354 32.388-12.354 44.748 0l171.905 171.915 171.906-171.909c12.359-12.354 32.391-12.354 44.744 0 12.365 12.354 12.365 32.392 0 44.751L248.292 345.449c-6.177 6.172-14.274 9.257-22.369 9.257z" fill="white" opacity="1" data-original="white" class=""></path></g></svg>
</label>
</div>
<div class="spend_input_div">
<small>You Send</small>
<div class="input_box">
<div class="input_with_max_button_div">
<input type="text" placeholder="0.00">
<button>Max</button>
</div>
<label for="spend_input_checkbox" class="select_token_select_box">
<input hidden type="checkbox" id="spend_input_checkbox">
<div class="token_logo_div">
<img class="spend_token_logo" src="assets/images/token/ethereum.svg" alt="">ETH
</div>
<svg xmlns="http://www.w3.org/2000/svg" class="down_arrow_width" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" x="0" y="0" viewBox="0 0 451.847 451.847" style="enable-background:new 0 0 512 512" xml:space="preserve" class=""><g><path d="M225.923 354.706c-8.098 0-16.195-3.092-22.369-9.263L9.27 151.157c-12.359-12.359-12.359-32.397 0-44.751 12.354-12.354 32.388-12.354 44.748 0l171.905 171.915 171.906-171.909c12.359-12.354 32.391-12.354 44.744 0 12.365 12.354 12.365 32.392 0 44.751L248.292 345.449c-6.177 6.172-14.274 9.257-22.369 9.257z" fill="white" opacity="1" data-original="white" class=""></path></g></svg>
</label>
</div>
<div class="balance_text">
Balance: <span>00</span>
</div>
</div>
<div class="spend_input_div">
<small>You Recieve</small>
<div class="input_box">
<div class="input_with_max_button_div">
<input type="text" placeholder="0.00" style="width:100% !important;">
</div>
<label for="recieve_input_checkbox" class="select_token_select_box">
<input hidden type="checkbox" id="recieve_input_checkbox">
<div class="token_logo_div">
<img class="recieve_token_logo" src="assets/images/token/ethereum.svg" alt="">ETH
</div>
<svg xmlns="http://www.w3.org/2000/svg" class="down_arrow_width" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" x="0" y="0" viewBox="0 0 451.847 451.847" style="enable-background:new 0 0 512 512" xml:space="preserve" class=""><g><path d="M225.923 354.706c-8.098 0-16.195-3.092-22.369-9.263L9.27 151.157c-12.359-12.359-12.359-32.397 0-44.751 12.354-12.354 32.388-12.354 44.748 0l171.905 171.915 171.906-171.909c12.359-12.354 32.391-12.354 44.744 0 12.365 12.354 12.365 32.392 0 44.751L248.292 345.449c-6.177 6.172-14.274 9.257-22.369 9.257z" fill="white" opacity="1" data-original="white" class=""></path></g></svg>
</label>
</div>
</div>
<div class="gas_estimate_me_div">
<div class="gas_es_box gas_es_box_1">
<span>Gas Fee : </span>
<span>0.01</span>
</div>
<div class="gas_es_box">
<span>Estimated Received : </span>
<span>5623.99</span>
</div>
</div>
<hr style="margin-top: 20px; border: 1px solid var(--main_div_color);">
<button class="swap_button">Swap</button>
</div>
</div>
</div>
</body>
<script src="assets/dist/ethers.js"></script>
<script src="assets/dist/variables.js"></script>
<script src="assets/dist/set_variable.js"></script>
<script src="assets/dist/get_chainid.js"></script>
<script src="assets/dist/connect_wallet.js"></script>
<!-- =============== page design script tag =============== -->
<script src="assets/js/swap.js"></script>
</html>
<script>
fetch('header.html')
.then((response) => response.text())
.then((data) => {
document.getElementById('header').innerHTML = data;
document.querySelector('#main_loading_div').classList.add('d-none');
// to fetch header .js file
fetch('assets/js/header.js')
.then((response) => response.text())
.then((scriptText) => {
const scriptElement = document.createElement('script');
scriptElement.textContent = scriptText;
document.head.appendChild(scriptElement);
})
.catch((error) => console.error('Error loading script:', error));
})
.catch((error) => console.error('Error loading header:', error));
</script>