From 82f63c549304f3e9283eb26b2bdc1c9daf40a08a Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 20 May 2019 22:25:46 +0200 Subject: [PATCH] Animation improvements --- FloatingSpace/CircularMenuItem.js | 3 ++- FloatingSpace/FloatingObject.js | 17 +++++++++-------- FloatingSpace/StrategyPart.js | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/FloatingSpace/CircularMenuItem.js b/FloatingSpace/CircularMenuItem.js index f7d2c21db..b4f191322 100644 --- a/FloatingSpace/CircularMenuItem.js +++ b/FloatingSpace/CircularMenuItem.js @@ -104,7 +104,7 @@ function newCircularMenuItem () { function physics () { if (thisObject.dontShowAtFullscreen === true && CURRENT_TOP_MARGIN === 0) { return } - const INCREASE_STEP = 0.25 + const INCREASE_STEP = 1 if (Math.abs(thisObject.currentRadius - thisObject.targetRadius) >= INCREASE_STEP) { if (thisObject.currentRadius < thisObject.targetRadius) { @@ -256,3 +256,4 @@ function newCircularMenuItem () { } } } + diff --git a/FloatingSpace/FloatingObject.js b/FloatingSpace/FloatingObject.js index 818d734da..6975f4612 100644 --- a/FloatingSpace/FloatingObject.js +++ b/FloatingSpace/FloatingObject.js @@ -115,11 +115,11 @@ function newFloatingObject () { function thisObjectPhysics () { // The radius also have a target. - if (Math.abs(thisObject.container.frame.radius - thisObject.targetRadius) >= 3) { + if (Math.abs(thisObject.container.frame.radius - thisObject.targetRadius) >= 15) { if (thisObject.container.frame.radius < thisObject.targetRadius) { - thisObject.container.frame.radius = thisObject.container.frame.radius + 3 + thisObject.container.frame.radius = thisObject.container.frame.radius + 15 } else { - thisObject.container.frame.radius = thisObject.container.frame.radius - 3 + thisObject.container.frame.radius = thisObject.container.frame.radius - 15 } thisObject.container.eventHandler.raiseEvent('Dimmensions Changed', event) } @@ -128,19 +128,19 @@ function newFloatingObject () { if (Math.abs(thisObject.currentImageSize - thisObject.targetImageSize) >= 1) { if (thisObject.currentImageSize < thisObject.targetImageSize) { - thisObject.currentImageSize = thisObject.currentImageSize + 2 + thisObject.currentImageSize = thisObject.currentImageSize + 10 } else { - thisObject.currentImageSize = thisObject.currentImageSize - 2 + thisObject.currentImageSize = thisObject.currentImageSize - 10 } } // The fontSize also have a target. - if (Math.abs(thisObject.currentFontSize - thisObject.targetFontSize) >= 0.2) { + if (Math.abs(thisObject.currentFontSize - thisObject.targetFontSize) >= 1) { if (thisObject.currentFontSize < thisObject.targetFontSize) { - thisObject.currentFontSize = thisObject.currentFontSize + 0.2 + thisObject.currentFontSize = thisObject.currentFontSize + 1 } else { - thisObject.currentFontSize = thisObject.currentFontSize - 0.2 + thisObject.currentFontSize = thisObject.currentFontSize - 1 } } @@ -307,3 +307,4 @@ function newFloatingObject () { function updateRadius () { } } + diff --git a/FloatingSpace/StrategyPart.js b/FloatingSpace/StrategyPart.js index 88df34a31..dfeae626b 100644 --- a/FloatingSpace/StrategyPart.js +++ b/FloatingSpace/StrategyPart.js @@ -245,7 +245,7 @@ function newStrategyPart () { browserCanvasContext.beginPath() browserCanvasContext.moveTo(position.x, position.y) browserCanvasContext.lineTo(targetPoint.x, targetPoint.y) - browserCanvasContext.strokeStyle = 'rgba(204, 204, 204, 1)' + browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', 1)' browserCanvasContext.setLineDash([3, 4]) browserCanvasContext.lineWidth = 2 browserCanvasContext.stroke() @@ -260,7 +260,7 @@ function newStrategyPart () { browserCanvasContext.beginPath() browserCanvasContext.arc(targetPoint.x, targetPoint.y, radius, 0, Math.PI * 2, true) browserCanvasContext.closePath() - browserCanvasContext.fillStyle = 'rgba(30, 30, 30, 1)' + browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)' browserCanvasContext.fill() } }