Skip to content

Commit

Permalink
index screen
Browse files Browse the repository at this point in the history
  • Loading branch information
fredeerock committed Jul 15, 2019
1 parent fd677aa commit 08c6074
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 13 deletions.
5 changes: 3 additions & 2 deletions diamondsCluster/public/audience/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
<body>
<div class="wrapper">
<div class="welcomeText">
<h1 onclick="Tone.start();document.getElementsByClassName('welcomeText')[0].style.display = 'none';document.getElementsByClassName('scoreText')[0].style.display = 'block';">Bound by Digital Countries</h1>
<!-- <h1 onclick="Tone.start();document.getElementsByClassName('welcomeText')[0].style.display = 'none';document.getElementsByClassName('scoreText')[0].style.display = 'block';">Bound by Digital Countries</h1>
<p>Words | <strong>Vincent A. Cellucci</strong></p>
<p>Audio | <strong>Jesse Allison</strong></p>
<p>Visuals | <strong>Derick Ostrenko</strong></p>
<p>Visuals | <strong>Derick Ostrenko</strong></p> -->
<div id=welcomeTitle></div>
<p>UnMute your phone and Turn up your volume.</p>
<p>Then tap the button to begin.</p>
<p><a href="#" id="button" class="myButton" onclick="Tone.start(); document.getElementsByClassName('welcomeText')[0].style.display = 'none';document.getElementsByClassName('scoreText')[0].style.display = 'block'; document.getElementsByClassName('gentext')[0].style.display = 'block'; document.getElementsByClassName('beforeGentext')[0].style.display = 'block';">Start</a></p>
Expand Down
11 changes: 8 additions & 3 deletions diamondsCluster/public/js/audience.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ let user = {
}
user.sessionName = localStorage.getItem('sessionName') || 'default';

console.log("session name:", user.sessionName);
var ele = document.getElementById("welcomeTitle");
if (ele) {
ele.innerHTML = "This session's name is: " + user.sessionName;
}

// console.log("session name:", user.sessionName);

let generatedTexts = [];

Expand Down Expand Up @@ -219,9 +224,9 @@ function registerWithServer() {
// Only for the Overlay/intro page

socket.on('chat', function (data) {
console.log("chat: " + data);
console.log("chat: ", data);
if (data.corpus) {
console.log("Audience Corpus:", data.corpus)
// console.log("Audience Corpus:", data.corpus)
user.corpus = data.corpus;
putInText(user.corpus);
}
Expand Down
49 changes: 42 additions & 7 deletions diamondsCluster/public/poet/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,15 @@
// **********************************************************
// Only for the Overlay/intro page

socket.on('chat', function(data) {
console.log("chat: " + data);
socket.on('chat', function (data) {
console.log("chat: ", data);
if (data.corpus) {
user.corpus = data.corpus;
putInText(user.corpus);
}
});

socket.on('setSection', function(data) {
socket.on('setSection', function (data) {
console.log("The section is now: " + data.title);
});

Expand Down Expand Up @@ -102,7 +103,7 @@
}
}

socket.on('itemback', function(data) {
socket.on('itemback', function (data) {
// console.log("itemback: " + data.phrase);

if (pArray.length < pALimit) {
Expand Down Expand Up @@ -156,10 +157,44 @@
});
}

window.onload = function() {
// window.onload = function () {
// var xhr = new XMLHttpRequest();



function putInText(seedPath = "/data/score.txt") {
var xhr = new XMLHttpRequest();
xhr.open('GET', '../data/score.txt', true);
xhr.onreadystatechange = function() {

if (user.corpus == "horrortech-corpus") {
seedPath = "/data/seeds/horrortech/seed.txt"
}

if (user.corpus == "lilghettoqueer-corpus") {
seedPath = "/data/seeds/lilghettoqueer/seed.txt"
}

if (user.corpus == "melanwormy-corpus") {
seedPath = "/data/seeds/melanwormy/seed.txt"
}

if (user.corpus == "mythrimony-corpus") {
seedPath = "/data/seeds/mythrimony/seed.txt"
}

if (user.corpus == "orbitopera-corpus") {
seedPath = "/data/seeds/orbitopera/seed.txt"
}

if (user.corpus == "rivergration-corpus") {
seedPath = "/data/seeds/rivergration/seed.txt"
}

console.log("seedPath", seedPath);
xhr.open('GET', seedPath, true);


// xhr.open('GET', '../data/score.txt', true);
xhr.onreadystatechange = function () {
if (this.readyState !== 4) return;
if (this.status !== 200) return; // or whatever error handling you want
document.getElementsByClassName('scoreText')[0].innerHTML = this.responseText;
Expand Down
2 changes: 1 addition & 1 deletion diamondsCluster/public/setup/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<h2>New Session</h2>
<form name="poet-form" onsubmit="return registerPoet()">
<input onClick="this.setSelectionRange(0, this.value.length)" id="input_val" type="text" name="session-name">
<input type="submit">
<input type="submit" value="Create">
</form>
<h2>Corpus</h2>
<a class="button d1" onclick="registerPoet('horrotech-corpus')" href="#">horrotech</a>
Expand Down

0 comments on commit 08c6074

Please sign in to comment.