4 instead of explicitly calling
5 Nifty ('div#$id','medium');
6 on every single element as the original niftycube.js recommends,
7 we just do that on every element that has one of the
8 the nifty-{small,medium,big} class set
11 var nifty_inited = false;
13 function nifty_init () {
15 if ( nifty_inited ) return;
16 const sizes = { 0: 'small', 1: 'medium', 2: 'big', length: 3}
17 for (const [int, size] of Object.entries(sizes)) {
19 let elements = document.getElementsByClassName('nifty-'+size)
20 for (const element of elements) {
21 // use Rounded rather than Nifty
22 // the latter needs an id that some elements don't have
23 // plus, it's more efficient anyway
24 pleRounded(element, size)