|
|
|
@ -35,6 +35,9 @@ function HuesUI(parent) { |
|
|
|
|
this.settingsToggle = null; |
|
|
|
|
this.hideToggle = null; |
|
|
|
|
|
|
|
|
|
// Put this near the links to song/image lists/ Bottom right alignment
|
|
|
|
|
this.listContainer = null; |
|
|
|
|
|
|
|
|
|
this.hidden = false; |
|
|
|
|
|
|
|
|
|
this.initUI(); |
|
|
|
@ -93,7 +96,7 @@ HuesUI.prototype.initUI = function() { |
|
|
|
|
this.timer.textContent = "T=$0x0000"; |
|
|
|
|
|
|
|
|
|
this.beatCount = document.createElement("div"); |
|
|
|
|
this.beatCount.textContent = "B=$0x00"; |
|
|
|
|
this.beatCount.textContent = "B=$0x000"; |
|
|
|
|
|
|
|
|
|
this.xBlur = document.createElement("div"); |
|
|
|
|
this.xBlur.textContent = "X=$0x00"; |
|
|
|
@ -113,16 +116,22 @@ HuesUI.prototype.initUI = function() { |
|
|
|
|
this.hideToggle.onclick = function() { |
|
|
|
|
that.toggleHide(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.listContainer = document.createElement("div"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
HuesUI.prototype.connectCore = function(core) { |
|
|
|
|
this.core = core; |
|
|
|
|
this.root.style.display = "block"; |
|
|
|
|
this.listContainer.appendChild(core.resourceManager.listView); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
HuesUI.prototype.disconnect = function() { |
|
|
|
|
this.core = null; |
|
|
|
|
this.root.style.display = "none"; |
|
|
|
|
while (this.listContainer.firstElementChild) { |
|
|
|
|
this.listContainer.removeChild(this.listContainer.firstElementChild); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// ONLY FOR CHANGING UI, NOT FOR "HIDE" FEATURE
|
|
|
|
@ -178,12 +187,6 @@ HuesUI.prototype.setColourText = function(colour) { |
|
|
|
|
this.hueName.textContent = colour.n.toUpperCase(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
HuesUI.prototype.updateLists = function() { |
|
|
|
|
var songs = this.core.resourceManager.enabledSongs; |
|
|
|
|
var images = this.core.resourceManager.enabledImages; |
|
|
|
|
// TODO display this
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
HuesUI.prototype.blurUpdated = function(x, y) { |
|
|
|
|
x = Math.floor(x * 0xFF); |
|
|
|
|
y = Math.floor(y * 0xFF);; |
|
|
|
@ -305,6 +308,9 @@ RetroUI.prototype.initUI = function() { |
|
|
|
|
that.toggleHide(); |
|
|
|
|
} |
|
|
|
|
this.root.appendChild(this.hideRestore); |
|
|
|
|
|
|
|
|
|
this.listContainer.className = "hues-r-listcontainer"; |
|
|
|
|
this.root.appendChild(this.listContainer); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
RetroUI.prototype.toggleHide = function(stylename) { |
|
|
|
@ -359,6 +365,87 @@ RetroUI.prototype.beat = function() { |
|
|
|
|
this.beatCount.textContent = "B=" + this.intToHex3(this.core.getSafeBeatIndex()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function WeedUI() { |
|
|
|
|
RetroUI.call(this); |
|
|
|
|
|
|
|
|
|
this.xVariance = 10; |
|
|
|
|
this.yVariance = 20; |
|
|
|
|
} |
|
|
|
|
WeedUI.prototype = Object.create(RetroUI.prototype); |
|
|
|
|
WeedUI.prototype.constructor = WeedUI; |
|
|
|
|
|
|
|
|
|
WeedUI.prototype.initUI = function() { |
|
|
|
|
RetroUI.prototype.initUI.call(this); |
|
|
|
|
|
|
|
|
|
this.container.removeChild(this.beatBar) |
|
|
|
|
|
|
|
|
|
this.controls.className = "hues-w-controls"; |
|
|
|
|
this.subControls.className = "hues-w-subcontrols"; |
|
|
|
|
|
|
|
|
|
var beatBar = document.createElement("div"); |
|
|
|
|
beatBar.className = "hues-w-beatbar"; |
|
|
|
|
this.root.appendChild(beatBar); |
|
|
|
|
this.beatBar = beatBar; |
|
|
|
|
|
|
|
|
|
var beatLeft = document.createElement("div"); |
|
|
|
|
beatLeft.className = "hues-w-beatleft"; |
|
|
|
|
beatBar.appendChild(beatLeft); |
|
|
|
|
this.beatLeft = beatLeft; |
|
|
|
|
|
|
|
|
|
var beatRight = document.createElement("div"); |
|
|
|
|
beatRight.className = "hues-w-beatright"; |
|
|
|
|
beatBar.appendChild(beatRight); |
|
|
|
|
this.beatRight = beatRight; |
|
|
|
|
|
|
|
|
|
this.imageModeManual.textContent = "ONE"; |
|
|
|
|
this.imageModeAuto.textContent = "MANY"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
WeedUI.prototype.toggleHide = function() { |
|
|
|
|
if(this.hidden) { |
|
|
|
|
this.beatBar.className = "hues-w-beatbar"; |
|
|
|
|
} else { |
|
|
|
|
this.beatBar.className = "hues-w-beatbar hidden"; |
|
|
|
|
} |
|
|
|
|
RetroUI.prototype.toggleHide.call(this, 'w'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
WeedUI.prototype.beat = function() { |
|
|
|
|
var beats = this.core.getBeatString(); |
|
|
|
|
var rest = beats.slice(1); |
|
|
|
|
|
|
|
|
|
this.beatLeft.textContent = rest; |
|
|
|
|
this.beatRight.textContent = rest; |
|
|
|
|
|
|
|
|
|
this.beatCount.textContent = "B=" + this.intToHex3(this.core.getSafeBeatIndex()); |
|
|
|
|
|
|
|
|
|
if(["x", "o", "X", "O"].indexOf(beats[0]) != -1) { |
|
|
|
|
var beatCenter = document.createElement("div"); |
|
|
|
|
beatCenter.className = "hues-w-beataccent"; |
|
|
|
|
var rot = this.round10(15 - Math.random() * 30); |
|
|
|
|
var x = this.round10(- this.xVariance / 2 + Math.random() * this.xVariance); |
|
|
|
|
var y = this.round10(30 - this.yVariance / 2 + Math.random() * this.yVariance); |
|
|
|
|
var transform = "rotate(" + rot + "deg) translate(" + x + "px," + y + "px)"; |
|
|
|
|
beatCenter.style.MozTransform = transform; |
|
|
|
|
beatCenter.style.webkitTransform = transform; |
|
|
|
|
beatCenter.style.transform = transform; |
|
|
|
|
beatCenter.textContent = beats[0].toUpperCase(); |
|
|
|
|
this.root.appendChild(beatCenter); |
|
|
|
|
window.setTimeout(this.getRemoveBeat(beatCenter), 1500); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
WeedUI.prototype.round10 = function(num) { |
|
|
|
|
return Math.round(num * 10) / 10; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
WeedUI.prototype.getRemoveBeat = function(element) { |
|
|
|
|
var that = this; |
|
|
|
|
return function() { |
|
|
|
|
that.root.removeChild(element); |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function ModernUI() { |
|
|
|
|
this.beatBar = null; |
|
|
|
|
this.beatLeft = null; |
|
|
|
@ -370,6 +457,7 @@ function ModernUI() { |
|
|
|
|
this.leftInfo = null; |
|
|
|
|
this.controls = null; |
|
|
|
|
this.volInput = null; |
|
|
|
|
this.volLabel = null; |
|
|
|
|
this.hideRestore = null; |
|
|
|
|
|
|
|
|
|
HuesUI.call(this); |
|
|
|
@ -421,13 +509,10 @@ ModernUI.prototype.initUI = function() { |
|
|
|
|
label.textContent = "VOL"; |
|
|
|
|
label.className = "hues-m-vol-label"; |
|
|
|
|
label.onclick = function() { |
|
|
|
|
if(that.core.soundManager.toggleMute()) { |
|
|
|
|
this.textContent = "(VOL)"; |
|
|
|
|
} else { |
|
|
|
|
this.textContent = "VOL"; |
|
|
|
|
}; |
|
|
|
|
that.core.soundManager.toggleMute() |
|
|
|
|
}; |
|
|
|
|
volBar.appendChild(label); |
|
|
|
|
this.volLabel = label; |
|
|
|
|
|
|
|
|
|
var infoToggle = document.createElement("div"); |
|
|
|
|
infoToggle.innerHTML = '?'; |
|
|
|
@ -475,9 +560,7 @@ ModernUI.prototype.initUI = function() { |
|
|
|
|
|
|
|
|
|
var images = document.createElement("div"); |
|
|
|
|
images.className = "hues-m-controlblock"; |
|
|
|
|
var imageList = document.createElement("div"); |
|
|
|
|
imageList.textContent = "IMAGES"; |
|
|
|
|
imageList.className = "hues-m-songbutton"; |
|
|
|
|
this.imageList.className = "hues-m-songbutton"; |
|
|
|
|
|
|
|
|
|
var imageControls = document.createElement("div"); |
|
|
|
|
imageControls.className = "hues-m-controlbuttons"; |
|
|
|
@ -488,7 +571,7 @@ ModernUI.prototype.initUI = function() { |
|
|
|
|
this.imageMode.onclick = function() {that.core.toggleFullAuto();}; |
|
|
|
|
this.imagePrev.className = "hues-m-prevbutton"; |
|
|
|
|
this.imageNext.className = "hues-m-nextbutton"; |
|
|
|
|
images.appendChild(imageList); |
|
|
|
|
images.appendChild(this.imageList); |
|
|
|
|
imageControls.appendChild(this.imagePrev); |
|
|
|
|
imageControls.appendChild(this.imageMode); |
|
|
|
|
imageControls.appendChild(this.imageNext); |
|
|
|
@ -534,6 +617,9 @@ ModernUI.prototype.initUI = function() { |
|
|
|
|
that.toggleHide(); |
|
|
|
|
} |
|
|
|
|
this.root.appendChild(this.hideRestore); |
|
|
|
|
|
|
|
|
|
this.listContainer.className = "hues-m-listcontainer"; |
|
|
|
|
this.root.appendChild(this.listContainer); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ModernUI.prototype.toggleHide = function() { |
|
|
|
@ -554,6 +640,11 @@ ModernUI.prototype.toggleHide = function() { |
|
|
|
|
|
|
|
|
|
ModernUI.prototype.updateVolume = function(vol) { |
|
|
|
|
this.volInput.value = vol; |
|
|
|
|
if(vol == 0) { |
|
|
|
|
this.volLabel.textContent = "(VOL)"; |
|
|
|
|
} else { |
|
|
|
|
this.volLabel.textContent = "VOL"; |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ModernUI.prototype.modeUpdated = function() { |
|
|
|
@ -619,87 +710,6 @@ ModernUI.prototype.setImageText = function() { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function WeedUI() { |
|
|
|
|
RetroUI.call(this); |
|
|
|
|
|
|
|
|
|
this.xVariance = 10; |
|
|
|
|
this.yVariance = 20; |
|
|
|
|
} |
|
|
|
|
WeedUI.prototype = Object.create(RetroUI.prototype); |
|
|
|
|
WeedUI.prototype.constructor = WeedUI; |
|
|
|
|
|
|
|
|
|
WeedUI.prototype.initUI = function() { |
|
|
|
|
RetroUI.prototype.initUI.call(this); |
|
|
|
|
|
|
|
|
|
this.container.removeChild(this.beatBar) |
|
|
|
|
|
|
|
|
|
this.controls.className = "hues-w-controls"; |
|
|
|
|
this.subControls.className = "hues-w-subcontrols"; |
|
|
|
|
|
|
|
|
|
var beatBar = document.createElement("div"); |
|
|
|
|
beatBar.className = "hues-w-beatbar"; |
|
|
|
|
this.root.appendChild(beatBar); |
|
|
|
|
this.beatBar = beatBar; |
|
|
|
|
|
|
|
|
|
var beatLeft = document.createElement("div"); |
|
|
|
|
beatLeft.className = "hues-w-beatleft"; |
|
|
|
|
beatBar.appendChild(beatLeft); |
|
|
|
|
this.beatLeft = beatLeft; |
|
|
|
|
|
|
|
|
|
var beatRight = document.createElement("div"); |
|
|
|
|
beatRight.className = "hues-w-beatright"; |
|
|
|
|
beatBar.appendChild(beatRight); |
|
|
|
|
this.beatRight = beatRight; |
|
|
|
|
|
|
|
|
|
this.imageModeManual.textContent = "ONE"; |
|
|
|
|
this.imageModeAuto.textContent = "MANY"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
WeedUI.prototype.toggleHide = function() { |
|
|
|
|
if(this.hidden) { |
|
|
|
|
this.beatBar.className = "hues-w-beatbar"; |
|
|
|
|
} else { |
|
|
|
|
this.beatBar.className = "hues-w-beatbar hidden"; |
|
|
|
|
} |
|
|
|
|
RetroUI.prototype.toggleHide.call(this, 'w'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
WeedUI.prototype.beat = function() { |
|
|
|
|
var beats = this.core.getBeatString(); |
|
|
|
|
var rest = beats.slice(1); |
|
|
|
|
|
|
|
|
|
this.beatLeft.textContent = rest; |
|
|
|
|
this.beatRight.textContent = rest; |
|
|
|
|
|
|
|
|
|
this.beatCount.textContent = "B=" + this.intToHex3(this.core.getSafeBeatIndex()); |
|
|
|
|
|
|
|
|
|
if(["x", "o", "X", "O"].indexOf(beats[0]) != -1) { |
|
|
|
|
var beatCenter = document.createElement("div"); |
|
|
|
|
beatCenter.className = "hues-w-beataccent"; |
|
|
|
|
var rot = this.round10(15 - Math.random() * 30); |
|
|
|
|
var x = this.round10(- this.xVariance / 2 + Math.random() * this.xVariance); |
|
|
|
|
var y = this.round10(30 - this.yVariance / 2 + Math.random() * this.yVariance); |
|
|
|
|
var transform = "rotate(" + rot + "deg) translate(" + x + "px," + y + "px)"; |
|
|
|
|
beatCenter.style.MozTransform = transform; |
|
|
|
|
beatCenter.style.webkitTransform = transform; |
|
|
|
|
beatCenter.style.transform = transform; |
|
|
|
|
beatCenter.textContent = beats[0].toUpperCase(); |
|
|
|
|
this.root.appendChild(beatCenter); |
|
|
|
|
window.setTimeout(this.getRemoveBeat(beatCenter), 1500); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
WeedUI.prototype.round10 = function(num) { |
|
|
|
|
return Math.round(num * 10) / 10; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
WeedUI.prototype.getRemoveBeat = function(element) { |
|
|
|
|
var that = this; |
|
|
|
|
return function() { |
|
|
|
|
that.root.removeChild(element); |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function XmasUI() { |
|
|
|
|
ModernUI.call(this); |
|
|
|
|
|
|
|
|
|