nipplejs icon indicating copy to clipboard operation
nipplejs copied to clipboard

is it possible to change the smaller circle size ratio with respect to the bigger circle? It's default 50%

Open sprajagopal opened this issue 6 years ago • 4 comments

sprajagopal avatar Aug 02 '17 07:08 sprajagopal

Hi, it seems that this part hardcode the 50%.

But if you had some CSS like this :

.nipple .front {
     width: 20% !important;
}

The !important part is the important part here ;)

It will override the one that is written in JS. It's a bit hacky, but I think it would be a solution for you. Tell me if it's enough, and close the issue if so.

Cheers!

yoannmoinet avatar Aug 02 '17 09:08 yoannmoinet

Just tested it, it's not possible. Since the movement is based on the size of the front element.

You'll need to create a new option to set the front part size independently.

PR's welcome ;)

yoannmoinet avatar Aug 02 '17 10:08 yoannmoinet

see if what I added in commit 853aaf3a4080bbffe0df52d9682517355a50c895 fixes it for you

I use the nipple.raw.position to see how far it is pulled beyond the origin of the nipple, for use as a touchpad, in data-only mode, with no nipple showing. You could then trigger the size of the css dynamically, from js code, when over the 50 (> Math.abs(45))

iodev avatar Mar 10 '19 16:03 iodev

overriding the size by using scale works for me

.nipple .front {
    scale: 1.2 !important;
}

cazhjo avatar Oct 08 '20 10:10 cazhjo