Commit 86c66fc4 authored by Michael Murtaugh's avatar Michael Murtaugh

working

parent 651faa61
a branch is born
SICV Vitrine
============
requirements
Requirements
npm install socket.io node-static javascript-state-machine extend dateformat
\ No newline at end of file
npm install socket.io node-static javascript-state-machine extend dateformat async
This diff is collapsed.
......@@ -12,5 +12,6 @@
<div id="content">
<img src="blank.png" />
</div>
<div id="message"></div>
</body>
</html>
document.addEventListener("DOMContentLoaded", function () {
var sockaddr = window.location.protocol+'//'+window.location.host,
socket,
img = document.querySelector("img");
img = document.querySelector("img"),
msg = document.getElementById("message");
img.style.display = "none";
console.log("opening connection to", sockaddr);
socket = io.connect();
......@@ -12,8 +14,12 @@ document.addEventListener("DOMContentLoaded", function () {
console.log("connected to socket server");
img.style.display = "none";
});
socket.on("collage", function (d) {
msg.innerHTML = "Creating collage...";
});
socket.on("collagegif", function (d) {
console.log("collagegif", d.src);
msg.innerHTML = "";
img.src = d.src;
img.style.display = "block";
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment