From: nael Date: Wed, 17 Apr 2019 14:40:22 +0000 (+0200) Subject: fix circle animation WIP #2647 @0:45 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=02d4466bb9412a558c78b5d0fe703dd58150f95e;p=bonaquiz.git fix circle animation WIP #2647 @0:45 --- diff --git a/js/bonaquiz.js b/js/bonaquiz.js index 0cffd3a..495d78e 100644 --- a/js/bonaquiz.js +++ b/js/bonaquiz.js @@ -99,6 +99,8 @@ function AfterTransition() { let circleStart = circleAngleDirection; let scoreFinal = scoreValue / nbquestions; + // For low scores, scale animation speed so it isn't too slow nor too fast... + animationDuration = Math.max(animationDuration / 3, animationDuration * scoreFinal); window.circleDirection = circleSens; if (window.circleDirection === 1) { @@ -123,7 +125,7 @@ function AfterTransition() { function updateAngle() { // console.log('angle = ', window.angle); - paper.clear(); + // paper.clear(); sector(paper, paperWidth / 2, paperHeight / 2, paperRadius, donutRadius, window.angle, window.angleEnd, { fill: color, stroke: stroke