Browse Source

added local json input

visualizer
edoardoo 9 years ago
parent
commit
07869652b2
4 changed files with 29 additions and 0 deletions
  1. +1
    -0
      public/index.html
  2. +6
    -0
      public/scripts/functions.js
  3. +16
    -0
      public/style/style.less
  4. +6
    -0
      server.js

+ 1
- 0
public/index.html View File

@ -19,6 +19,7 @@
<button onclick="toggleLeaderBoard()">LeaderBoard</button>
<section id="listBoard">Loading...</section>
</div>
<div class="bottomRight"><input placeholder="Paste Json, visible only locally." type="text" id="sendHCJson"><button onclick="sendJson()">Send</button></div>
<section id="honeyComb">
</section>


+ 6
- 0
public/scripts/functions.js View File

@ -253,6 +253,12 @@ function ringTheBell(){
document.onkeydown = checkKey;
function sendJson(){
// console.log("sending mama some json.")
// socket.emit("jsonToParse", document.getElementById("sendHCJson").value);
populateHoneycomb( JSON.parse(document.getElementById("sendHCJson").value) , 0);
}
function checkKey(e) {
e = e || window.event;


+ 16
- 0
public/style/style.less View File

@ -26,6 +26,22 @@ audio{
-webkit-transition: all .5s ease-in-out; /* Android 2.1+, Chrome 1-25, iOS 3.2-6.1, Safari 3.2-6 */
transition: all .5s ease-in-out;
}
.bottomRight{
position: fixed;
right: 0;
bottom: 0;
z-index: 9999;
background: #666;
padding: 10px;
button{
margin-left: 10px;
margin-right: 10px;
}
input{
min-width: 200px;
}
}
#controlBar{
position: fixed;
top: 0;


+ 6
- 0
server.js View File

@ -67,5 +67,11 @@ io.sockets.on('connection', function(socket){
console.log('Live interface connected.');
}
});
socket.on('jsonToParse', function(msg){
if(msg == "true"){
console.log('Json received.');
socket.emit("jsonHoneycomb", msg);
}
});
});

Loading…
Cancel
Save