Permalink
Browse files

Use prod data in prod

  • Loading branch information...
jamiew committed Jan 28, 2012
1 parent 698f9ff commit f65ae9c28ec1082ab9a4d0b7d1127dfa9cc8bc4c
Showing with 9 additions and 3 deletions.
  1. +5 −1 index.html
  2. +4 −2 wheelofsteel.pjs
View
@@ -31,7 +31,11 @@
// inject script to load data
var s = document.createElement('script');
- s.setAttribute('src','http://localhost:3000/data/13.json?callback=load_data');
+ if(window.location.host == 'localhost')
+ server = "localhost:3000";
+ else
+ server = 'scratchbook.herokuapp.com';
+ s.setAttribute('src','http://' + server + '/data/13.json?callback=load_data');
document.getElementsByTagName('body')[0].appendChild(s);
</script>
View
@@ -12,7 +12,6 @@ void setup(){
frameRate(30);
step = Math.floor((1000/frameRate) / (1000/turntable.samplerate));
- console.log(step);
points = turntable.data.p;
}
@@ -38,7 +37,6 @@ void draw(){
// Draw turntable position
frame = points[frameCount * step];
if(prev_frame) diff = prev_frame - frame;
- // console.log(diff);
stroke(50, 50, 250);
strokeWeight(15);
@@ -49,6 +47,10 @@ void draw(){
prev_frame = frame;
+ // Display some info about what's going on
+ text(frame, 15, 25);
+
+ // Exit if data is gone
if(frame == undefined) exit();
}

0 comments on commit f65ae9c

Please sign in to comment.