vUX / CShapes / v4.1.0
One constructor, three shapes: a progress ring that animates between values, a marching-ants border, and a fixed dashed border. Sharp on every screen.
reduced motion: animation offconfig.lineColor is read on every frame, so a tween can write it while the dashes run.
clockWise = false runs the dashes the other way round.
A still dashed border for drop zones and placeholders.
Every config property of arc() is wired below; any change redraws the ring.
With a duration above 0, each draw animates from the value last shown on this canvas to the new one.
Geometry
Colour and text
strokeColorprogressBackgroundpercentageFontColorlabelFontColorMotion
Try stop() halfway through an animated draw, then draw() again: the next animation starts from the frozen frame. destroy() clears the canvas and resets the start value to 0.
The dashes move a whole number of dash periods per cycle, so repeats loop without a jump. The canvas size and
the config are re-read at the start of every cycle; lineColor is read on every frame.
lineColorMotion
Square corners (radius 0) show half of lineWidth: the line runs on the canvas edge and the canvas clips
its outer half. Rounded corners are drawn inset so they keep one even thickness. A lineWidth of 0 becomes 1.
The same border without the motion: draw() strokes it once and returns. There is no
stop() or destroy(); to remove it, clear the canvas yourself.
lineColor
A file-upload list: each row has its own arc() object and its own canvas, fed progress in uneven steps.
Each step animates from where the last one ended, and callback marks the row done at 100.
Every setter and draw() checks its argument and throws at the call, so a typo fails in your code, not
silently inside an animation frame. Each button below makes one bad call and prints what was thrown.