The grooviest way to choose the lucky contributor!!
viewof spin_it = {
return Inputs.button('Spin it!')
}
wheel = make_wheel(names)
idx = {
if(spin_it > 0) {
const idx = Math.floor(names.length*Math.random());
wheel.spinToIndex(idx, { extraRotations: 2, duration: 2000*(Math.random() + 1) });
return idx;
}
}
import {make_wheel} from '/components/student_spinner.js';
names = ['Amina','Bryan M','Bryan PC','Carlos','Collin','David','Doug','Estelle','Fin','Gabriel','Isabel','Jacob C','Jacob S','James','Jordan','Lauren','Leo','Lexi','Lilia','Miranda','Sal','William','Zachary']