INNER CODE UNIT · JavaScript
resetCard
moshang-ax/lottery · product/src/lottery/index.js:561
function resetCard(duration = 500) {
if (currentLuckys.length === 0) {
return Promise.resolve();
}
selectedCardIndex.forEach(index => {
let object = threeDCards[index],
target = targets.sphere[index];
new TWEEN.Tween(object.position)
.to(
{
x: target.position.x,
y: target.position.y,
z: target.position.z
},
Math.random() * duration + duration
)