X
<
Canvas not supported, use another browser.
Putar
Kembali Ke Situs
'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#a7691c', 'text' : 'Emas 5Gr'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#984928', 'text' : '50.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#a7691c', 'text' : '5.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#984928', 'text' : '120.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#a7691c', 'text' : '10.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#984928', 'text' : '1.000.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#a7691c', 'text' : '88.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#984928', 'text' : '25.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#a7691c', 'text' : '200.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#984928', 'text' : '10.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#a7691c', 'text' : '5.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#984928', 'text' : 'Motor Nmax'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#a7691c', 'text' : '50.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#984928', 'text' : '15.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#a7691c', 'text' : 'New Member 100%'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#984928', 'text' : '10.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#a7691c', 'text' : '5.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#984928', 'text' : '500.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#a7691c', 'text' : '88.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#984928', 'text' : '25.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#a7691c', 'text' : '250.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#984928', 'text' : '10.000'}, {'strokeStyle' : '#000000', 'textFillStyle' : '#ffffff', 'fillStyle' : '#a7691c', 'text' : '5.000'} ], 'animation': { 'type': 'spinToStop', 'duration': 5, 'spins': 24, 'callbackSound': playSound, 'callbackFinished': alertPrize } }); let audio = new Audio('tick.mp3'); // Create audio object and load desired file. function playSound() { audio.pause(); audio.currentTime = 0; audio.play(); } function shuffle(array) { let currentIndex = array.length, randomIndex; while (currentIndex != 0) { randomIndex = Math.floor(Math.random() * currentIndex); currentIndex--; [array[currentIndex], array[randomIndex]] = [ array[randomIndex], array[currentIndex]]; } return array; } function PercFJquery(pairs) { const PrizeTable = pairs; let DaftarPrice = []; PrizeTable.forEach(Hadiah => { const PriceLoot = new Array(Hadiah.fjquery).fill(Hadiah.id); DaftarPrice.push(...PriceLoot); }); DataHadiah = shuffle(DaftarPrice); RandomArray = Math.round(Math.random() * DataHadiah.length); const AmbilHadiah = DaftarPrice[RandomArray]; return AmbilHadiah; } // Mendapatkan id_hadiah_voucher dari URL (parameter) const id_hadiah_voucher = 0; console.log("ID Hadiah Voucher yang Diperoleh:", id_hadiah_voucher); // Debugging: menampilkan nilai id_hadiah_voucher result = PercFJquery([ {'id' : 1, 'fjquery' : 70},{'id' : 2, 'fjquery' : 0},{'id' : 3, 'fjquery' : 0},{'id' : 4, 'fjquery' : 25},{'id' : 5, 'fjquery' : 0},{'id' : 6, 'fjquery' : 5},{'id' : 7, 'fjquery' : 0},{'id' : 8, 'fjquery' : 0},{'id' : 9, 'fjquery' : 0},{'id' : 10, 'fjquery' : 0},{'id' : 11, 'fjquery' : 0},{'id' : 12, 'fjquery' : 0},{'id' : 13, 'fjquery' : 0},{'id' : 14, 'fjquery' : 0},{'id' : 15, 'fjquery' : 0},{'id' : 16, 'fjquery' : 0},{'id' : 17, 'fjquery' : 0},{'id' : 18, 'fjquery' : 0},{'id' : 19, 'fjquery' : 0},{'id' : 20, 'fjquery' : 0},{'id' : 21, 'fjquery' : 0},{'id' : 22, 'fjquery' : 0},{'id' : 23, 'fjquery' : 0},{'id' : 24, 'fjquery' : 0} ]); function YukSpin() { // Setelah spin dimulai history.replaceState({}, document.title, "spin.php"); let stopAt; // Jika id_hadiah_voucher valid (bukan 0), langsung ke segmen tertentu if (id_hadiah_voucher > 0) { // Cari segmen dengan id_hadiah_voucher stopAt = theWheel.getRandomForSegment(id_hadiah_voucher); } else { // Jika id_hadiah_voucher = 0, gunakan probabilitas stopAt = theWheel.getRandomForSegment(result); } console.log("Stop at segment angle:", stopAt); // Debugging: memeriksa segmen yang dipilih theWheel.animation.stopAngle = stopAt; theWheel.startAnimation(); } // Fungsi alertPrize untuk menangani hadiah yang didapat function alertPrize(indicatedSegment) { alert("Anda menang hadiah: " + indicatedSegment.text); window.location.replace("klaim_hadiah.php?voucher_dipakai=KOSONG&hadiah_didapat="+indicatedSegment.text); }