X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2Fjs%2Findex.js;h=807230b2130ef6456f01f70d7dc413097663684a;hb=ea2cb91a49d57ee72674223eb3672fcb9a41130c;hp=03a829677e3766f64f60b3d1c8225811d9fc7b50;hpb=a04946e23e479fd09f89eb2b2f541c38ebd62799;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git diff --git a/src/js/index.js b/src/js/index.js index 03a8296..807230b 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -1470,16 +1470,25 @@ DOM.splitPhrase.val(cards.join("\r\n")); var triesPerSecond=10000000000; var hackTime=Math.pow(2,wordCount*10/3)/triesPerSecond; + var displayRedText = false; if (hackTime<1) { hackTime="<1 second"; + displayRedText = true; } else if (hackTime<86400) { hackTime=Math.floor(hackTime)+" seconds"; + displayRedText = true; } else if(hackTime<31557600) { hackTime=Math.floor(hackTime/86400)+" days"; + displayRedText = true; } else { hackTime=Math.floor(hackTime/31557600)+" years"; } DOM.phraseSplitWarn.html("Time to hack with only one card: "+hackTime); + if (displayRedText) { + DOM.phraseSplitWarn.addClass("text-danger"); + } else { + DOM.phraseSplitWarn.removeClass("text-danger"); + } } function isUsingOwnEntropy() {