-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
164 lines (148 loc) · 6.55 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
160
161
162
163
164
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="styles.css">
<link rel="icon" href="assets/logo.svg" type="image/x-icon" />
<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
<title>UPI inulute@boi</title>
<style>
/* Add styles for the loading spinner */
.spinner {
border: 4px solid #f3f3f3; /* Light grey */
border-top: 4px solid #3498db; /* Blue */
border-radius: 50%;
width: 30px;
height: 30px;
animation: spin 1s linear infinite;
margin: 0 auto;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.loading-container {
display: none;
text-align: center;
margin: 20px 0;
}
</style>
</head>
<body>
<div class="container">
<!-- QR Section -->
<div class="qr-container">
<div class="loading-container">
<div class="spinner"></div>
<p>Loading...</p>
</div>
<div class="qr-code">
<img id="qr-image" src="assets/qr-code.png" alt="UPI QR Code">
</div>
<div class="payment-info">
<p id="qr-text">Scan the QR code or use the following method</p>
<div class="upi-id-content">
<strong id="payment-id">inulute@boi</strong>
<button id="payment-button" class="copy-button">Copy</button>
<lottie-player
id="upi-animation"
src="https://lottie.host/2b51d7af-7099-49f5-93df-f8190dde11bb/WU9eejAueC.json"
background="#FFFFFF"
speed="1.5"
loop
autoplay
direction="1"
mode="normal"
class="upi-icon"
></lottie-player>
</div>
</div>
<!-- Toggle between UPI and PayPal -->
<a id="toggle-link" href="#" class="toggle-payment">Donate via PayPal? Click Here</a>
</div>
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
const toggleLink = document.getElementById("toggle-link");
const qrImage = document.getElementById("qr-image");
const paymentId = document.getElementById("payment-id");
const paymentButton = document.getElementById("payment-button");
const upiAnimation = document.getElementById("upi-animation");
const qrText = document.getElementById("qr-text");
const loadingContainer = document.querySelector(".loading-container");
let isUpi = true;
// Function to switch to PayPal
function switchToPayPal() {
loadingContainer.style.display = "block"; // Show loading spinner
qrImage.style.display = "none"; // Hide QR image
qrImage.onload = function() {
loadingContainer.style.display = "none"; // Hide loading spinner
qrImage.style.display = "block"; // Show QR image
};
qrImage.src = "assets/paypal_qr.png"; // Replace with your PayPal QR code image
paymentId.textContent = "inulute"; // Replace with your PayPal ID
paymentButton.textContent = "Open PayPal";
paymentButton.removeEventListener("click", copyUpiId);
paymentButton.addEventListener("click", openPayPalLink);
toggleLink.textContent = "Donate via UPI? Click Here";
upiAnimation.style.display = "none";
qrText.textContent = "Scan with any QR scanning app or use the button";
isUpi = false;
}
// Function to switch to UPI
function switchToUpi() {
qrImage.style.display = "none"; // Hide QR image
loadingContainer.style.display = "none"; // Hide loading spinner
qrImage.onload = function() {
qrImage.style.display = "block"; // Show QR image
};
qrImage.src = "assets/qr-code.png"; // Replace with your UPI QR code image
paymentId.textContent = "inulute@boi"; // Replace with your UPI ID
paymentButton.textContent = "Copy";
paymentButton.removeEventListener("click", openPayPalLink);
paymentButton.addEventListener("click", copyUpiId);
toggleLink.textContent = "Donate via PayPal? Click Here";
upiAnimation.style.display = "block";
qrText.textContent = "Scan the QR code or use the following method";
isUpi = true;
}
// Function to copy UPI ID
function copyUpiId() {
const tempInput = document.createElement("input");
tempInput.value = paymentId.textContent;
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand("copy");
document.body.removeChild(tempInput);
paymentButton.textContent = "Copied!";
setTimeout(function () {
paymentButton.textContent = "Copy";
}, 2500);
}
// Function to open PayPal link
function openPayPalLink() {
window.open("https://www.paypal.com/paypalme/inulute", "_blank");
}
// Toggle between UPI and PayPal when the link is clicked
toggleLink.addEventListener("click", function (e) {
e.preventDefault();
if (isUpi) {
switchToPayPal();
} else {
switchToUpi();
}
});
// Add the copy functionality for UPI by default
paymentButton.addEventListener("click", copyUpiId);
document.addEventListener("contextmenu", function (event) {
event.preventDefault();
});
});
(function() {
const message = String.fromCharCode(77, 97, 100, 101, 32, 119, 105, 116, 104, 32, 128149, 32, 98, 121, 32, 73, 110, 117, 108, 117, 116, 101);
console.log(message);
})();
</script>
</body>
</html>