From 86abe870e0b60632d50c66bdc25d37883d4936c0 Mon Sep 17 00:00:00 2001 From: William Toohey Date: Sat, 19 Dec 2015 19:00:53 +1000 Subject: [PATCH] Revert "Trippy Mode initial" This reverts commit acd51c6e89e10c30d121d8708cddcd2461652328. --- js/HuesCanvas.js | 35 +++-------------------------------- js/HuesSettings.js | 8 +------- 2 files changed, 4 insertions(+), 39 deletions(-) diff --git a/js/HuesCanvas.js b/js/HuesCanvas.js index c905d61..2c3fb04 100644 --- a/js/HuesCanvas.js +++ b/js/HuesCanvas.js @@ -47,9 +47,6 @@ function HuesCanvas(element, aContext, core) { this.blurDistance = 0; this.xBlur = false; this.yBlur = false; - - this.trippyStart = 0; - this.xLast = false; this.blackout = false; this.blackoutColour = "#000"; // for the whiteout case we must store this @@ -67,8 +64,6 @@ function HuesCanvas(element, aContext, core) { this.setBlurQuality("high"); this.setBlurDecay("fast"); this.canvas = document.getElementById(element).getContext("2d"); - this.offscreenCanvas = document.createElement('canvas').getContext('2d'); - this.offscreenCanvas.globalCompositeOperation = "source-over"; window.addEventListener('resize', this.resizeHandler(this)); this.resize(); @@ -90,8 +85,6 @@ HuesCanvas.prototype.resize = function() { // height is constant 720px, we expand width to suit var ratio = window.innerWidth / window.innerHeight; this.canvas.canvas.width = Math.ceil(720 * ratio); - this.offscreenCanvas.canvas.height = this.canvas.canvas.height; - this.offscreenCanvas.canvas.width = this.canvas.canvas.width; var snow = document.getElementById("snow").getContext("2d"); snow.canvas.width = Math.ceil(720 * ratio); this.needsRedraw = true; @@ -166,28 +159,10 @@ HuesCanvas.prototype.redraw = function() { this.canvas.drawImage(bitmap, offset, 0); } } - this.offscreenCanvas.fillStyle = this.intToHex(0xFFFFFF ^ this.colour); - this.offscreenCanvas.fillRect(0,0,width,720); - - if(this.trippyStart && localStorage["trippyMode"] == "on") { - var larger = Math.max(width, this.canvas.canvas.height) / 2; - var radius = Math.floor((cTime - this.trippyStart) * larger) * 2; - if(radius > larger) { - this.trippyStart = 0; - } else { - this.offscreenCanvas.fillStyle = this.intToHex(this.colour); - this.offscreenCanvas.beginPath(); - if(this.xLast) { - radius = larger - radius; - } - this.offscreenCanvas.arc(width/2, this.canvas.canvas.height/2, radius, 0, 2 * Math.PI, false); - this.offscreenCanvas.fill(); - this.offscreenCanvas.closePath(); - } - } this.canvas.globalAlpha = 0.7; + this.canvas.fillStyle = this.intToHex(this.colour); this.canvas.globalCompositeOperation = this.blendMode; - this.canvas.drawImage(this.offscreenCanvas.canvas, 0, 0); + this.canvas.fillRect(0,0,width,720); if(this.blackout) { this.canvas.globalAlpha = bOpacity; this.canvas.fillStyle = this.blackoutColour; @@ -260,7 +235,7 @@ HuesCanvas.prototype.animationLoop = function() { this.blurStart = 0; this.xBlur = this.yBlur = false; this.redraw(); - } else if(this.blurStart || this.trippyStart) { + } else if(this.blurStart) { this.redraw(); } else if(this.needsRedraw){ this.redraw(); @@ -389,8 +364,6 @@ HuesCanvas.prototype.mixColours = function(percent) { HuesCanvas.prototype.doXBlur = function() { this.blurStart = this.aContext.currentTime; - this.trippyStart = this.blurStart; - this.xLast = true; this.blurDistance = this.blurAmount; this.xBlur = true; this.yBlur = false; @@ -399,8 +372,6 @@ HuesCanvas.prototype.doXBlur = function() { HuesCanvas.prototype.doYBlur = function() { this.blurStart = this.aContext.currentTime; - this.trippyStart = this.blurStart; - this.xLast = false; this.blurDistance = this.blurAmount; this.xBlur = false; this.yBlur = true; diff --git a/js/HuesSettings.js b/js/HuesSettings.js index c34fb6d..20a7760 100644 --- a/js/HuesSettings.js +++ b/js/HuesSettings.js @@ -56,7 +56,6 @@ HuesSettings.prototype.defaultSettings = { autoSongDelay: 5, // loops or minutes depending on autoSong value autoSongShuffle: "on", autoSongFadeout: "on", - trippyMode: "off", volume: 0.7 }; @@ -93,8 +92,7 @@ HuesSettings.prototype.settingsCategories = { "Graphics" : [ "blurAmount", "blurDecay", - "blurQuality", - "trippyMode" + "blurQuality" ], "Audio" : [ "playBuildups" @@ -177,10 +175,6 @@ HuesSettings.prototype.settingsOptions = { autoSongFadeout : { name : "AutoSong fade out", options : ["off", "on"] - }, - trippyMode : { - name : "Trippy Mode", - options : ["off", "on"] } };