Right positioning is required
Since only the ´top´ and ´left´ attributes are provided, it's impossible to properly align the spinner to the right of the page. Providing a ´right´ parameter would solve this.
This would complicate positioning (i.e. if both left and right are specified which one would you use?), and it's easy enough on your side, so closing.
right = '60%'
left = (100 - (+(right.slice(0, -1)))) + '%'
// '40%'
right = 60
left = (100 - right) + '%'
// '40%'
This fix doesn't work if I want to position the spinner 30px from the right without knowing the element width (on a button, for example).
If we were to specifically support right positioning, to be consistent we would also need to support bottom positioning.
@dorian-marchal Is there anything preventing you from using CSS to accomplish this? For example:
var spinner = new Spinner({className: 'right-spinner', left: 'auto'});
And your CSS could contain something like this:
.right-spinner {
right: 30px;
}