From 5ed57679032cb5b4ef9ea0fe458e562f3cd5739f Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Wed, 2 Oct 2013 17:24:40 +0200 Subject: [PATCH] Better loading feedback --- css/main.css | 7 +++ favicon.ico => img/favicon.ico | Bin favicon.png => img/favicon.png | Bin index.html | 8 ++- js/libs/spin.min.js | 1 + js/main.js | 98 ++++++++++++++++++++++++++------- 6 files changed, 90 insertions(+), 24 deletions(-) rename favicon.ico => img/favicon.ico (100%) rename favicon.png => img/favicon.png (100%) create mode 100644 js/libs/spin.min.js diff --git a/css/main.css b/css/main.css index e69de29..569ca6a 100644 --- a/css/main.css +++ b/css/main.css @@ -0,0 +1,7 @@ +#preloader { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} \ No newline at end of file diff --git a/favicon.ico b/img/favicon.ico similarity index 100% rename from favicon.ico rename to img/favicon.ico diff --git a/favicon.png b/img/favicon.png similarity index 100% rename from favicon.png rename to img/favicon.png diff --git a/index.html b/index.html index 0c9c2fc..589f095 100644 --- a/index.html +++ b/index.html @@ -14,11 +14,13 @@ + -

Hi, we found the following Doodle3D WiFi boxes near you:

- +

+ +
+ \ No newline at end of file diff --git a/js/libs/spin.min.js b/js/libs/spin.min.js new file mode 100644 index 0000000..d428391 --- /dev/null +++ b/js/libs/spin.min.js @@ -0,0 +1 @@ +(function(t,e){if(typeof exports=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else t.Spinner=e()})(this,function(){"use strict";var t=["webkit","Moz","ms","O"],e={},i;function o(t,e){var i=document.createElement(t||"div"),o;for(o in e)i[o]=e[o];return i}function n(t){for(var e=1,i=arguments.length;e>1):parseInt(n.left,10)+s)+"px",top:(n.top=="auto"?l.y-a.y+(t.offsetHeight>>1):parseInt(n.top,10)+s)+"px"})}r.setAttribute("role","progressbar");e.lines(r,e.opts);if(!i){var d=0,p=(n.lines-1)*(1-n.direction)/2,c,h=n.fps,m=h/n.speed,y=(1-n.opacity)/(m*n.trail/100),g=m/n.lines;(function v(){d++;for(var t=0;t>1)+"px"})}for(;r',e)}r.addRule(".spin-vml","behavior:url(#default#VML)");c.prototype.lines=function(e,i){var o=i.length+i.width,r=2*o;function s(){return f(t("group",{coordsize:r+" "+r,coordorigin:-o+" "+-o}),{width:r,height:r})}var a=-(i.width+i.length)*2+"px",l=f(s(),{position:"absolute",top:a,left:a}),u;function p(e,r,a){n(l,n(f(s(),{rotation:360/i.lines*e+"deg",left:~~r}),n(f(t("roundrect",{arcsize:i.corners}),{width:o,height:i.width,left:i.radius,top:-i.width>>1,filter:a}),t("fill",{color:d(i.color,e),opacity:i.opacity}),t("stroke",{opacity:0}))))}if(i.shadow)for(u=1;u<=i.lines;u++)p(u,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(u=1;u<=i.lines;u++)p(u);return n(e,l)};c.prototype.opacity=function(t,e,i,o){var n=t.firstChild;o=o.shadow&&o.lines||0;if(n&&e+o"+box.wifiboxid+""); } + numBoxesChecking--; + updateIntro(); } + }).fail(function() { + numBoxesChecking--; + updateIntro(); }); } function boxIsListed(url){ return $list.find("a[href|='"+url+"']").length > 0; +} +function updateIntro() { + if(numBoxesChecking <= 0) { + if(numBoxesFound > 0) { + $intro.html("Found the following boxes near you:"); + } else { + $intro.html("No boxes found near you."); + } + $preloader.fadeOut(1000); + } } \ No newline at end of file