-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
159 lines (135 loc) · 5.81 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pay with Crypto</title>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
.crypto-option img {
width: 30px;
height: 30px;
object-fit: cover;
border-radius: 50%;
margin-right: 10px;
}
</style>
</head>
<body>
<div class="container mt-5">
<div class="row">
<div class="col-md-6 offset-md-3">
<div class="card">
<div class="card-header bg-warning text-white">
<div class="row">
<center>
<h4 class="mb-0"><img src="cyrptopay.svg" /></h4>
</center>
</div>
</div>
<div class="card-body">
<div id="trxInfoDiv">
<div class="mb-3" id="slctcry"><center>
<label for="cryptoSelect" class="form-label">Select Cryptocurrency</label>
<div class="dropdown">
<input class="btn btn-danger dropdown-toggle" type="button" id="cryptoDropdown" value="Tron (TRX)" data-bs-toggle="dropdown" aria-expanded="false">
<ul class="dropdown-menu" aria-labelledby="cryptoDropdown">
<li><a onclick="selectCrypto('btc')" class="dropdown-item crypto-option" href="#" data-crypto="btc"><img src="btc.png" alt="Bitcoin"> Bitcoin (BTC)</a></li>
<li><a onclick="selectCrypto('eth')" class="dropdown-item crypto-option" href="#" data-crypto="eth"><img src="eth.png" alt="Ethereum"> Ethereum (ETH)</a></li>
<li><a onclick="selectCrypto('trx')" class="dropdown-item crypto-option" href="#" data-crypto="trx"><img src="trx.png" alt="Tron" selected> Tron (TRX)</a></li>
<li><a onclick="selectCrypto('usdt')" class="dropdown-item crypto-option" href="#" data-crypto="usdt"><img src="usdt.svg" alt="Tether"> Tether (USDT)</a></li>
</ul>
<input type="hidden" name="crypto" id="selectedCrypto">
</div>
</center>
</div>
<div id="hashInputDiv" style="display: none;">
<div class="mb-3">
<label for="hash" class="form-label">Transaction Hash:</label>
<input type="text" class="form-control" id="hash">
</div>
<button type="button" class="btn btn-success" onclick="Complete()">Complete</button>
</div>
<div id="CryBody">
<script>
let cryptoType = "TRX";
function copyToClipboard(elementId) {
var element = document.getElementById(elementId);
element.select();
document.execCommand("copy");
Swal.fire({
title: "Copied",
text: "Copied => " + element.value + " ",
timer: 500,
icon: "success"
});
}
function showHashInput() {
var trxInfoDiv = document.getElementById('CryBody');
if (!trxInfoDiv) {
trxInfoDiv = document.createElement('div');
trxInfoDiv.id = 'CryBody';
document.getElementById('trxInfoDiv').appendChild(trxInfoDiv);
}
trxInfoDiv.innerHTML = ""; // Clear other fields
var hashInputDiv = document.getElementById('hashInputDiv');
if (!hashInputDiv) {
console.error('hashInputDiv element not found.');
return;
}
document.getElementById("slctcry").style.display = 'none';
hashInputDiv.style.display = 'block';
}
function Complete() {
Swal.fire({
title: "Verified",
text: "Your " + cryptoType + " transaction has been completed successfully",
icon: "success"
});
}
function selectCrypto(crypto) {
if (crypto == 'btc') {
document.getElementById("cryptoDropdown").value = "Bitcoin (BTC)";
cryptoType = "BTC";
} else if (crypto == 'eth') {
document.getElementById("cryptoDropdown").value = "Ethereum (ETH)";
cryptoType = "ETH";
} else if (crypto == 'trx') {
document.getElementById("cryptoDropdown").value = "Tron (TRX)";
cryptoType = "TRX";
} else if (crypto == 'usdt') {
document.getElementById("cryptoDropdown").value = "Tether (USDT)";
cryptoType = "USDT";
} else {
document.getElementById("cryptoDropdown").value = "Choose Cryptocurrency";
}
document.getElementById("CryBody").innerHTML = `
<div class="mb-3">
<label for="trxAddress" class="form-label">Recipient ${cryptoType} Address:</label>
<div class="input-group">
<input type="text" class="form-control" id="trxAddress" value="Trusdhfudsfddjdhkdf" readonly>
<button class="btn btn-outline-secondary" type="button" onclick="copyToClipboard('trxAddress')">Copy</button>
</div>
</div>
<div class="mb-3">
<label for="trxAmount" class="form-label">Amount to Send (${cryptoType}):</label>
<div class="input-group">
<input type="text" class="form-control" id="trxAmount" value="50" readonly>
<button class="btn btn-outline-secondary" type="button" onclick="copyToClipboard('trxAmount')">Copy</button>
</div>
</div>
<button type="button" class="btn btn-success" onclick="showHashInput()">Sent</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
`;
}
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>