7 wrap = document.createElement('div'),
8 bar = wrap.appendChild(document.createElement('div')),
10 cursor = document.createElement('div'),
11 // If the user specified that the visibility is hidden, then we
12 // start at the first pass ... otherwise we just do the
14 pass = ($(document.body).css('visibility') == 'visible') ? 1 : 0,
15 height = $(window).height(),
16 width = $(window).width(),
18 // this makes the loading of the screen proportional to the real-estate of the window.
19 // it helps keep the cool sequence there while not making it waste too much time.
20 rounds = (height * width / 165000),
21 column = width, row = height - character.height;
22 // TODO: externalize this
24 wrap.setAttribute('style', 'z-index:9999999;background:#000084;position:fixed;bottom:0;right:0;height:100%;width:100%');
25 bar.setAttribute('style', 'color:#fff;font-weight:bold;float:right;background:#000084;height:20px;margin-top:-20px;width:100%');
26 cursor.setAttribute('style', 'z-index:9999999;color:#fff;font-weight:bold;position:fixed;bottom:0;right:0');
28 cursor.innerHTML = bar.innerHTML = '▄';
30 // only inject the wrap if the pass is 0
32 document.body.appendChild(wrap);
33 document.body.style.visibility='visible';
35 document.body.appendChild(cursor);
37 character.height *= 4;
40 var ival = setInterval(function(){
41 for(var m = 0; m < rounds; m++) {
42 column -= character.width;
46 row -= character.height;
50 row = height - character.height;
53 document.body.removeChild(cursor);
56 wrap.parentNode.removeChild(wrap);
57 document.body.appendChild(cursor);
59 character.height *= 4;
64 bar.style.width = column + "px";
65 wrap.style.height = row + "px";
67 cursor.style.right = column + "px";
68 cursor.style.bottom = row + "px";