summaryrefslogtreecommitdiff
path: root/scripts/robot.js
diff options
context:
space:
mode:
authorOwen <despito@MacBook-Pro-de-Despito.local>2014-06-24 15:29:43 +0200
committerOwen <despito@MacBook-Pro-de-Despito.local>2014-06-24 15:29:43 +0200
commit2d98eaaf727834c128fdd2513d43d677d97fe8d7 (patch)
tree567362955cbbcfde63c554e034544c2a568c4bde /scripts/robot.js
parent8c9f7f278806918308ac40ee721b1f9162385bf1 (diff)
client-only prototype files
Diffstat (limited to 'scripts/robot.js')
-rw-r--r--scripts/robot.js62
1 files changed, 62 insertions, 0 deletions
diff --git a/scripts/robot.js b/scripts/robot.js
new file mode 100644
index 00000000..f3ccc989
--- /dev/null
+++ b/scripts/robot.js
@@ -0,0 +1,62 @@
+var sentence="#Rhizibot is showing you a #tutorial ";
+sentence+="#Rhizi visualizes data with #Graphs ";
+sentence+="#Graphs are great to display #relationships ";
+sentence+="#nodes are #entities ";
+sentence+="#nodes are #concepts ";
+sentence+="#entities can be #concepts ";
+sentence+="#concepts have context with #relationships ";
+sentence+="We built this entire graph in 30 seconds, try it out yourself!";
+
+sentence="";
+var arr=["works on","contibutes to","likes","knows","is an expert at","donates to"];
+for(var a=0;a<30;a++){
+ sentence+="#"+names[Math.floor(Math.random()*names.length)]+" "+arr[Math.round(Math.random()*4)]+" #"+sugg[Math.floor(Math.random()*sugg.length)]+" ";
+}
+
+var counter=0;
+var sentencecounter=0;
+var robot;
+var speed=9;
+$('.logo').click(function(){
+
+setTimeout( Robot, 1000 );
+
+
+});
+/*
+var answer = confirm ("Would you like a tutorial?")
+if (answer)
+setTimeout( Robot, 100 );
+
+*/
+
+
+function Robot(){
+
+
+ if(counter<=sentence.length){
+ var text=$('#textanalyser').val();
+
+ $('#textanalyser').val(text+sentence.charAt(counter));
+ if(Math.random()>0.9)graph.editType("x","temp",nodetypes[Math.round(Math.random()*4)]);
+ counter++;
+ if(sentence.charAt(counter)==="#"){
+
+ sentencecounter++;
+ if(sentencecounter%2===0)window.setTimeout( Robot, 650/speed );
+ else window.setTimeout( Robot, 30/speed+Math.random()*160/speed );
+ }else{
+ window.setTimeout( Robot, 50/speed+Math.round(Math.random()*100/speed) );
+ }
+ }else{
+ window.clearInterval(robot);
+ }
+
+
+
+
+}
+
+
+
+