]> _ Git - bonaquiz.git/commitdiff
fix circle animation WIP #2647 @0:45
authornael <nael@cubedesigners.com>
Wed, 17 Apr 2019 14:40:22 +0000 (16:40 +0200)
committernael <nael@cubedesigners.com>
Wed, 17 Apr 2019 14:40:22 +0000 (16:40 +0200)
js/bonaquiz.js

index 0cffd3a9a2f22edb0b86716645c9cf5acf331f47..495d78eb0d39c661bc13cefdd7d1e208b69ef195 100644 (file)
@@ -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