diff --git a/main.js b/main.js index d0b41ca..bbdb955 100644 --- a/main.js +++ b/main.js @@ -2,20 +2,21 @@ /*jslint node: true*/ /*global $, jQuery, alert*/ +var loginResponse; +/* AJAX request to check if user is logged in or not */ +$.ajax({ + url: "php/social-media.php?query=get_homepage_response", + type: "GET", + async: false, + success: function (response) { + // console.log(response); + loginResponse = JSON.parse(response); + // console.log(loginResponse); + } +}); + $(document).ready(function() { - var loginResponse; - /* AJAX request to check if user is logged in or not */ - $.ajax({ - url: "php/social-media.php?query=get_homepage_response", - type: "GET", - async: false, - success: function (response) { - // console.log(response); - loginResponse = JSON.parse(response); - // console.log(loginResponse); - } - }); var loggedIn = loginResponse.loggedIn; var fb_login_url = loginResponse.fb_login_url; diff --git a/main.min.js b/main.min.js index a2dcfff..096dd18 100644 --- a/main.min.js +++ b/main.min.js @@ -1 +1 @@ -$(document).ready(function(){function e(){$(".statsColumn.column-1").animate({left:0},700),$(".statsColumn.column-3").animate({right:0},700);var e=$.map(G,function(e){return e}),t=1500;M&&(n(e,t,".value"),M=!1)}function t(){$(".profile .picture>*").eq(0).animate({left:0},500),$(".profile .picture>*").eq(1).animate({left:0},600),$(".profile .picture>*").eq(2).animate({left:0},700);var e=_.player_stats,t=[e.total_correct,e.total_incorrect,e.games_played,e.best_score],a=1500;B&&(setTimeout(function(){$(".infoLabel").empty().addClass("infoValue").removeClass("infoLabel"),$(".customPadding").removeClass("customPadding"),n(t,a,".infoValue")},3e3),B=!1)}function n(e,t,n){$(n).each(function(n){$(this).prop("Counter",0).animate({Counter:e[n]},{duration:t,easing:"swing",step:function(e){$(this).text(Math.ceil(e))}})})}function a(e,t,n){var a="";a='\n',a+=" \n",a+=" \n",a+=" \n",a+=" \n",a+=" \n",a+=" \n",a+=" \n",$.each(e[t],function(e,t){tweetHTML=twemoji.parse(t.tweetInfo.tweetHTML),a+=" \n",a+=" \n",a+=" \n",a+=" \n"}),a+=" \n",a+="\n",$(n).append(a)}function o(e,t){if(A=e.find(".userInfo").find(".userHandle")[0].innerHTML.replace("@",""),E=t.parent("td").siblings("td").find(".userCard").find(".userInfo").find(".userHandle")[0].innerHTML.replace("@",""),F[A].tweetInfo.tweetID==R[E].tweetInfo.tweetID){var n=$(".timer").TimeCircles().getTime(),a=$.Event("correct-selection");a.time=n,$("table").trigger("correct-selection"),Q.toggleClass("correctSelection"),z.toggleClass("correctSelection"),U+=A,V+=E}else $("table").trigger("incorrect-selection"),Q.toggleClass("incorrectSelection"),z.toggleClass("incorrectSelection"),Q.toggleClass("shake shake-horzontal"),z.toggleClass("shake shake-horzontal");Q.toggleClass("selectedCard"),z.toggleClass("selectedCard"),Q=void 0,z=void 0,D=!1,J=!1}function s(e,t,n){var a=$.extend(!0,{},t),o=$.extend(!0,{},n);setTimeout(function(){a.toggleClass("correctSelectionAnimation"),o.toggleClass("correctSelectionAnimation")},e)}function i(e,t,n){var a=$.extend(!0,{},t),o=$.extend(!0,{},n);setTimeout(function(){a.toggleClass("incorrectSelection"),o.toggleClass("incorrectSelection"),a.toggleClass("shake shake-horzontal"),o.toggleClass("shake shake-horzontal")},e)}function r(e,t){console.log("consecutive bonus: "+50*t.num);var n=50+Math.floor(Math.pow(1.05,e)*Y)+50*t.num,a=W;return W+=n,a=W-a,W}function l(){var e="";$.ajax({url:Z,type:"POST",data:te,dataType:"json",async:!1,beforeSend:function(e,t){(t.data!=$.param(ne)||W>18e3||N)&&e.abort()},success:function(e){},error:function(e,t,n){console.log("Error Occured")}}),e+='
',e+='
',e=e+"

Your Score:"+W+"

",e+="
",e+='
',e+='
',e=e+"

Correct Attempts: "+Y+"

",e+="
",e+='
',e=e+"

Incorrect Attempts: "+K+"

",e+="
",e+="
",e+='
',e+='

Please take our survey to make this game better

',e+="
",e+='
',e+=' ',e+=' ',e+=' ',e+="
",e+='
',e+="
",e+='
',e+="
",e+="
",$("body").append(e),c(5)}function c(e){var t;$.ajax({url:"http://tweety.midnightjabber.com/php/scoreQueries.php?query=get_top_players",type:"GET",async:!1,success:function(e){t=JSON.parse(e)}});var n="";n='\n',n+=" \n",n+=" \n",n+=" \n",n+=" \n",n+=" \n",n+=" \n",n+=" \n",n+=" \n",n+=" \n",$.each(t,function(e,t){var a=t.score==W;n+=" '+e+"

\n",n+=" \n",n+="
\n",n+=" \n",n+=" \n",n+=" \n"}),n+=" \n",n+="
\nRank\nPlayer\nName\nScore
\n",n=n+' \n',n+=" \n",n=n+' \n",n+=" \n",n=n+'

'+t.score+"

\n",n+="
\n",$(".leaderboard").append(n)}function d(e){var t=$(".timer").TimeCircles().getTime();if(t=Math.floor(t-e),0>=t){var n=$.Event("endGame");n._all=!1,n.timeLeft=0,$("body").trigger(n)}else $(".timer").data("timer",t).TimeCircles().restart()}function u(e){$(".timer").data("timer",e).TimeCircles({total_duration:e,count_past_zero:!1,use_background:!1,animation:"ticks",time:{Days:{show:!1},Hours:{show:!1},Minutes:{show:!1},Seconds:{text:"Seconds",color:"#00B200",show:!0}}}).start().addListener(function(e,t,n){var a;if(0==n){var o=$.Event("endGame");o._all=!1,o.timeLeft=n,$("body").trigger(o)}else 30>=n?a="#E60000":75>=n&&(a="#FFFF5C");$(".timer").TimeCircles({time:{Seconds:{color:a}}})})}function p(){var e="anonymous";S&&(e=_.fullname),te.name=e,ne=te}function f(){te.timeRemaining=X,ne=te}function g(){te.score=W,ne=te}function m(){te.correct=Y,ne=te}function v(){te.incorrect=K,ne=te}function h(){if(S){var e=_.player_id;te.player_id=e,ne=te}}function b(){if(S){var e=_.social_media;te.social_media=e,ne=te}}function w(){if(S){var e=_.gender;te.gender=e,ne=te}}function y(){if(S){var e=_.link;e=e.replace(/(https?:\/\/)/i,""),console.log(e),te.profile_link=e,ne=te}}function C(){if(S){var e=_.location;console.log(e),te.location=e,ne=te}}function T(){var e=oe[Math.floor(5*Math.random())];S&&(e=_.profile_pic,e=e.replace(/(https?:\/\/)/i,"")),te.profile_pic=e,ne=te}function k(){var e="";$.ajax({url:"http://jsonip.com?callback=",type:"GET",async:!1,success:function(t){e=t.ip,te.ipAddress=e,ne=te}})}var _;$.ajax({url:"php/social-media.php?query=get_homepage_response",type:"GET",async:!1,success:function(e){_=JSON.parse(e)}});var S=_.loggedIn,I=_.fb_login_url,L=_.twitter_login_url;if(S){var x="";x+='
\n',x=x+' \n',x=x+'

'+_.fullname+'\n

\n',x=x+'

#'+_.player_stats.rank+"

\n",x+="

\n",x+='
\n',x+=' \n',x+=" \n",x+=" \n",x+=" \n",x+=" \n",x+=" \n",x+=" \n",x+=" \n",x+=" \n",x+=" \n",x+=" \n",x+="
\n",x+='

\n',x+=' Total Correct\n',x+="

\n",x+="
\n",x+='

\n',x+=' Total Incorrect\n',x+="

\n",x+="
\n",x+='

\n',x+=' # Games\n',x+="

\n",x+="
\n",x+='

\n',x+=' Best Score\n',x+="

\n",x+="
\n",x+='
\n',x+="

Last Game

\n",x+=' \n',x+=" \n",x+=" \n",x+=" \n",x+=" \n",x+=" \n",x+=" \n",x+=" \n",x+=" \n",x+=" \n",x=x+' \n",x=x+' \n",x=x+' \n",x+=" \n",x+=" \n",x+="
ScoreCorrectIncorrect
'+_.player_stats.last_game.score+"'+_.player_stats.last_game.num_correct+"'+_.player_stats.last_game.num_incorrect+"
\n",x+="
\n",x+="
\n",$(".loginProfile").addClass("profile"),$(".profile").removeClass("loginProfile"),$(".profile").append(x)}else{var H='';$(".initialButtons").prepend(H);var O="";O+='
\n',O=O+' \n',O=O+' \n',O+="
\n",console.log(O),$(".loginProfile").append(O.toString())}$(".loginOptions .option").on("click",function(e){window.location=$(this).data("url")}),$(".signOut").on("click",function(e){window.location=$(this).data("url")}),$(".initialButton.loginButton").on("click",function(e){$.fn.fullpage.moveTo($("#pageScroll .section").index($(".profileSection"))+1)}),$(".initialButtons").delay(500).fadeIn(2e3),$(".downArrow").delay(1500).fadeIn(1e3),$("#pageScroll").fullpage({navigation:!0,scrollingSpeed:600,touchSensitivity:1,onLeave:function(n,a,o){$(this);1==n&&"down"==o&&e();var s=$(".section").index($(".profileSection"))+1;a!=s||"down"!=o&&"up"!=o||!S||t()}}),$(".flipCard").flip();var P,G=_.homepage_stats,M=!0,B=!0,j=0,q=0,N=!1;$.ajax({url:"php/gameObject.php",type:"GET",async:!1,success:function(e){P=JSON.parse(e)}}),$(".startButton").on("click",function(e){$(document).trigger("startGame"),a(P,"incorrect",".addTableHere"),$(".gameTable").fadeIn("fast"),j=$.now()}),$(document).on("startGame",function(e){$("#pageScroll").remove(),$.fn.fullpage.destroy("all"),$("table").fadeIn("slow"),u(121)});var A,E,Q,z,F=P.correct,R=P.incorrect,D=!1,J=!1,U="",V="",Y=0,K=0,W=0,X=0,Z="http://tweety.midnightjabber.com/php/scoreQueries.php?query=record_score",ee={flag:!1,num:-1,timeStamp:0};$(".linkOne").on("click",function(e){$(this).siblings(".imgOne").slideToggle("fast"),$(this).siblings(".imgTwo").hide()}),$(".linkTwo").on("click",function(){$(this).siblings(".imgTwo").slideToggle("fast"),$(this).siblings(".imgOne").hide()}),$(".addTableHere, body").on("click",".linkOne",function(e){$(this).siblings(".imgOne").slideToggle("fast"),$(this).siblings(".imgTwo").hide()}),$(".addTableHere, body").on("click",".linkTwo",function(){$(this).siblings(".imgTwo").slideToggle("fast"),$(this).siblings(".imgOne").hide()}),$("body").on("click",function(e){var t=e.target.localName;("body"==t||"td"==t)&&(void 0!=Q&&(Q.removeClass("selectedCard incorrectSelection"),Q=void 0,D=!1),void 0!=z&&(z.removeClass("selectedCard incorrectSelection"),z=void 0,J=!1))}),$(".addTableHere").on("click",".userCard",function(e){var t=e.target.className,n=e.target.localName,a=$(this),s=a.find(".userInfo").find(".userHandle")[0].innerHTML.replace("@","");U.indexOf(s)>=0||n.indexOf("img")>=0||t.indexOf("followButton")>=0||(void 0==Q?(Q=$(this),Q.toggleClass("selectedCard"),D=!0):a[0]===Q[0]?(Q.toggleClass("selectedCard"),Q=void 0,D=!1):(Q.toggleClass("selectedCard"),Q=$(this),Q.toggleClass("selectedCard"),D=!0),J&&o(Q,z))}),$(".addTableHere").on("click",".tweetCard",function(e){var t=(e.target.className,$(this)),n=t.parent("td").siblings("td").find(".userCard").find(".userInfo").find(".userHandle")[0].innerHTML.replace("@","");V.indexOf(n)>=0||(void 0==z?(z=$(this),z.toggleClass("selectedCard"),J=!0):t[0]===z[0]?(z.toggleClass("selectedCard"),z=void 0,J=!1):(z.toggleClass("selectedCard"),z=$(this),z.toggleClass("selectedCard"),J=!0),D&&o(Q,z))}),$(".addTableHere, .answerTable").on("click",".imgLink",function(e){e.stopPropagation()}),$(".addTableHere, .answerTable").on("click","td a",function(e){e.stopPropagation()}),$("body").on("incorrect-selection","table",function(e){d(10),$(".incorrectSound").trigger("play"),K+=1,i(500,Q,z),ee.flag=!1,ee.num=-1,ee.timeStamp=0}),$("body").on("correct-selection","table",function(e){if(Y+=1,ee.flag=!0,ee.num=ee.num+1,ee.timeStamp=$(".timer").TimeCircles().getTime(),$(".correctSound").trigger("play"),s(0,Q,z),10===Y){var t=$.Event("endGame");t._all=!0,t.timeLeft=$(".timer").TimeCircles().getTime(),$("body").trigger(t)}var n=$(".timer").TimeCircles().getTime();$(".score").text(r(n,ee))}),$("body").on("endGame",function(e){q=$.now(),q-j>13e4&&(N=!0),X=Math.floor(e.timeLeft),W+=Math.floor(20*e.timeLeft),$("table").remove(),$(".timer").TimeCircles().destroy(),$(".timer").remove(),$(".score").remove(),p(),f(),g(),m(),v(),h(),b(),w(),y(),C(),k(),T(),l()});var te={},ne={};$("body").on("click",".leaderboardTable .hasLink",function(e){console.log($(this)),window.open($(this).data("link"),"_blank")});var ae=0;$("body").on("click",".answersButton",function(e){0===ae&&(a(P,"correct",".answerTable"),ae=1,$(".answerTable table").css("box-shadow","0 0 20px -5px rgba(0,0,0,0.2)")),$(".leaderboardTable").hide(),$(".answerTable table").fadeIn("slow"),$(".answerTable table thead th").empty()}),$("body").on("click",".leaderboardButton",function(e){$(".answerTable table").hide(),$(".leaderboardTable").fadeIn("slow")}),$("body").on("click",".playAgain",function(e){location.reload()}),$("body").on("click",".logoImg",function(e){location.reload()});var oe=["www.lovemarks.com/wp-content/uploads/profile-avatars/default-avatar-bad-werewolf.png","www.lovemarks.com/wp-content/uploads/profile-avatars/default-avatar-knives-ninja.png","www.lovemarks.com/wp-content/uploads/profile-avatars/default-avatar-foxy-fox.png","www.lovemarks.com/wp-content/uploads/profile-avatars/default-avatar-ponsy-deer.png","www.lovemarks.com/wp-content/uploads/profile-avatars/default-avatar-nerd-pug.png"]}); \ No newline at end of file +var loginResponse;$.ajax({url:"php/social-media.php?query=get_homepage_response",type:"GET",async:!1,success:function(e){loginResponse=JSON.parse(e)}}),$(document).ready(function(){function e(){$(".statsColumn.column-1").animate({left:0},700),$(".statsColumn.column-3").animate({right:0},700);var e=$.map(O,function(e){return e}),n=1500;P&&(t(e,n,".value"),P=!1)}function n(){$(".profile .picture>*").eq(0).animate({left:0},500),$(".profile .picture>*").eq(1).animate({left:0},600),$(".profile .picture>*").eq(2).animate({left:0},700);var e=loginResponse.player_stats,n=[e.total_correct,e.total_incorrect,e.games_played,e.best_score],a=1500;G&&(setTimeout(function(){$(".infoLabel").empty().addClass("infoValue").removeClass("infoLabel"),$(".customPadding").removeClass("customPadding"),t(n,a,".infoValue")},3e3),G=!1)}function t(e,n,t){$(t).each(function(t){$(this).prop("Counter",0).animate({Counter:e[t]},{duration:n,easing:"swing",step:function(e){$(this).text(Math.ceil(e))}})})}function a(e,n,t){var a="";a='\n',a+=" \n",a+=" \n",a+=" \n",a+=" \n",a+=" \n",a+=" \n",a+=" \n",$.each(e[n],function(e,n){tweetHTML=twemoji.parse(n.tweetInfo.tweetHTML),a+=" \n",a+=" \n",a+=" \n",a+=" \n"}),a+=" \n",a+="\n",$(t).append(a)}function o(e,n){if(q=e.find(".userInfo").find(".userHandle")[0].innerHTML.replace("@",""),N=n.parent("td").siblings("td").find(".userCard").find(".userInfo").find(".userHandle")[0].innerHTML.replace("@",""),Q[q].tweetInfo.tweetID==z[N].tweetInfo.tweetID){var t=$(".timer").TimeCircles().getTime(),a=$.Event("correct-selection");a.time=t,$("table").trigger("correct-selection"),A.toggleClass("correctSelection"),E.toggleClass("correctSelection"),J+=q,U+=N}else $("table").trigger("incorrect-selection"),A.toggleClass("incorrectSelection"),E.toggleClass("incorrectSelection"),A.toggleClass("shake shake-horzontal"),E.toggleClass("shake shake-horzontal");A.toggleClass("selectedCard"),E.toggleClass("selectedCard"),A=void 0,E=void 0,F=!1,D=!1}function s(e,n,t){var a=$.extend(!0,{},n),o=$.extend(!0,{},t);setTimeout(function(){a.toggleClass("correctSelectionAnimation"),o.toggleClass("correctSelectionAnimation")},e)}function i(e,n,t){var a=$.extend(!0,{},n),o=$.extend(!0,{},t);setTimeout(function(){a.toggleClass("incorrectSelection"),o.toggleClass("incorrectSelection"),a.toggleClass("shake shake-horzontal"),o.toggleClass("shake shake-horzontal")},e)}function l(e,n){console.log("consecutive bonus: "+50*n.num);var t=50+Math.floor(Math.pow(1.05,e)*V)+50*n.num,a=K;return K+=t,a=K-a,K}function r(){var e="";$.ajax({url:X,type:"POST",data:ee,dataType:"json",async:!1,beforeSend:function(e,n){(n.data!=$.param(ne)||K>18e3||j)&&e.abort()},success:function(e){},error:function(e,n,t){console.log("Error Occured")}}),e+='
',e+='
',e=e+"

Your Score:"+K+"

",e+="
",e+='
',e+='
',e=e+"

Correct Attempts: "+V+"

",e+="
",e+='
',e=e+"

Incorrect Attempts: "+Y+"

",e+="
",e+="
",e+='
',e+='

Please take our survey to make this game better

',e+="
",e+='
',e+=' ',e+=' ',e+=' ',e+="
",e+='
',e+="
",e+='
',e+="
",e+="
",$("body").append(e),c(5)}function c(e){var n;$.ajax({url:"http://tweety.midnightjabber.com/php/scoreQueries.php?query=get_top_players",type:"GET",async:!1,success:function(e){n=JSON.parse(e)}});var t="";t='\n',t+=" \n",t+=" \n",t+=" \n",t+=" \n",t+=" \n",t+=" \n",t+=" \n",t+=" \n",t+=" \n",$.each(n,function(e,n){var a=n.score==K;t+=" '+e+"

\n",t+=" \n",t+="
\n",t+=" \n",t+=" \n",t+=" \n"}),t+=" \n",t+="
\nRank\nPlayer\nName\nScore
\n",t=t+' \n',t+=" \n",t=t+' \n",t+=" \n",t=t+'

'+n.score+"

\n",t+="
\n",$(".leaderboard").append(t)}function d(e){var n=$(".timer").TimeCircles().getTime();if(n=Math.floor(n-e),0>=n){var t=$.Event("endGame");t._all=!1,t.timeLeft=0,$("body").trigger(t)}else $(".timer").data("timer",n).TimeCircles().restart()}function p(e){$(".timer").data("timer",e).TimeCircles({total_duration:e,count_past_zero:!1,use_background:!1,animation:"ticks",time:{Days:{show:!1},Hours:{show:!1},Minutes:{show:!1},Seconds:{text:"Seconds",color:"#00B200",show:!0}}}).start().addListener(function(e,n,t){var a;if(0==t){var o=$.Event("endGame");o._all=!1,o.timeLeft=t,$("body").trigger(o)}else 30>=t?a="#E60000":75>=t&&(a="#FFFF5C");$(".timer").TimeCircles({time:{Seconds:{color:a}}})})}function u(){var e="anonymous";_&&(e=loginResponse.fullname),ee.name=e,ne=ee}function f(){ee.timeRemaining=W,ne=ee}function g(){ee.score=K,ne=ee}function m(){ee.correct=V,ne=ee}function v(){ee.incorrect=Y,ne=ee}function h(){if(_){var e=loginResponse.player_id;ee.player_id=e,ne=ee}}function b(){if(_){var e=loginResponse.social_media;ee.social_media=e,ne=ee}}function w(){if(_){var e=loginResponse.gender;ee.gender=e,ne=ee}}function y(){if(_){var e=loginResponse.link;e=e.replace(/(https?:\/\/)/i,""),console.log(e),ee.profile_link=e,ne=ee}}function C(){if(_){var e=loginResponse.location;console.log(e),ee.location=e,ne=ee}}function T(){var e=ae[Math.floor(5*Math.random())];_&&(e=loginResponse.profile_pic,e=e.replace(/(https?:\/\/)/i,"")),ee.profile_pic=e,ne=ee}function k(){var e="";$.ajax({url:"http://jsonip.com?callback=",type:"GET",async:!1,success:function(n){e=n.ip,ee.ipAddress=e,ne=ee}})}var _=loginResponse.loggedIn,S=loginResponse.fb_login_url,I=loginResponse.twitter_login_url;if(_){var L="";L+='
\n',L=L+' \n',L=L+'

'+loginResponse.fullname+'\n

\n',L=L+'

#'+loginResponse.player_stats.rank+"

\n",L+="

\n",L+='
\n',L+=' \n',L+=" \n",L+=" \n",L+=" \n",L+=" \n",L+=" \n",L+=" \n",L+=" \n",L+=" \n",L+=" \n",L+=" \n",L+="
\n",L+='

\n',L+=' Total Correct\n',L+="

\n",L+="
\n",L+='

\n',L+=' Total Incorrect\n',L+="

\n",L+="
\n",L+='

\n',L+=' # Games\n',L+="

\n",L+="
\n",L+='

\n',L+=' Best Score\n',L+="

\n",L+="
\n",L+='
\n',L+="

Last Game

\n",L+=' \n',L+=" \n",L+=" \n",L+=" \n",L+=" \n",L+=" \n",L+=" \n",L+=" \n",L+=" \n",L+=" \n",L=L+' \n",L=L+' \n",L=L+' \n",L+=" \n",L+=" \n",L+="
ScoreCorrectIncorrect
'+loginResponse.player_stats.last_game.score+"'+loginResponse.player_stats.last_game.num_correct+"'+loginResponse.player_stats.last_game.num_incorrect+"
\n",L+="
\n",L+="
\n",$(".loginProfile").addClass("profile"),$(".profile").removeClass("loginProfile"),$(".profile").append(L)}else{var R='';$(".initialButtons").prepend(R);var x="";x+='
\n',x=x+' \n',x=x+' \n',x+="
\n",console.log(x),$(".loginProfile").append(x.toString())}$(".loginOptions .option").on("click",function(e){window.location=$(this).data("url")}),$(".signOut").on("click",function(e){window.location=$(this).data("url")}),$(".initialButton.loginButton").on("click",function(e){$.fn.fullpage.moveTo($("#pageScroll .section").index($(".profileSection"))+1)}),$(".initialButtons").delay(500).fadeIn(2e3),$(".downArrow").delay(1500).fadeIn(1e3),$("#pageScroll").fullpage({navigation:!0,scrollingSpeed:600,touchSensitivity:1,onLeave:function(t,a,o){$(this);1==t&&"down"==o&&e();var s=$(".section").index($(".profileSection"))+1;a!=s||"down"!=o&&"up"!=o||!_||n()}}),$(".flipCard").flip();var H,O=loginResponse.homepage_stats,P=!0,G=!0,M=0,B=0,j=!1;$.ajax({url:"php/gameObject.php",type:"GET",async:!1,success:function(e){H=JSON.parse(e)}}),$(".startButton").on("click",function(e){$(document).trigger("startGame"),a(H,"incorrect",".addTableHere"),$(".gameTable").fadeIn("fast"),M=$.now()}),$(document).on("startGame",function(e){$("#pageScroll").remove(),$.fn.fullpage.destroy("all"),$("table").fadeIn("slow"),p(121)});var q,N,A,E,Q=H.correct,z=H.incorrect,F=!1,D=!1,J="",U="",V=0,Y=0,K=0,W=0,X="http://tweety.midnightjabber.com/php/scoreQueries.php?query=record_score",Z={flag:!1,num:-1,timeStamp:0};$(".linkOne").on("click",function(e){$(this).siblings(".imgOne").slideToggle("fast"),$(this).siblings(".imgTwo").hide()}),$(".linkTwo").on("click",function(){$(this).siblings(".imgTwo").slideToggle("fast"),$(this).siblings(".imgOne").hide()}),$(".addTableHere, body").on("click",".linkOne",function(e){$(this).siblings(".imgOne").slideToggle("fast"),$(this).siblings(".imgTwo").hide()}),$(".addTableHere, body").on("click",".linkTwo",function(){$(this).siblings(".imgTwo").slideToggle("fast"),$(this).siblings(".imgOne").hide()}),$("body").on("click",function(e){var n=e.target.localName;("body"==n||"td"==n)&&(void 0!=A&&(A.removeClass("selectedCard incorrectSelection"),A=void 0,F=!1),void 0!=E&&(E.removeClass("selectedCard incorrectSelection"),E=void 0,D=!1))}),$(".addTableHere").on("click",".userCard",function(e){var n=e.target.className,t=e.target.localName,a=$(this),s=a.find(".userInfo").find(".userHandle")[0].innerHTML.replace("@","");J.indexOf(s)>=0||t.indexOf("img")>=0||n.indexOf("followButton")>=0||(void 0==A?(A=$(this),A.toggleClass("selectedCard"),F=!0):a[0]===A[0]?(A.toggleClass("selectedCard"),A=void 0,F=!1):(A.toggleClass("selectedCard"),A=$(this),A.toggleClass("selectedCard"),F=!0),D&&o(A,E))}),$(".addTableHere").on("click",".tweetCard",function(e){var n=(e.target.className,$(this)),t=n.parent("td").siblings("td").find(".userCard").find(".userInfo").find(".userHandle")[0].innerHTML.replace("@","");U.indexOf(t)>=0||(void 0==E?(E=$(this),E.toggleClass("selectedCard"),D=!0):n[0]===E[0]?(E.toggleClass("selectedCard"),E=void 0,D=!1):(E.toggleClass("selectedCard"),E=$(this),E.toggleClass("selectedCard"),D=!0),F&&o(A,E))}),$(".addTableHere, .answerTable").on("click",".imgLink",function(e){e.stopPropagation()}),$(".addTableHere, .answerTable").on("click","td a",function(e){e.stopPropagation()}),$("body").on("incorrect-selection","table",function(e){d(10),$(".incorrectSound").trigger("play"),Y+=1,i(500,A,E),Z.flag=!1,Z.num=-1,Z.timeStamp=0}),$("body").on("correct-selection","table",function(e){if(V+=1,Z.flag=!0,Z.num=Z.num+1,Z.timeStamp=$(".timer").TimeCircles().getTime(),$(".correctSound").trigger("play"),s(0,A,E),10===V){var n=$.Event("endGame");n._all=!0,n.timeLeft=$(".timer").TimeCircles().getTime(),$("body").trigger(n)}var t=$(".timer").TimeCircles().getTime();$(".score").text(l(t,Z))}),$("body").on("endGame",function(e){B=$.now(),B-M>13e4&&(j=!0),W=Math.floor(e.timeLeft),K+=Math.floor(20*e.timeLeft),$("table").remove(),$(".timer").TimeCircles().destroy(),$(".timer").remove(),$(".score").remove(),u(),f(),g(),m(),v(),h(),b(),w(),y(),C(),k(),T(),r()});var ee={},ne={};$("body").on("click",".leaderboardTable .hasLink",function(e){console.log($(this)),window.open($(this).data("link"),"_blank")});var te=0;$("body").on("click",".answersButton",function(e){0===te&&(a(H,"correct",".answerTable"),te=1,$(".answerTable table").css("box-shadow","0 0 20px -5px rgba(0,0,0,0.2)")),$(".leaderboardTable").hide(),$(".answerTable table").fadeIn("slow"),$(".answerTable table thead th").empty()}),$("body").on("click",".leaderboardButton",function(e){$(".answerTable table").hide(),$(".leaderboardTable").fadeIn("slow")}),$("body").on("click",".playAgain",function(e){location.reload()}),$("body").on("click",".logoImg",function(e){location.reload()});var ae=["www.lovemarks.com/wp-content/uploads/profile-avatars/default-avatar-bad-werewolf.png","www.lovemarks.com/wp-content/uploads/profile-avatars/default-avatar-knives-ninja.png","www.lovemarks.com/wp-content/uploads/profile-avatars/default-avatar-foxy-fox.png","www.lovemarks.com/wp-content/uploads/profile-avatars/default-avatar-ponsy-deer.png","www.lovemarks.com/wp-content/uploads/profile-avatars/default-avatar-nerd-pug.png"]}); \ No newline at end of file