commit 934a5cd50dfd2e1692ba78c94c2f044dd810fa37 Author: Zichao Lin Date: Thu Aug 22 22:12:36 2024 +0800 first commit diff --git a/data.json b/data.json new file mode 100644 index 0000000..acee5de --- /dev/null +++ b/data.json @@ -0,0 +1,27 @@ +{ + "monero": { + "address": "85z2KvhGAsqP3CqB4PngKZCPYRrSX6pMBEcfzhZpVb8n1bzo8NvwhxbaagjPJpnDfJPXL5WQQ8aMBTDwWTH2hfqbCvMcnxS", + "qr": "qr/xmr-1.png", + "icon": "icons/xmr.png" + }, + "bitcoin": { + "address": "bc1pfx4a7n6fuyum4dv6rjmg9nsuj7t9wdepjjgsp67d6n8hsdp8w47qw228fy", + "qr": "qr/btc-taproot.png", + "icon": "icons/btc.png" + }, + "eth": { + "address": "0x75aa91c8a00966bAc3a1a4371C8588D018Dbd7c4", + "qr": "qr/eth.png", + "icon": "icons/eth.png" + }, + "tron": { + "address": "TEMzQqABo7ttKioED8CVtTFkLz57cBSYc7", + "qr": "qr/trx.png", + "icon": "icons/trx.png" + }, + "solana": { + "address": "BDL89QkYohoU1zdx2wZtw2zDkcx6xth1ecrV6bhPja2a", + "qr": "qr/sol.png", + "icon": "icons/sol.png" + } +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..f0dbf82 Binary files /dev/null and b/favicon.ico differ diff --git a/i18n/en.json b/i18n/en.json new file mode 100644 index 0000000..985eebe --- /dev/null +++ b/i18n/en.json @@ -0,0 +1,12 @@ +{ + "title": "Donate Cryptocurrency", + "copyAddress": "Copy Address", + "copyAddressSuccess": "Address Copied!", + "english": "English", + "chinese": "中文", + "tron": "Tron", + "eth": "EVM Capable", + "bitcoin": "Bitcoin", + "solana": "Solana", + "monero": "Monero" +} diff --git a/i18n/zh.json b/i18n/zh.json new file mode 100644 index 0000000..da47aa7 --- /dev/null +++ b/i18n/zh.json @@ -0,0 +1,12 @@ +{ + "title": "捐赠加密货币", + "copyAddress": "复制地址", + "copyAddressSuccess": "复制成功", + "english": "English", + "chinese": "中文", + "tron": "波场", + "eth": "以太坊(EVM兼容网络)", + "bitcoin": "比特币", + "solana": "Solana", + "monero": "门罗币" +} diff --git a/icons/btc.png b/icons/btc.png new file mode 100644 index 0000000..6402b75 Binary files /dev/null and b/icons/btc.png differ diff --git a/icons/eth.png b/icons/eth.png new file mode 100644 index 0000000..c96f24c Binary files /dev/null and b/icons/eth.png differ diff --git a/icons/sol.png b/icons/sol.png new file mode 100644 index 0000000..414ef6a Binary files /dev/null and b/icons/sol.png differ diff --git a/icons/trx.png b/icons/trx.png new file mode 100644 index 0000000..c5d2b45 Binary files /dev/null and b/icons/trx.png differ diff --git a/icons/xmr.png b/icons/xmr.png new file mode 100644 index 0000000..3f570dc Binary files /dev/null and b/icons/xmr.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..374b32c --- /dev/null +++ b/index.html @@ -0,0 +1,43 @@ + + + + + + 加密货币捐赠 + + + + +
+
+

asadasd 捐赠加密货币

+
+
+ +
+ Blockchain Icon +
+
+
+ QR Code +

bc1pfx4a7n6fuyum4dv6rjmg9nsuj7t9wdepjjgsp67d6n8hsdp8w47qw228fy

+ +
+
+
+ + +
+

© 2024-now earthjasonlin. All rights reserved.

+
+
+ + + diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..83eb018 Binary files /dev/null and b/logo.png differ diff --git a/qr/btc-taproot.png b/qr/btc-taproot.png new file mode 100644 index 0000000..d810e90 Binary files /dev/null and b/qr/btc-taproot.png differ diff --git a/qr/eth.png b/qr/eth.png new file mode 100644 index 0000000..32da2c0 Binary files /dev/null and b/qr/eth.png differ diff --git a/qr/sol.png b/qr/sol.png new file mode 100644 index 0000000..c1b18ff Binary files /dev/null and b/qr/sol.png differ diff --git a/qr/trx.png b/qr/trx.png new file mode 100644 index 0000000..caadf5a Binary files /dev/null and b/qr/trx.png differ diff --git a/qr/xmr-1.png b/qr/xmr-1.png new file mode 100644 index 0000000..fcb32d8 Binary files /dev/null and b/qr/xmr-1.png differ diff --git a/script.js b/script.js new file mode 100644 index 0000000..370d89a --- /dev/null +++ b/script.js @@ -0,0 +1,74 @@ +let currentLang = 'zh'; +let data, i18n; + +document.addEventListener("DOMContentLoaded", () => { + loadData('data.json', loadBlockchainOptions); + changeLanguage(currentLang); + updateCopyrightYear() +}); + +function updateCopyrightYear() { + const currentYear = new Date().getFullYear(); + let copyrightText + if(currentYear > 2024) { + copyrightText = `© 2024-${currentYear} earthjasonlin. All rights reserved.`; + } else { + copyrightText = `© 2024 earthjasonlin. All rights reserved.`; + } + document.querySelector("footer p").innerHTML = copyrightText; +} + +function loadData(url, callback) { + fetch(url) + .then(response => response.json()) + .then(json => { + data = json; + callback(); + }) + .catch(error => console.error('Error loading JSON:', error)); +} + +function loadI18n(url, callback) { + fetch(url) + .then(response => response.json()) + .then(json => { + i18n = json; + callback(); + }) + .catch(error => console.error('Error loading i18n JSON:', error)); +} + +function loadBlockchainOptions() { + const blockchainSelect = document.getElementById("blockchain"); + blockchainSelect.innerHTML = ''; + + for (const key in data) { + const option = document.createElement("option"); + option.value = key; + option.textContent = i18n[key]; + blockchainSelect.appendChild(option); + } + updateDonationInfo(); +} + +function changeLanguage(lang) { + loadI18n(`i18n/${lang}.json`, () => { + document.getElementById("title").textContent = i18n.title; + document.getElementById("copyAddress").textContent = i18n.copyAddress; + loadBlockchainOptions(); + }); +} + +function updateDonationInfo() { + const blockchain = document.getElementById("blockchain").value; + document.getElementById("qr-code").src = data[blockchain].qr; + document.getElementById("address").textContent = data[blockchain].address; + document.getElementById("blockchain-icon").src = data[blockchain].icon; +} + +function copyAddress() { + const address = document.getElementById("address").textContent; + navigator.clipboard.writeText(address).then(() => { + alert(i18n.copyAddressSuccess); + }); +} diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..d4affc6 --- /dev/null +++ b/styles.css @@ -0,0 +1,131 @@ +body { + font-family: 'Roboto', sans-serif; + background-color: #f2f2f2; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; +} + +.container { + text-align: center; + padding: 20px; +} + +.card { + width: 300px; + background-color: #ffffff; + border-radius: 15px; + padding: 20px; + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1); + margin-bottom: 20px; + transition: transform 0.3s ease-in-out; + word-wrap: break-word; +} + +h1 { + font-size: 24px; + margin-bottom: 20px; +} + +.donation-card { + text-align: center; +} + +.select-wrapper { + display: flex; + align-items: center; + margin-bottom: 20px; +} + +select { + padding: 8px; + border-radius: 10px; + border: 1px solid #ddd; + font-size: 16px; + flex: 1; +} + +#icon-wrapper { + margin-left: 10px; +} + +#blockchain-icon { + width: 30px; + height: 30px; +} + +#donation-info img { + width: 150px; + height: 150px; + margin-bottom: 15px; +} + +#address { + font-size: 14px; + background-color: #f0f0f0; + padding: 10px; + border-radius: 10px; + margin-bottom: 10px; + word-break: break-all; +} + +button { + background-color: #4CAF50; + color: white; + padding: 10px 20px; + border: none; + border-radius: 10px; + cursor: pointer; + font-size: 16px; + transition: background-color 0.3s ease; +} + +button:hover { + background-color: #45a049; +} + +.language-list { + display: flex; + justify-content: center; + margin: 20px 0; + list-style: none; + padding: 0; +} + +.language-list li { + margin: 0 10px; + cursor: pointer; + font-size: 16px; + color: #333; + transition: color 0.3s ease; +} + +.language-list li:hover { + color: #4CAF50; +} + +.social-media { + display: flex; + justify-content: center; + margin-bottom: 20px; +} + +.social-media a { + margin: 0 10px; + transition: transform 0.3s ease; +} + +.social-media a:hover { + transform: scale(1.1); +} + +.social-icon { + width: 30px; +} + +footer { + font-size: 14px; + color: #777; +}