Update index.html
Browse files- index.html +14 -10
index.html
CHANGED
|
@@ -384,16 +384,20 @@ lumin("query", "username", "logic", true)
|
|
| 384 |
fetchStats();
|
| 385 |
|
| 386 |
function copyToClipboard(button) {
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 397 |
</script>
|
| 398 |
</body>
|
| 399 |
</html>
|
|
|
|
| 384 |
fetchStats();
|
| 385 |
|
| 386 |
function copyToClipboard(button) {
|
| 387 |
+
const codeBlock = button.nextElementSibling.innerText;
|
| 388 |
+
navigator.clipboard.writeText(codeBlock).then(() => {
|
| 389 |
+
button.querySelector('img').src = 'https://cdn.iconscout.com/icon/free/png-256/check-1781599-1518574.png';
|
| 390 |
+
button.style.transform = 'scale(1.2)'; // Add a scale transform
|
| 391 |
+
button.style.transition = 'transform 0.3s ease'; // Add a smooth transition
|
| 392 |
+
setTimeout(() => {
|
| 393 |
+
button.querySelector('img').src = 'https://cdn.iconscout.com/icon/free/png-256/copy-1781607-1518582.png';
|
| 394 |
+
button.style.transform = 'scale(1)'; // Reset the transform
|
| 395 |
+
}, 2000);
|
| 396 |
+
}).catch(err => {
|
| 397 |
+
console.error('Failed to copy: ', err);
|
| 398 |
+
});
|
| 399 |
+
}
|
| 400 |
+
|
| 401 |
</script>
|
| 402 |
</body>
|
| 403 |
</html>
|