add easter egg dogecoin

This commit is contained in:
Michael Muré 2014-03-31 22:34:35 +02:00
parent 8c516c4651
commit abf4dc392b
6 changed files with 193 additions and 2 deletions

View file

@ -23,6 +23,7 @@ module.exports = function (grunt) {
{ token: "//cryptojs.blockmodes.js", file: "./src/cryptojs.blockmodes.js" },
{ token: "//cryptojs.ripemd160.js", file: "./src/cryptojs.ripemd160.js" },
{ token: "//crypto-scrypt.js", file: "./src/crypto-scrypt.js" },
{ token: "//doge.js", file: "./src/doge.js" },
{ token: "//ellipticcurve.js", file: "./src/ellipticcurve.js" },
{ token: "//ninja.key.js", file: "./src/ninja.key.js" },
{ token: "//ninja.misc.js", file: "./src/ninja.misc.js" },

View file

@ -6024,6 +6024,7 @@ body { font-family: Arial; background-image: url('images/diamonds.png'); }
#currency { display: none; }
#paperarea .artwallet .btcaddress, #paperarea .artwallet .btcprivwif { z-index: 999; }
.paperWalletText { z-index: 999;}
.dogeTag { display: none; }
}
</style>
</head>
@ -6390,6 +6391,85 @@ body { font-family: Arial; background-image: url('images/diamonds.png'); }
</div>
</div>
<script type="text/javascript">
(function (window) {
var muchIndex = 0;
var wowLength = 0;
var manyWords = null;
var suchInterval = null;
var muchPlay = false;
var wowElement = document.createElement('div');
var suchColors = [
'#FF0000',
'#00FF00',
'#0000FF',
];
function veryRandom(val) {
return Math.floor((Math.random() * val));
}
function placeWord(word) {
var muchWidth = window.innerWidth - 200; //Very random offset
var manyHeight = window.innerHeight - 26; //Such fontsize based offset
wowElement.textContent = word;
wowElement.style.left = veryRandom(muchWidth) + 'px';
wowElement.style.top = veryRandom(manyHeight) + 'px';
wowElement.style.color = suchColors[veryRandom(suchColors.length)];
}
function muchWords() {
muchPlay = true;
suchInterval = setInterval(function () {
if(muchIndex === wowLength - 1) {
muchIndex = 0;
} else {
muchIndex++;
}
placeWord(manyWords[muchIndex]);
}, 6000);
}
var Doge = function (words) {
if (typeof(words) !== 'object' || words.length === undefined) {
return console.error('Wow. Words is not array. Much Error.');
}
if (words.length < 1) {
return console.error('Much dumb. Very fail. No words in array. Wow');
}
wowLength = words.length;
manyWords = words;
wowElement.className = 'dogeTag';
wowElement.style.position = 'fixed';
wowElement.style.fontSize = '26px';
wowElement.style.fontFamily = '"Comic Sans MS"';
wowElement.style.zIndex = 10000001;
document.body.appendChild(wowElement);
muchWords();
};
Doge.prototype.stop = function () {
if (muchPlay) {
muchPlay = false;
clearInterval(suchInterval);
}
if(wowElement != null)
wowElement.parentNode.removeChild(wowElement);
};
window.Doge = Doge;
}(window));
</script>
<script type="text/javascript">
var janin = {};
@ -6446,6 +6526,21 @@ janin.currency = {
document.getElementById("vanityaddress").innerHTML = "";
document.getElementById("vanitypublickeyhex").innerHTML = "";
document.getElementById("vanityprivatekeywif").innerHTML = "";
// easter egg doge ;)
if(janin.currency.name() == "Dogecoin")
{
janin.doge = new Doge(['wow', 'so wallet', 'such random', 'very pretty', 'much design']);
return;
}
if(janin.doge != null)
{
janin.doge.stop();
janin.doge = null;
}
},
};
@ -6832,8 +6927,7 @@ ninja.seeder = {
// number of mouse movements to wait for
seedLimit: (function () {
var num = Crypto.util.randomBytes(12)[11];
//return 200 + Math.floor(num);
return 10;
return 200 + Math.floor(num);
})(),
seedCount: 0, // counter

77
src/doge.js Normal file
View file

@ -0,0 +1,77 @@
(function (window) {
var muchIndex = 0;
var wowLength = 0;
var manyWords = null;
var suchInterval = null;
var muchPlay = false;
var wowElement = document.createElement('div');
var suchColors = [
'#FF0000',
'#00FF00',
'#0000FF',
];
function veryRandom(val) {
return Math.floor((Math.random() * val));
}
function placeWord(word) {
var muchWidth = window.innerWidth - 200; //Very random offset
var manyHeight = window.innerHeight - 26; //Such fontsize based offset
wowElement.textContent = word;
wowElement.style.left = veryRandom(muchWidth) + 'px';
wowElement.style.top = veryRandom(manyHeight) + 'px';
wowElement.style.color = suchColors[veryRandom(suchColors.length)];
}
function muchWords() {
muchPlay = true;
suchInterval = setInterval(function () {
if(muchIndex === wowLength - 1) {
muchIndex = 0;
} else {
muchIndex++;
}
placeWord(manyWords[muchIndex]);
}, 6000);
}
var Doge = function (words) {
if (typeof(words) !== 'object' || words.length === undefined) {
return console.error('Wow. Words is not array. Much Error.');
}
if (words.length < 1) {
return console.error('Much dumb. Very fail. No words in array. Wow');
}
wowLength = words.length;
manyWords = words;
wowElement.className = 'dogeTag';
wowElement.style.position = 'fixed';
wowElement.style.fontSize = '26px';
wowElement.style.fontFamily = '"Comic Sans MS"';
wowElement.style.zIndex = 10000001;
document.body.appendChild(wowElement);
muchWords();
};
Doge.prototype.stop = function () {
if (muchPlay) {
muchPlay = false;
clearInterval(suchInterval);
}
if(wowElement != null)
wowElement.parentNode.removeChild(wowElement);
};
window.Doge = Doge;
}(window));

View file

@ -474,6 +474,9 @@
</div>
</div>
<script type="text/javascript">
//doge.js
</script>
<script type="text/javascript">
//janin.currency.js
</script>

View file

@ -53,6 +53,21 @@ janin.currency = {
document.getElementById("vanityaddress").innerHTML = "";
document.getElementById("vanitypublickeyhex").innerHTML = "";
document.getElementById("vanityprivatekeywif").innerHTML = "";
// easter egg doge ;)
if(janin.currency.name() == "Dogecoin")
{
janin.doge = new Doge(['wow', 'so wallet', 'such random', 'very pretty', 'much design']);
return;
}
if(janin.doge != null)
{
janin.doge.stop();
janin.doge = null;
}
},
};

View file

@ -272,4 +272,5 @@ body { font-family: Arial; background-image: url('images/diamonds.png'); }
#currency { display: none; }
#paperarea .artwallet .btcaddress, #paperarea .artwallet .btcprivwif { z-index: 999; }
.paperWalletText { z-index: 999;}
.dogeTag { display: none; }
}