Skip to content

Instantly share code, notes, and snippets.

@bne
Forked from mitchellrj/Dogeoverlay.js
Last active December 30, 2015 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bne/7875358 to your computer and use it in GitHub Desktop.
Save bne/7875358 to your computer and use it in GitHub Desktop.
$(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;' +
'position:absolute; ' +
'z-index:10000; ' +
'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