diff options
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/index.js | 9 |
1 files changed, 9 insertions, 0 deletions
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 @@ | |||
1470 | DOM.splitPhrase.val(cards.join("\r\n")); | 1470 | DOM.splitPhrase.val(cards.join("\r\n")); |
1471 | var triesPerSecond=10000000000; | 1471 | var triesPerSecond=10000000000; |
1472 | var hackTime=Math.pow(2,wordCount*10/3)/triesPerSecond; | 1472 | var hackTime=Math.pow(2,wordCount*10/3)/triesPerSecond; |
1473 | var displayRedText = false; | ||
1473 | if (hackTime<1) { | 1474 | if (hackTime<1) { |
1474 | hackTime="<1 second"; | 1475 | hackTime="<1 second"; |
1476 | displayRedText = true; | ||
1475 | } else if (hackTime<86400) { | 1477 | } else if (hackTime<86400) { |
1476 | hackTime=Math.floor(hackTime)+" seconds"; | 1478 | hackTime=Math.floor(hackTime)+" seconds"; |
1479 | displayRedText = true; | ||
1477 | } else if(hackTime<31557600) { | 1480 | } else if(hackTime<31557600) { |
1478 | hackTime=Math.floor(hackTime/86400)+" days"; | 1481 | hackTime=Math.floor(hackTime/86400)+" days"; |
1482 | displayRedText = true; | ||
1479 | } else { | 1483 | } else { |
1480 | hackTime=Math.floor(hackTime/31557600)+" years"; | 1484 | hackTime=Math.floor(hackTime/31557600)+" years"; |
1481 | } | 1485 | } |
1482 | DOM.phraseSplitWarn.html("Time to hack with only one card: "+hackTime); | 1486 | DOM.phraseSplitWarn.html("Time to hack with only one card: "+hackTime); |
1487 | if (displayRedText) { | ||
1488 | DOM.phraseSplitWarn.addClass("text-danger"); | ||
1489 | } else { | ||
1490 | DOM.phraseSplitWarn.removeClass("text-danger"); | ||
1491 | } | ||
1483 | } | 1492 | } |
1484 | 1493 | ||
1485 | function isUsingOwnEntropy() { | 1494 | function isUsingOwnEntropy() { |