ng-spinners icon indicating copy to clipboard operation
ng-spinners copied to clipboard

Help wanted! - support size property

Open JoshK2 opened this issue 6 years ago • 5 comments

Hey, I want to add support to size property like I started to do in the react project https://github.com/joshK2/react-spinners-css#-list-of-spinners---proptypes-and-default-props

If someone wants to help me, it's with pleasure.

JoshK2 avatar Sep 10 '19 08:09 JoshK2

@JoshK2 I'll get on this!

Just too clarify, you want a [size]="'64'" or size="64" which would be converted to 64px ?

Please assign to me.

exia avatar Sep 12 '19 13:09 exia

Hey @exia Yes, I want to add the option of sizing as I do with the react spinners project, but in some component, you need to calculate this with percentage. Like I do here: https://github.com/JoshK2/react-spinners-css/blob/master/src/components/Ring/index.js

The option needs to be unlimited, so, for example, if you have a div in another div, and the relation between them is 50%, so the size of inside onw one need to be size * 0.5

Thank you very much!

JoshK2 avatar Sep 12 '19 13:09 JoshK2

Hey @JoshK2

Thanks for the prompt reply.

So, are you saying that units should always be sent in as a percentage? Or should we allow the option to be sent in?

I.e.

<ring-loader [size]="'60'" [units]="'px'"></ring-loader>

<ring-loader [size]="'100'" [units]="'%'"></ring-loader>

But it will default to pixels?

I'm not sure I fully understand what you're saying from the "option needs to be unlimited", and the relation between the divs?

Are you talking about divs within the component?

Sorry, just want to make sure I do it right first time!

exia avatar Sep 12 '19 13:09 exia

@exia the value is number and convert it to a pixel. "option needs to be unlimited": if the spinner is like this:

<div style="width: 100px">
  <div style="width: 50px"></div>
</div>

and the value is number, the calculation needs to be like this;

<div style="width: size px">
 <div style="width: size * 0.5 px"></div>
</div>

Thank you for the support!

JoshK2 avatar Sep 12 '19 14:09 JoshK2

@JoshK2

Makes perfect sense, thanks for clarifying.

I'll get it done as soon as I get a chance (should be tonight)!

exia avatar Sep 12 '19 15:09 exia