3 ms·
I'm not a webdev, but the code says: /* * rotate each slice at the right angle = (A/2)° + (k - (n+1)/2)*A° * where A is the angle of 1 slice (30° in thi
by toyg 14y ago
I'm not a webdev, but the code says:
/*
* rotate each slice at the right angle = (A/2)° + (k - (n+1)/2)*A°
* where A is the angle of 1 slice (30° in this case)
* k is the number of the slice (in {1,2,3,4,5} here)
* and n is the number of slices (5 in this case)
* formula works for odd number of slices (n odd)
* for even number of slices (n even) the rotation angle is (k - n/2)*A°
*
* after rotating, skew on Y by 90°-A°; here A° = the angle for 1 slice = 30°
*/
So there's a calculation to be done. I guess there are various ways to get around that.
- ngoel36 14y ago...so SASS?
- nthj 14y agoSASS could help you generate the required CSS, but you would still need some kind of customized markup, dynamic call to a SASS function, or JavaScript if you wanted to support a truly arbitrary/dynamic/database-driven number of buttons.
- mctx 14y agoA number of different static CSS files even - static5.css Or a serverside script in your favourite language - static.css?slices=5
- _ZeD_ 14y agoshouldn't this be calc()[0] work? [0] https://developer.mozilla.org/en-US/docs/CSS/calc https://developer.mozilla.org/en-US/docs/CSS/calc