diff --git a/business_cards/bitcoin.png b/business_cards/bitcoin.png new file mode 100644 index 00000000..1f63a7dd Binary files /dev/null and b/business_cards/bitcoin.png differ diff --git a/index.html b/index.html index 2b50949f..59a56b9a 100644 --- a/index.html +++ b/index.html @@ -9456,6 +9456,7 @@ #coinLogoImg { width: 100%; height: 100%; } .coinIcoin { width: 64px; height: 64px; padding: 10px; position: absolute; top: 272px; left: 48px; } +.cardCoinIcoin { width: 61px; height: 61px; padding: 10px; position: absolute; top: 43px; right: 8px; } #coinImg { width: 100%; height: 100%; } #main { position: relative; text-align: center; margin: 0px auto; width: 1005px; } @@ -9509,6 +9510,30 @@ #suppliedPrivateKey { width: 420px; } #papergenerate { margin-left: 10px; margin-right: 0px;} +#cardarea .artcard { position: relative; width: 332px; height: 209px; display: inline-block; } + +#cardarea .artcard .cardsvg { width: 332px; height: 209px; } + +#cardarea .artcard .card_qrcode_public { top: 28px; left: 34px; z-index: 100; margin: 0; float: none; display: block; position: absolute; background-color: #FFFFFF; + padding: 5px 5px 2px 5px; } + +#cardarea .artcard .card_btcaddress +{ + position: absolute; bottom: 110px; left: 122px; z-index: 100; font-size: 14px; background-color: transparent; + font-weight: 100; color: #000000; margin: 0; width: 108px; height: 32px; text-align: center; + word-wrap: break-word; font-family: Courier, monospace; + -ms-transform: rotate(-90deg); /* IE 9 */ + -webkit-transform: rotate(-90deg); /* Chrome, Safari, Opera */ + transform: rotate(-90deg); +} + +#cardarea .artcard .card_custom_text +{ + position: absolute; bottom: 10px; left: 18px; z-index: 100; font-size: 14px; background-color: transparent; + font-weight: 100; color: white; margin: 0; width: 294px; height: 34px; text-align: left; + word-wrap: break-word; +} + .displayNone { displa: none; } .redColor { color: red; } .1percentwidth { width: 1%; } @@ -9885,9 +9910,12 @@

-   + +   +   +
@@ -11390,57 +11418,41 @@

Release notes

// Verify that a self-entered key is valid, and compute the corresponding // public address, render the wallet. - testAndApplyVanityKey: function () { - var suppliedKey = document.getElementById('suppliedPrivateKey').value; + generate: function () { + var suppliedKey = document.getElementById('suppliedPublicAddress').value; suppliedKey = suppliedKey.trim(); // in case any spaces or whitespace got pasted in - document.getElementById('suppliedPrivateKey').value = suppliedKey; - if (!ninja.privateKey.isPrivateKey(suppliedKey)) { - alert(ninja.translator.get("detailalertnotvalidprivatekey")); - } else { - var computedPublicAddress = new Bitcoin.ECKey(suppliedKey).getBitcoinAddress(); - if (ninja.wallets.paperwallet.encrypt) { - document.getElementById("busyblock").className = "busy"; - ninja.privateKey.BIP38PrivateKeyToEncryptedKeyAsync(suppliedKey, - document.getElementById('paperpassphrase').value, false, function(encodedKey) { - document.getElementById("busyblock").className = ""; - ninja.wallets.paperwallet.showArtisticWallet(1, computedPublicAddress, encodedKey); - }); - } - else { - ninja.wallets.paperwallet.showArtisticWallet(1, computedPublicAddress, suppliedKey); - } + document.getElementById('suppliedPublicAddress').value = suppliedKey; + + var suppliedCustomText = document.getElementById('suppliedCustomText').value; + document.getElementById('cardkeyarea').innerHTML = ""; + + var keyValuePair = {}; + + var i = 0; + for(i=0;i<9;i++) + { + document.getElementById('cardkeyarea').innerHTML += ninja.wallets.cardwallet.templateArtisticHtml(i, suppliedCustomText); + document.getElementById("card_btcaddress" + i).innerHTML = suppliedKey; + keyValuePair["card_qrcode_public" + i] = suppliedKey; } + + ninja.qrCode.showQrCode(keyValuePair, 3.2); }, - templateArtisticHtml: function (i) { - var keyelement = 'btcprivwif'; + templateArtisticHtml: function (i, customText) { + var keyelement = 'card_btcprivwif'; var coinImgUrl = "logos/" + janin.selectedCurrency.name.toLowerCase() + ".png"; - var walletBackgroundUrl = "wallets/" + janin.selectedCurrency.name.toLowerCase() + ".png"; + var walletBackgroundUrl = "business_cards/" + janin.selectedCurrency.name.toLowerCase() + ".png"; var walletHtml = - "
currency_logo
" + - "" + - "
" + - "
" + - "
" + - "
" + - "
" + ninja.translator.get("paperwalletback") + "
" + + "
currency_logo
" + + "" + + "
" + + "
" + + "
" + customText + "
" + "
"; return walletHtml; }, - - showArtisticWallet: function (idPostFix, bitcoinAddress, privateKey) { - var keyValuePair = {}; - keyValuePair["qrcode_public" + idPostFix] = bitcoinAddress; - ninja.qrCode.showQrCode(keyValuePair, 3.5); - - var keyValuePair = {}; - keyValuePair["qrcode_private" + idPostFix] = privateKey; - ninja.qrCode.showQrCode(keyValuePair, 2.8); - - document.getElementById("btcaddress" + idPostFix).innerHTML = bitcoinAddress; - document.getElementById("btcprivwif" + idPostFix).innerHTML = privateKey; - }, }; diff --git a/src/index.html b/src/index.html index 2fbe923f..dbac5d2e 100644 --- a/src/index.html +++ b/src/index.html @@ -350,9 +350,12 @@

-   + +   +   +
diff --git a/src/main.css b/src/main.css index 658c7915..8a39683d 100644 --- a/src/main.css +++ b/src/main.css @@ -151,6 +151,7 @@ h1 { margin: 0px; height: 91px; } #coinLogoImg { width: 100%; height: 100%; } .coinIcoin { width: 64px; height: 64px; padding: 10px; position: absolute; top: 272px; left: 48px; } +.cardCoinIcoin { width: 61px; height: 61px; padding: 10px; position: absolute; top: 43px; right: 8px; } #coinImg { width: 100%; height: 100%; } #main { position: relative; text-align: center; margin: 0px auto; width: 1005px; } @@ -204,6 +205,30 @@ h1 { margin: 0px; height: 91px; } #suppliedPrivateKey { width: 420px; } #papergenerate { margin-left: 10px; margin-right: 0px;} +#cardarea .artcard { position: relative; width: 332px; height: 209px; display: inline-block; } + +#cardarea .artcard .cardsvg { width: 332px; height: 209px; } + +#cardarea .artcard .card_qrcode_public { top: 28px; left: 34px; z-index: 100; margin: 0; float: none; display: block; position: absolute; background-color: #FFFFFF; + padding: 5px 5px 2px 5px; } + +#cardarea .artcard .card_btcaddress +{ + position: absolute; bottom: 110px; left: 122px; z-index: 100; font-size: 14px; background-color: transparent; + font-weight: 100; color: #000000; margin: 0; width: 108px; height: 32px; text-align: center; + word-wrap: break-word; font-family: Courier, monospace; + -ms-transform: rotate(-90deg); /* IE 9 */ + -webkit-transform: rotate(-90deg); /* Chrome, Safari, Opera */ + transform: rotate(-90deg); +} + +#cardarea .artcard .card_custom_text +{ + position: absolute; bottom: 10px; left: 18px; z-index: 100; font-size: 14px; background-color: transparent; + font-weight: 100; color: white; margin: 0; width: 294px; height: 34px; text-align: left; + word-wrap: break-word; +} + .displayNone { displa: none; } .redColor { color: red; } .1percentwidth { width: 1%; } diff --git a/src/ninja.cardwallet.js b/src/ninja.cardwallet.js index 6bcfe837..3c060437 100644 --- a/src/ninja.cardwallet.js +++ b/src/ninja.cardwallet.js @@ -9,55 +9,39 @@ ninja.wallets.cardwallet = { // Verify that a self-entered key is valid, and compute the corresponding // public address, render the wallet. - testAndApplyVanityKey: function () { - var suppliedKey = document.getElementById('suppliedPrivateKey').value; + generate: function () { + var suppliedKey = document.getElementById('suppliedPublicAddress').value; suppliedKey = suppliedKey.trim(); // in case any spaces or whitespace got pasted in - document.getElementById('suppliedPrivateKey').value = suppliedKey; - if (!ninja.privateKey.isPrivateKey(suppliedKey)) { - alert(ninja.translator.get("detailalertnotvalidprivatekey")); - } else { - var computedPublicAddress = new Bitcoin.ECKey(suppliedKey).getBitcoinAddress(); - if (ninja.wallets.paperwallet.encrypt) { - document.getElementById("busyblock").className = "busy"; - ninja.privateKey.BIP38PrivateKeyToEncryptedKeyAsync(suppliedKey, - document.getElementById('paperpassphrase').value, false, function(encodedKey) { - document.getElementById("busyblock").className = ""; - ninja.wallets.paperwallet.showArtisticWallet(1, computedPublicAddress, encodedKey); - }); - } - else { - ninja.wallets.paperwallet.showArtisticWallet(1, computedPublicAddress, suppliedKey); - } + document.getElementById('suppliedPublicAddress').value = suppliedKey; + + var suppliedCustomText = document.getElementById('suppliedCustomText').value; + document.getElementById('cardkeyarea').innerHTML = ""; + + var keyValuePair = {}; + + var i = 0; + for(i=0;i<9;i++) + { + document.getElementById('cardkeyarea').innerHTML += ninja.wallets.cardwallet.templateArtisticHtml(i, suppliedCustomText); + document.getElementById("card_btcaddress" + i).innerHTML = suppliedKey; + keyValuePair["card_qrcode_public" + i] = suppliedKey; } + + ninja.qrCode.showQrCode(keyValuePair, 3.2); }, - templateArtisticHtml: function (i) { - var keyelement = 'btcprivwif'; + templateArtisticHtml: function (i, customText) { + var keyelement = 'card_btcprivwif'; var coinImgUrl = "logos/" + janin.selectedCurrency.name.toLowerCase() + ".png"; - var walletBackgroundUrl = "wallets/" + janin.selectedCurrency.name.toLowerCase() + ".png"; + var walletBackgroundUrl = "business_cards/" + janin.selectedCurrency.name.toLowerCase() + ".png"; var walletHtml = - "
currency_logo
" + - "" + - "
" + - "
" + - "
" + - "
" + - "
" + ninja.translator.get("paperwalletback") + "
" + + "
currency_logo
" + + "" + + "
" + + "
" + + "
" + customText + "
" + "
"; return walletHtml; }, - - showArtisticWallet: function (idPostFix, bitcoinAddress, privateKey) { - var keyValuePair = {}; - keyValuePair["qrcode_public" + idPostFix] = bitcoinAddress; - ninja.qrCode.showQrCode(keyValuePair, 3.5); - - var keyValuePair = {}; - keyValuePair["qrcode_private" + idPostFix] = privateKey; - ninja.qrCode.showQrCode(keyValuePair, 2.8); - - document.getElementById("btcaddress" + idPostFix).innerHTML = bitcoinAddress; - document.getElementById("btcprivwif" + idPostFix).innerHTML = privateKey; - }, };