Permalink
Browse files

almost there, just need delayed batcher

  • Loading branch information...
1 parent 10588f4 commit d1aea42061f550fd9e18267af418b5a3a8d3305e @pcottle committed Jan 19, 2012
Showing with 177 additions and 17 deletions.
  1. +126 −15 index.html
  2. +51 −2 style.css
View
@@ -151,7 +151,7 @@
'workplace':white};
//globals
-var shouldCircuit = false;
+var shouldCircuit = true;
var thePopup = null;
var canvas = null;
@@ -827,6 +827,8 @@
function handleLoadedTexture(texture) {
+ stopLoadingWithText();
+
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
@@ -835,6 +837,9 @@
gl.generateMipmap(gl.TEXTURE_2D);
gl.bindTexture(gl.TEXTURE_2D, null);
+
+ doEarthFlyin();
+ tick();
}
@@ -882,8 +887,8 @@
handleLoadedTexture(earthTexture)
}
- //earthTexture.image.src = "http://localhost/lesson11/world.jpg";
earthTexture.image.src = "world.jpg";
+ startLoadingWithText("Initializing WebGL...");
}
var mvMatrix = mat4.create();
@@ -950,7 +955,6 @@
}
function fmButtonClick() {
-
//get the id
var myCategory = $j(this).attr('id');
if(myCategory)
@@ -1018,11 +1022,26 @@
}
if(myCategory == 'workplace')
{
- tweenToWork();
+ //do some more logic to find a workplace
+ if(myWorkplaces.length)
+ {
+ tweenToWork();
+ }
+ else
+ {
+ askForWorkplace();
+ }
}
if(myCategory == 'education')
{
- tweenToEducation();
+ if(myEducations.length)
+ {
+ tweenToEducation();
+ }
+ else
+ {
+ askForEducation();
+ }
}
}
@@ -1193,10 +1212,6 @@
{
arcClick(theArc);
}
- else
- {
- console.log("No arc under mouse click :-/ ");
- }
}
function getArcAtMousePos(x,y) {
@@ -1307,7 +1322,9 @@
thePopup.HideBubblePopup(10);
thePopup.ShowBubblePopup({ 'openingDelay':tweenTime*0.8,
'closingSpeed':100,
- 'distance':'60px',
+ 'position':'top',
+ 'align':'center',
+ 'distance':'0px',
'innerHtml':textForBubble,
'innerHtmlStyle': {
'max-width':'500px',
@@ -1606,9 +1623,9 @@
document.onmouseup = handleMouseUp;
document.onmousemove = handleMouseMove;
- tick();
+ //tick();
//zoom in to earth
- doEarthFlyin();
+ //doEarthFlyin();
}
function doEarthFlyin() {
@@ -1698,6 +1715,7 @@
var theBatchSender = null;
var boxTimeout = null;
+var notifyTimeout = null;
var isLoading = false;
//me stuff
@@ -1917,7 +1935,7 @@
if(isLoading)
{
//not loading anymore!
- stopLoading();
+ stopLoadingWithText();
}
}
@@ -2198,6 +2216,10 @@
{
if(this.ourJson.employer.name) //pretty sure all of them have employer names
{
+ var employerName = this.ourJson.employer.name;
+ //heuristic...
+ employerName += " inc";
+
this.makeFbGraphSearchForGps(this.ourJson.employer.name);
}
}
@@ -2603,7 +2625,7 @@
console.log("***********You're logged in!***************");
//start the "loading"
- startLoading();
+ startLoadingWithText("Querying the Facebook Graph...");
//do a query for your friends
@@ -2612,6 +2634,74 @@
FB.api('/me',handleMeBack);
}
+function startLoadingWithText(theText) {
+ startLoading();
+
+ topNotify(theText);
+}
+
+function stopLoadingWithText() {
+ stopLoading();
+
+ topNotifyClear();
+}
+
+function topNotify(theText) {
+ topNotifyHtml("<h1>" + theText + "</h1>");
+}
+
+function topNotifyHtml(theText) {
+ //and if someone is clicking fast, get rid of it
+ if(notifyTimeout)
+ {
+ clearTimeout(notifyTimeout);
+ }
+
+ //basically, if its already displayed, hide it and come back in 700ms
+ if(!$j('#topNotifyBarHolder').hasClass('topNotifyBarHidden'))
+ {
+ //clear and come back
+ topNotifyClear();
+ var jsToExecute = "topNotifyHtml('" + theText + "');";
+ notifyTimeout = setTimeout(jsToExecute,700);
+ console.log(jsToExecute);
+ return;
+ }
+
+ $j('#topNotifyBar').html("<h1>" + theText + "</h1>");
+
+ $j('#topNotifyBarHolder').removeClass('topNotifyBarHidden');
+}
+
+function askForHometown() {
+ theHtml = "<h1>A Mysterious Past</h1>";
+ theHtml += "<h4>You don\&#39;t seem to have a hometown listed on your Facebook profile. Try adding one and then coming back to the app!</h4>";
+ topNotifyHtml(theHtml);
+}
+
+function askForCurrent() {
+ theHtml = "<h1>Carmen Sandiego</h1>";
+ theHtml += "<h4>You don\&#39;t seem to have a current location listed on your Facebook profile. Try adding one and then coming back to the app!</h4>";
+ topNotifyHtml(theHtml);
+}
+
+function askForWorkplace() {
+ theHtml = "<h1>Kramer</h1>";
+ theHtml += "<h4>You don\&#39;t seem to have any workplaces listed on your Facebook profile. Try adding one and then coming back to the app!</h4>";
+ topNotifyHtml(theHtml);
+}
+
+function askForEducation() {
+ theHtml = "<h1>Self Schooled</h1>";
+ theHtml += "<h4>You don\&#39;t seem to have any past educational institutions listed on your Facebook profile. Try adding one and then coming back!</h4>";
+ topNotifyHtml(theHtml);
+}
+
+function topNotifyClear() {
+ $j('#topNotifyBar').html('');
+ $j('#topNotifyBarHolder').addClass('topNotifyBarHidden');
+}
+
function startLoading() {
isLoading = true;
@@ -2620,7 +2710,6 @@
$j('.loadingGif').css('left',String(wWidth/2 - 220*0.5) + 'px');
$j('.loadingGif').css('top',String(wHeight / 2 - 19*0.5) + 'px');
$j('.loadingGif').fadeIn();
-
}
function stopLoading() {
@@ -2806,6 +2895,13 @@
duplicateWorkplaceConnections(thisWork);
}
}
+ else
+ {
+ if(currentDisplayCategory == 'workplace')
+ {
+ askForWorkplace();
+ }
+ }
if(response.education && response.education[0])
{
setFirstEducation(response.education[0]);
@@ -2815,6 +2911,13 @@
duplicateEducationConnections(thisEducation);
}
}
+ else
+ {
+ if(currentDisplayCategory == 'education')
+ {
+ askForEducation();
+ }
+ }
}
@@ -2875,6 +2978,14 @@
</div>
</div>
+<div id="topNotifyBarWrapper" style="width:100%;text-align:center;position:absolute;top:0px;">
+ <div id="topNotifyBarHolder" class="buttonGradient smooth topNotifyBar topNotifyBarHidden bubbleToStop" onclick="topNotifyClear()" style="display:inline-block;cursor:pointer">
+ <div id="topNotifyBar">
+
+ </div>
+ </div>
+</div>
+
</body>
</html>
View
@@ -158,7 +158,6 @@ h1 {
-o-transition: all 300ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
transition: all 300ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
}
-
.depressed {
/*IE 7 AND 8 DO NOT SUPPORT BORDER RADIUS*/
-moz-box-shadow: inset 0px 0px 10px #000000;
@@ -302,10 +301,19 @@ h1 {
background-position:0px -132px;
}
-#closeButton {
+#closeButton, .closeButton {
text-shadow:0 1px 0 #CCC, 0 2px 0 #C9C9C9, 0 3px 0 #BBB, 0 4px 0 #B9B9B9, 0 5px 0 #AAA, 0 6px 1px rgba(0, 0, 0, .1), 0 0 5px rgba(0, 0, 0, .1), 0 1px 3px rgba(0, 0, 0, .3), 0 3px 5px rgba(0, 0, 0, .2), 0 5px 10px rgba(0, 0, 0, .25), 0 20px 20px rgba(0, 0, 0, .15);
}
+.closeButton {
+ display:inline-block;
+ float:right;
+ position:relative;
+ top:-15px;
+ font-size:20px;
+ cursor:pointer;
+}
+
.loadingGif {
width:220px;
height:19px;
@@ -317,4 +325,45 @@ h1 {
}
+.topNotifyBar {
+ position:relative;
+ top:-10px;
+ min-width:200px;
+ max-width:600px;
+ padding:20px;
+
+ /*IE 7 AND 8 DO NOT SUPPORT BORDER RADIUS*/
+ -moz-box-shadow: inset 0px 0px 10px #000000;
+ -webkit-box-shadow: inset 0px 0px 10px #000000;
+ -webkit-box-shadow: 0px 0px 10px #FFFFFF;
+ box-shadow: 0px 0px 10px #FFFFFF;
+ /*Inner elements should not cover inner shadows*/
+ /*Chrome renders inset shadows incorrectly with border-radius*/
+ /*IE 7 AND 8 DO NOT SUPPORT INSET SHADOWS*/
+ filter: progid: DXImageTransform.Microsoft.gradient(startColorstr = '#262525', endColorstr = '#e6e1e2');
+ /*INNER ELEMENTS MUST NOT BREAK THIS ELEMENTS BOUNDARIES*/
+ /*Element must have a height (not auto)*/
+ /*All filters must be placed together*/
+ -ms-filter: "progid: DXImageTransform.Microsoft.gradient(startColorstr = '#262525', endColorstr = '#e6e1e2')";
+ /*Element must have a height (not auto)*/
+ /*All filters must be placed together*/
+
+ color:#EEE;
+
+ border: 1px solid white;
+ text-align:center;
+ vertical-align:center;
+ cursor:pointer;
+ font-size:24px;
+
+ -moz-border-radius: 7px;
+ -webkit-border-radius: 7px;
+ border-radius: 7px;
+}
+
+.topNotifyBarHidden {
+ top:-200px;
+}
+
+

0 comments on commit d1aea42

Please sign in to comment.