|
6 | 6 | <link rel="stylesheet" href="styles.css">
|
7 | 7 | <link rel="icon" href="assets/logo.svg" type="image/x-icon" />
|
8 | 8 | <script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
|
9 |
| - <title>Donate via UPI or PayPal</title> |
| 9 | + <title>Donate inulute@boi</title> |
| 10 | + <style> |
| 11 | + /* Add styles for the loading spinner */ |
| 12 | + .spinner { |
| 13 | + border: 4px solid #f3f3f3; /* Light grey */ |
| 14 | + border-top: 4px solid #3498db; /* Blue */ |
| 15 | + border-radius: 50%; |
| 16 | + width: 30px; |
| 17 | + height: 30px; |
| 18 | + animation: spin 1s linear infinite; |
| 19 | + margin: 0 auto; |
| 20 | + } |
| 21 | + |
| 22 | + @keyframes spin { |
| 23 | + 0% { transform: rotate(0deg); } |
| 24 | + 100% { transform: rotate(360deg); } |
| 25 | + } |
| 26 | + |
| 27 | + .loading-container { |
| 28 | + display: none; |
| 29 | + text-align: center; |
| 30 | + margin: 20px 0; |
| 31 | + } |
| 32 | + </style> |
10 | 33 | </head>
|
11 | 34 | <body>
|
12 | 35 | <div class="container">
|
13 | 36 | <!-- QR Section -->
|
14 | 37 | <div class="qr-container">
|
| 38 | + <div class="loading-container"> |
| 39 | + <div class="spinner"></div> |
| 40 | + <p>Loading...</p> |
| 41 | + </div> |
15 | 42 | <div class="qr-code">
|
16 | 43 | <img id="qr-image" src="assets/qr-code.png" alt="UPI QR Code">
|
17 | 44 | </div>
|
18 | 45 | <div class="payment-info">
|
19 |
| - <p id="qr-text">Scan the QR code or use the following method:</p> <!-- Updated ID here --> |
| 46 | + <p id="qr-text">Scan the QR code or use the following method</p> |
20 | 47 | <div class="upi-id-content">
|
21 | 48 | <strong id="payment-id">inulute@boi</strong>
|
22 | 49 | <button id="payment-button" class="copy-button">Copy</button>
|
|
34 | 61 | </div>
|
35 | 62 | </div>
|
36 | 63 | <!-- Toggle between UPI and PayPal -->
|
37 |
| - <a id="toggle-link" href="#" class="toggle-payment">Wanna donate via PayPal?</a> |
| 64 | + <a id="toggle-link" href="#" class="toggle-payment">Donate via PayPal? Click Here</a> |
38 | 65 | </div>
|
39 | 66 | </div>
|
40 | 67 |
|
|
45 | 72 | const paymentId = document.getElementById("payment-id");
|
46 | 73 | const paymentButton = document.getElementById("payment-button");
|
47 | 74 | const upiAnimation = document.getElementById("upi-animation");
|
48 |
| - const qrText = document.getElementById("qr-text"); // New variable for QR text |
| 75 | + const qrText = document.getElementById("qr-text"); |
| 76 | + const loadingContainer = document.querySelector(".loading-container"); |
49 | 77 |
|
50 |
| - let isUpi = true; // Tracks whether it's UPI or PayPal |
| 78 | + let isUpi = true; |
51 | 79 |
|
52 | 80 | // Function to switch to PayPal
|
53 | 81 | function switchToPayPal() {
|
| 82 | + loadingContainer.style.display = "block"; // Show loading spinner |
| 83 | + qrImage.style.display = "none"; // Hide QR image |
| 84 | + |
| 85 | + qrImage.onload = function() { |
| 86 | + loadingContainer.style.display = "none"; // Hide loading spinner |
| 87 | + qrImage.style.display = "block"; // Show QR image |
| 88 | + }; |
| 89 | + |
54 | 90 | qrImage.src = "assets/paypal_qr.png"; // Replace with your PayPal QR code image
|
55 | 91 | paymentId.textContent = "inulute"; // Replace with your PayPal ID
|
56 | 92 | paymentButton.textContent = "Open PayPal";
|
57 | 93 | paymentButton.removeEventListener("click", copyUpiId);
|
58 | 94 | paymentButton.addEventListener("click", openPayPalLink);
|
59 |
| - toggleLink.textContent = "Wanna donate via UPI?"; |
| 95 | + toggleLink.textContent = "Donate via UPI? Click Here"; |
60 | 96 | upiAnimation.style.display = "none";
|
61 |
| - qrText.textContent = "Scan with any QR scanning app or use the button:"; // Change text for PayPal |
| 97 | + qrText.textContent = "Scan with any QR scanning app or use the button"; |
62 | 98 | isUpi = false;
|
63 | 99 | }
|
64 | 100 |
|
65 | 101 | // Function to switch to UPI
|
66 | 102 | function switchToUpi() {
|
| 103 | + qrImage.style.display = "none"; // Hide QR image |
| 104 | + loadingContainer.style.display = "none"; // Hide loading spinner |
| 105 | + |
| 106 | + qrImage.onload = function() { |
| 107 | + qrImage.style.display = "block"; // Show QR image |
| 108 | + }; |
| 109 | + |
67 | 110 | qrImage.src = "assets/qr-code.png"; // Replace with your UPI QR code image
|
68 | 111 | paymentId.textContent = "inulute@boi"; // Replace with your UPI ID
|
69 | 112 | paymentButton.textContent = "Copy";
|
70 | 113 | paymentButton.removeEventListener("click", openPayPalLink);
|
71 | 114 | paymentButton.addEventListener("click", copyUpiId);
|
72 |
| - toggleLink.textContent = "Wanna donate via PayPal?"; |
| 115 | + toggleLink.textContent = "Donate via PayPal? Click Here"; |
73 | 116 | upiAnimation.style.display = "block";
|
74 |
| - qrText.textContent = "Scan the QR code or use the following method:"; // Reset text for UPI |
| 117 | + qrText.textContent = "Scan the QR code or use the following method"; |
75 | 118 | isUpi = true;
|
76 | 119 | }
|
77 | 120 |
|
|
111 | 154 | event.preventDefault();
|
112 | 155 | });
|
113 | 156 | });
|
| 157 | + |
114 | 158 | (function() {
|
115 |
| - 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); |
116 |
| - console.log(message); |
| 159 | + 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); |
| 160 | + console.log(message); |
117 | 161 | })();
|
118 |
| - |
119 | 162 | </script>
|
120 | 163 | </body>
|
121 | 164 | </html>
|
0 commit comments