Skip to content

Commit 98ba08a

Browse files
committed
Add loader
1 parent a98c5f4 commit 98ba08a

3 files changed

Lines changed: 64 additions & 18 deletions

File tree

‎index.html‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@
5959
</head>
6060
<body>
6161

62+
<div id="loader" class="loading-container">
63+
<div class="loader"></div>
64+
65+
<p>
66+
67+
Loading...
68+
</p>
69+
</div>
70+
6271

6372

6473
<main>
@@ -1784,6 +1793,12 @@ <h1>
17841793
<script src="static/js/baraja.js"></script>
17851794

17861795
<script>
1796+
document.onload = stopLoading();
1797+
function stopLoading(){
1798+
loader = document.getElementById('loader');
1799+
loader.style.display = 'none';
1800+
return;
1801+
}
17871802
$(function() {
17881803
//Can change this options
17891804
// wXXX XXX is the screen resolution

‎static/js/terminal.js‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
//$("#onlineTerminal").focus();
128128
},500);
129129
}
130-
ga( 'send', 'event', 'toys', 'terminal', 'open');
130+
//ga( 'send', 'event', 'toys', 'terminal', 'open');
131131

132132
if( typeof game !== 'undefined' && typeof game.paused !== 'undefined' ) {
133133
GameCycle.disableGameControls();
@@ -282,7 +282,7 @@
282282
if ((e.which == 65) && (kc_count == 9)) { kc_count++; }
283283
if (kc_count == 10) {
284284
$('main').append($('<img src="static/images/miley1.png" onload="$(this).animate({ left: $(window).width()+150 }, 2000, function() { $(this).remove(); })" style="position:absolute;left:-150px;top:'+($(window).scrollTop()+100)+'px;"/>'));
285-
ga( 'send', 'event', 'toys', 'terminal', 'upupdowndownleftrightleftrightba');
285+
//ga( 'send', 'event', 'toys', 'terminal', 'upupdowndownleftrightleftrightba');
286286
};
287287
if (resetkc) kc_count = 0;
288288
});
@@ -295,12 +295,12 @@
295295
if (func_options == "clear") {
296296
$('.dogeText').remove();
297297
} else {
298-
av_doge_texts = Array('wow', 'much code', 'much JS', 'so JS', 'so code', 'very JS', 'very programmer', 'd0g3 l337 h4x0r', 'wow', 'wow');
298+
av_doge_texts = Array('wow', 'much code', 'much CodeCell', 'so CodeCell', 'so code', 'very CodeCell', 'very programmer', 'd0g3 l337 h4x0r', 'wow', 'wow');
299299
av_doge_colors = Array('red', 'blue', 'yellow', 'pink', 'orange', 'green', 'purple', 'cyan');
300-
$("body").append('<div style="font-family:\'Comic Sans MS\', cursive, sans-serif;font-size:70px;line-height:44px;position:absolute;top:'+(Math.floor(Math.random()*$(window).height()+$(document).scrollTop()-300)+100)+'px;left:'+(Math.floor(Math.random()*$(window).width()-400)+100)+'px;color:'+av_doge_colors[Math.floor(Math.random()*av_doge_colors.length)]+'" class="dogeText">'+av_doge_texts[Math.floor(Math.random()*av_doge_texts.length)]+'</div>');
300+
$("body").append('<div style="font-family:\'Comic Sans MS\', cursive, sans-serif;font-size:70px;line-height:44px;position:absolute;z-index:300;top:'+(Math.floor(Math.random()*$(window).height()+$(document).scrollTop()-300)+100)+'px;left:'+(Math.floor(Math.random()*$(window).width()-400)+100)+'px;color:'+av_doge_colors[Math.floor(Math.random()*av_doge_colors.length)]+'" class="dogeText">'+av_doge_texts[Math.floor(Math.random()*av_doge_texts.length)]+'</div>');
301301
}
302302
$("#onlineTerminal").html($("#onlineTerminal").html().trim()+'<span class="response">wow very random</span>'+breakLine()+breakLine());
303-
ga( 'send', 'event', 'toys', 'terminal', 'doge');
303+
//ga( 'send', 'event', 'toys', 'terminal', 'doge');
304304
return null;
305305
}
306306
function dancer(func_options) {
@@ -311,7 +311,7 @@
311311
$("body").append('<img style="position:absolute;top:'+Math.floor(Math.random()*$(window).height()+$(document).scrollTop())+'px;left:'+Math.floor(Math.random()*$(window).width())+'px;" src="static/images/dancers/'+(Math.floor(Math.random()*8)+1)+'.gif" alt="" class="gifDancers"/>');
312312
}
313313
$("#onlineTerminal").html($("#onlineTerminal").html().trim()+'<span class="response">I don\'t feel like dancing, no sir, no dancing today.</span>'+breakLine()+breakLine());
314-
ga( 'send', 'event', 'toys', 'terminal', 'dancer');
314+
//ga( 'send', 'event', 'toys', 'terminal', 'dancer');
315315
}
316316
function help(customFunctionName) {
317317
if (typeof customFunctionName === "undefined") {
@@ -350,7 +350,7 @@
350350
if (customFunctionName == 'weather') response = 'Shows the weather forecast for the two days of JSConf 2014. It will be available only 5 days before the event.';
351351
}
352352
$("#onlineTerminal").html($("#onlineTerminal").html().trim()+'<span class="response">'+response+'</span>'+breakLine()+breakLine());
353-
ga( 'send', 'event', 'toys', 'terminal', 'help');
353+
////ga( 'send', 'event', 'toys', 'terminal', 'help');
354354
}
355355
function planetarium() {
356356
$(".planetarium").click();
@@ -384,12 +384,12 @@
384384
function comicSans() {
385385
$('*').css({"font-family": '"Comic Sans MS", cursive, sans-serif'})
386386
$("#onlineTerminal").html($("#onlineTerminal").html().trim()+'<span class="response">But... WHY?</span>'+breakLine()+breakLine());
387-
ga( 'send', 'event', 'toys', 'terminal', 'comicSans');
387+
//ga( 'send', 'event', 'toys', 'terminal', 'comicSans');
388388
}
389389
function helvetica() {
390390
$('*').css({"font-family": '"Helvetica", cursive, sans-serif'})
391391
$("#onlineTerminal").html($("#onlineTerminal").html().trim()+'<span class="response">I used Helvetica before it was cool.</span>'+breakLine()+breakLine());
392-
ga( 'send', 'event', 'toys', 'terminal', 'helvetica');
392+
//ga( 'send', 'event', 'toys', 'terminal', 'helvetica');
393393
}
394394
function ieLove(func_options) {
395395
if(typeof(func_options) === 'undefined') func_options = '';
@@ -433,7 +433,7 @@
433433
}
434434
}
435435
$("#onlineTerminal").html($("#onlineTerminal").html().trim()+'<span class="response">Oh... IE, we love you anyway.</span>'+breakLine()+breakLine());
436-
ga( 'send', 'event', 'toys', 'terminal', 'ieLove');
436+
//ga( 'send', 'event', 'toys', 'terminal', 'ieLove');
437437
}
438438
function weather() {
439439
var fiveDaysBeforeJSConf = new Date(2014, 11, 24);
@@ -462,7 +462,7 @@
462462
setEndOfContenteditable(document.getElementById("onlineTerminal"));
463463
});
464464
//}
465-
ga( 'send', 'event', 'toys', 'terminal', 'weather');
465+
//ga( 'send', 'event', 'toys', 'terminal', 'weather');
466466
}
467467
function exit() {
468468
$('.terminalHandle').click();
@@ -484,23 +484,23 @@
484484
var loremipsum=["Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna."];var whitespaceAtFrontRe=/^[\s\xa0]+/;var whitespaceAtEndRe=/[\s\xa0]+$/;var punctationRe=/([:!?\.])$/;var punctationFrontRe=/^([:!?\.]\s+)/;var capatializedRe=/^[^\wÄÖÜÀÀÁÈÉÇ]*[A-ZÄÖÜÀÀÁÈÉÇ]/;var simpleExpressionRe=/^[\(\[]?.[:\.\)\]]?$/;var singleWordRe=/^\w*$/;var charAtFrontRe=/^[a-z]/i;var headlineRe=/^H[1-3]$/i;var lastTextHadPunctation=false;var foundMain=false;var idx=0;var getLoremIpsum=function(e,t,n){if(!foundMain&&t){idx=0;foundMain=true}var r=loremipsum[idx];var i=r.length;while(i<e){if(++idx>=loremipsum.length)idx=0;r+=" "+loremipsum[idx];i=r.length}if(i>e){var s=r.substring(0,e);var o=r.substring(e).replace(/\s.*$/,"");if(!n&&(o.length<3||singleWordRe.test(s)&&charAtFrontRe.test(r.charAt(e)))){r=s+o}else{r=s.replace(/,?\s\w*$/,"")}if(r.length>3)r=r.replace(/\s\w$/,"")}r=r.replace(/\s+$/,"");if(++idx>=loremipsum.length)idx=0;return r};var replaceText=function(e,t){var n=e.nodeValue;if(!n)return;var r=n.length;n=n.replace(whitespaceAtFrontRe,"");var i=n.length!=r;r=n.length;n=n.replace(whitespaceAtEndRe,"");var s=n.length!=r;r=n.length;if(r>0&&!simpleExpressionRe.test(n)){var o=getLoremIpsum(r,t,singleWordRe.test(n));var u=punctationRe.exec(n);if(u){o=o.replace(/[,\.]+$/,"").replace(/\s+$/,"")+u[1]}else{o=o.replace(/,\s*$/,"")}var a=o.charAt(0);var f=o.substring(1);o=(lastTextHadPunctation||capatializedRe.test(n)?a.toUpperCase():a.toLowerCase())+f;u=punctationFrontRe.exec(n);if(u)o=u[1]+o;lastTextHadPunctation=punctationRe.test(o);if(i)o=" "+o;if(s)o+=" ";e.nodeValue=o}};var scanElement=function(e,t){var n=e.firstChild;while(n){var r=n.nodeType;var i=n.nextSibling;if(r==1){var s=n.nodeName;if(s!="SCRIPT"&&s!="STYLE"&&s!="EMBED"){scanElement(n,t||headlineRe.test(s))}}else if(r==3){replaceText(n,t)}n=i}};var b=getDocumentBody();if(b){scanElement(b,false)}
485485

486486
$("#onlineTerminal").html($("#onlineTerminal").html().trim()+'<span class="response">Lorem what?.</span>'+breakLine()+breakLine());
487-
ga( 'send', 'event', 'toys', 'terminal', 'lipsum');
487+
//ga( 'send', 'event', 'toys', 'terminal', 'lipsum');
488488
}
489489
function fbShare() {
490490
var winWidth = 520; var winHeight = 350;
491491
var winTop = ((screen.height-winHeight) / 2) - (winHeight / 2);
492492
var winLeft = ((screen.width-winWidth) / 2) - (winWidth / 2);
493493
window.open('https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fwww.facebook.com%2Fkjscecodecell%2F', 'sharer', 'top='+winTop+', left='+winLeft+', toolbar=0, status=0, width='+winWidth+', height='+winHeight, true);
494494
$("#onlineTerminal").html($("#onlineTerminal").html().trim()+'<span class="response">Please allow popups in your browser</span>'+breakLine()+breakLine());
495-
ga( 'send', 'event', 'toys', 'terminal', 'fbShare');
495+
//ga( 'send', 'event', 'toys', 'terminal', 'fbShare');
496496
}
497497
function twShare() {
498498
var winWidth = 605; var winHeight = 428;
499499
var winTop = ((screen.height-winHeight) / 2) - (winHeight / 2);
500500
var winLeft = ((screen.width-winWidth) / 2) - (winWidth / 2);
501501
window.open("https://twitter.com/home?status=Checkout%20KJSCE%20CodeCell's%20new%20awesome%20website%20http%3A%2F%2Fkjscecodecell.com%2F", 'sharer', 'top='+winTop+',left='+winLeft+',toolbar=0,status=0,width='+winWidth+',height='+winHeight, true);
502502
$("#onlineTerminal").html($("#onlineTerminal").html().trim()+'<span class="response">Please allow popups in your browser</span>'+breakLine()+breakLine());
503-
ga( 'send', 'event', 'toys', 'terminal', 'twShare');
503+
//ga( 'send', 'event', 'toys', 'terminal', 'twShare');
504504
}
505505
function latestTweets() {
506506
$("#onlineTerminal").html($("#onlineTerminal").html().trim()+'<span class="response">Getting the latest tweets from @jsconfar</span>'+breakLine()+breakLine());
@@ -514,7 +514,7 @@
514514
}
515515
setEndOfContenteditable(document.getElementById("onlineTerminal"));
516516
});
517-
ga( 'send', 'event', 'toys', 'terminal', 'latestTweets');
517+
//ga( 'send', 'event', 'toys', 'terminal', 'latestTweets');
518518
}
519519
function likeasir(func_options) {
520520
if (typeof func_options === "undefined") func_options = '';
@@ -526,7 +526,7 @@
526526
} else {
527527
$("#onlineTerminal").html($("#onlineTerminal").html().trim()+'<span class="response">Too fancy. *sigh*</span>'+breakLine()+breakLine());
528528
}
529-
ga( 'send', 'event', 'toys', 'terminal', 'likeasir');
529+
//ga( 'send', 'event', 'toys', 'terminal', 'likeasir');
530530
}
531531
function shades(func_options) {
532532
if (typeof func_options === "undefined") func_options = '';
@@ -538,7 +538,7 @@
538538
} else {
539539
$("#onlineTerminal").html($("#onlineTerminal").html().trim()+'<span class="response">I was feeling like a total douche. *sigh*</span>'+breakLine()+breakLine());
540540
}
541-
ga( 'send', 'event', 'toys', 'terminal', 'shades');
541+
//ga( 'send', 'event', 'toys', 'terminal', 'shades');
542542
}
543543
function tryToclear(func,arg){
544544
try{
@@ -558,7 +558,7 @@
558558
clear();
559559
$("#onlineTerminal").html($("#onlineTerminal").html().trim()+'<span class="response">Phew.. that was rough. *sigh*</span>'+breakLine()+breakLine());
560560

561-
ga( 'send', 'event', 'toys', 'terminal', 'reset');
561+
//ga( 'send', 'event', 'toys', 'terminal', 'reset');
562562
}
563563
// Insanity ends here
564564
}

‎static/styles/styles.css‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10322,3 +10322,34 @@ ul.baraja-container li {
1032210322
width: 100%;
1032310323
border-radius: 10px 10px 0 0;
1032410324
}
10325+
10326+
/*Loader styles*/
10327+
10328+
.loader {
10329+
border: 16px solid #f3f3f3; /* Light grey */
10330+
border-top: 16px solid #3498db; /* Blue */
10331+
border-radius: 50%;
10332+
width: 120px;
10333+
height: 120px;
10334+
animation: spin 2s linear infinite;
10335+
margin: 1%;
10336+
}
10337+
10338+
@keyframes spin {
10339+
0% { transform: rotate(0deg); }
10340+
100% { transform: rotate(360deg); }
10341+
}
10342+
.loading-container{
10343+
background: white;
10344+
display: flex;
10345+
10346+
flex-direction: column;
10347+
align-items: center;
10348+
justify-content: center;
10349+
position: fixed;
10350+
top: 0;
10351+
bottom: 0;
10352+
right: 0;
10353+
left: 0;
10354+
z-index: 10000;
10355+
}

0 commit comments

Comments
 (0)