From: Vincent Vanwaelscappel Date: Tue, 29 Mar 2022 15:48:47 +0000 (+0200) Subject: wait #5182 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=bc3af2b4c65d9b48cb94e224f63e8fd099089c31;p=Animations.git wait #5182 @0.5 --- diff --git a/ThermofisherProgressbar/cache.svg b/ThermofisherProgressbar/cache.svg index 74fa700..10a267b 100644 --- a/ThermofisherProgressbar/cache.svg +++ b/ThermofisherProgressbar/cache.svg @@ -3,14 +3,18 @@ - + - diff --git a/ThermofisherProgressbar/index.html b/ThermofisherProgressbar/index.html index f233e84..ff24990 100644 --- a/ThermofisherProgressbar/index.html +++ b/ThermofisherProgressbar/index.html @@ -37,17 +37,17 @@ function update() { var x = [0, 32.5, 57.3, 82, 107.2, 132, 157, 182, 215]; - var coins = 8; + var coins = 4; try { - coins = Math.max(0, Math.min(x.length, parseInt(parent.fluidbook.gamify.getTotalCoins('S')))); + coins = Math.max(0, Math.min(x.length - 1, parseInt(parent.fluidbook.gamify.getTotalCoins('S')))); } catch (e) { } - var clipLeft = round(100 * (x[coins] / 215)) + '%'; - var clipPath = 'inset(100% 100% 100% ' + clipLeft + ')'; - document.getElementById('cache').style.clipPath = clipPath; + var clipLeft = Math.round(window.innerWidth * (x[coins] / 215)) + "px"; + var clipPath = 'rect(0px,' + clipLeft + ',' + (window.innerHeight) + 'px,0px)'; + document.getElementById('cache').style.clip = clipPath; } document.addEventListener("DOMContentLoaded", function () {