Skip to content

Instantly share code, notes, and snippets.

@mitchellrj
Created December 9, 2013 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mitchellrj/7875156 to your computer and use it in GitHub Desktop.
Save mitchellrj/7875156 to your computer and use it in GitHub Desktop.
Dogeoverlay
$(document).ready(function () {
"use strict";
var items = Array(
'such currency',
'wow',
'amaze',
'much coin',
'awesome',
'so crypto',
'how money',
'plz mine',
'v rich',
'many coins',
'such profit',
'WOW'
);
function addItem() {
var docHeight = $(document).innerHeight(),
docWidth = $(document).innerWidth(),
text = items[Math.floor(Math.random()*items.length)],
textCol = '#'+Math.floor(Math.random()*16777215).toString(16),
textSize = Math.floor((Math.random()*48)+12),
yPos = Math.floor((Math.random()*docHeight)),
xPos = Math.floor((Math.random()*docWidth));
$('<div class="bubble" style="' +
'color:' + textCol + ';' +
'left:' + xPos + 'px;' +
'top:' + yPos + 'px;' +
'font-size:' + textSize + 'px;' +
'">' + text + '</div>')
.appendTo("body")
.fadeIn('fast')
.delay(2000)
.fadeOut('fast');
$('.bubble:not(:last-child)').remove();
}
setInterval(addItem,3000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment