]> _ Git - Animations.git/commitdiff
wait #4192 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 14 Jan 2021 07:59:22 +0000 (08:59 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 14 Jan 2021 07:59:22 +0000 (08:59 +0100)
RedbullResilience/p6-spin/index.html
RedbullResilience/p6-spin/p6-spin.zip

index 3ffab345680a2d0bb97ca05503d08d8e04c2c04e..1c62fefc49720e486c93ee377f7ff217f871d657 100644 (file)
 <script>
     var nb = 10;
     var currentPos = 0;
-    var spinning=false;
+    var spinning = false;
     $(function () {
         var index = 0;
         updateCurrentPos()
         });
 
         $("#spin").on('click', function () {
-            if(spinning){
+            if (spinning) {
                 return;
             }
-            spinning=true;
+            spinning = true;
             $("#results img").removeClass('visible');
             currentPos = normIdx(currentPos);
             var newpos = nb + (currentPos + Math.ceil(Math.random() * 9));
+            setTimeout(function () {
+                var pos = normIdx(newpos);
+                $("#i" + pos).addClass('visible');
+            }, 3000);
             TweenLite.to(window, 6, {
                 currentPos: newpos,
                 ease: Power4.easeOut,
                 onUpdate: updateCurrentPos,
                 onComplete: endSpin
             });
+
         });
     });
 
     function endSpin() {
-        spinning=false;
+        spinning = false;
         currentPos = normIdx(currentPos);
-        $("#i" + currentPos).addClass('visible');
     }
 
     function updateCurrentPos() {
index 1a14c4957291f39a5897a3b9689ae8e1822923fe..dc5a3808e88d9d2cd78d8c44415dc8828900bda4 100644 (file)
Binary files a/RedbullResilience/p6-spin/p6-spin.zip and b/RedbullResilience/p6-spin/p6-spin.zip differ