{"id":1636,"date":"2026-07-03T06:36:23","date_gmt":"2026-07-03T06:36:23","guid":{"rendered":"https:\/\/kabgold.my\/?page_id=1636"},"modified":"2026-07-03T06:52:48","modified_gmt":"2026-07-03T06:52:48","slug":"cabutan-bertuah","status":"publish","type":"page","link":"https:\/\/kabgold.my\/index.php\/cabutan-bertuah\/","title":{"rendered":"Cabutan Bertuah"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.27.7&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_section][et_pb_section fb_built=&#8221;1&#8243; fullwidth=&#8221;on&#8221; theme_builder_area=&#8221;post_content&#8221; _builder_version=&#8221;4.27.7&#8243; _module_preset=&#8221;default&#8221; height=&#8221;2000px&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243;][et_pb_fullwidth_code _builder_version=&#8221;4.27.7&#8243; _module_preset=&#8221;default&#8221; theme_builder_area=&#8221;post_content&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243; height=&#8221;2000px&#8221; custom_margin=&#8221;-97px||||false|false&#8221;]<!DOCTYPE html><!-- [et_pb_line_break_holder] --><html lang=\"en\"><!-- [et_pb_line_break_holder] --><head><!-- [et_pb_line_break_holder] -->  <meta charset=\"UTF-8\" \/><!-- [et_pb_line_break_holder] -->  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" \/><!-- [et_pb_line_break_holder] -->  <title>Cabutan Bertuah &#8211; Emas untuk e.Mas<\/title><!-- [et_pb_line_break_holder] -->  <\/p>\n<style><!-- [et_pb_line_break_holder] -->    :root{<!-- [et_pb_line_break_holder] -->      --gold:#c5a45b;--gold-2:#f4d98a;--blue:#3a5eab;--blue-2:#6f93e4;--white:#fff;<!-- [et_pb_line_break_holder] -->      --navy:#07101f;--navy-2:#0b1930;--muted:rgba(255,255,255,.72);<!-- [et_pb_line_break_holder] -->      --glass:rgba(7,16,31,.64);--line:rgba(255,255,255,.16);--shadow:0 28px 80px rgba(0,0,0,.46)<!-- [et_pb_line_break_holder] -->    }<!-- [et_pb_line_break_holder] -->    *{box-sizing:border-box}<!-- [et_pb_line_break_holder] -->    html,body{height:800vh}<!-- [et_pb_line_break_holder] -->    body{margin:0;min-height:800vh;font-family:Inter,ui-sans-serif,system-ui,-apple-system,\"Segoe UI\",Arial,sans-serif;color:var(--white);background:#081225;overflow:hidden}<!-- [et_pb_line_break_holder] -->    .bg{position:fixed;inset:0;background:linear-gradient(110deg,rgba(5,12,25,.96) 0%,rgba(8,20,43,.88) 35%,rgba(58,94,171,.43) 70%,rgba(255,255,255,.20) 100%),url('https:\/\/kabgold.my\/wp-content\/uploads\/2026\/07\/e.MAS-7-Front.jpg') center\/cover no-repeat;filter:saturate(1.05) contrast(1.02);z-index:-4}<!-- [et_pb_line_break_holder] -->    .bg:before{content:\"\";position:absolute;inset:0;background:radial-gradient(circle at 50% 47%,rgba(197,164,91,.26),transparent 22%),radial-gradient(circle at 78% 20%,rgba(255,255,255,.22),transparent 32%),linear-gradient(180deg,rgba(0,0,0,.12),rgba(0,0,0,.76));z-index:-3}<!-- [et_pb_line_break_holder] -->    .bg:after{content:\"\";position:absolute;inset:0;background:linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.028) 1px,transparent 1px);background-size:54px 54px;mask-image:radial-gradient(circle at center,black,transparent 72%);z-index:-2}<!-- [et_pb_line_break_holder] -->    .spark{position:fixed;inset:-18%;background:conic-gradient(from 180deg,transparent,rgba(197,164,91,.11),transparent,rgba(58,94,171,.12),transparent);animation:glow 26s linear infinite;z-index:-1;filter:blur(18px)}@keyframes glow{to{transform:rotate(360deg)}}<!-- [et_pb_line_break_holder] -->    .app{height:100vh;padding:24px clamp(18px,3vw,46px);display:grid;grid-template-columns:minmax(460px,1fr) minmax(330px,390px);gap:clamp(22px,3vw,42px);align-items:center}<!-- [et_pb_line_break_holder] -->    .wheel-zone{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:0}.wheel-zone:before{content:\"\";position:absolute;width:min(72vw,780px);height:min(72vw,780px);border-radius:50%;background:radial-gradient(circle,rgba(197,164,91,.22),transparent 62%);filter:blur(18px);z-index:0;pointer-events:none}<!-- [et_pb_line_break_holder] -->    header{position:relative;z-index:2;width:100%;display:flex;align-items:center;justify-content:center;text-align:center;pointer-events:none;margin-bottom:22px}.title{max-width:980px;font-size:clamp(30px,4.2vw,60px);font-weight:950;letter-spacing:-.055em;line-height:.94;text-shadow:0 12px 32px rgba(0,0,0,.52)}.title span{display:inline-block;color:var(--gold-2);text-shadow:0 0 22px rgba(197,164,91,.28)}<!-- [et_pb_line_break_holder] -->    .wheel-wrap{position:relative;width:min(72vh,740px);aspect-ratio:1;border-radius:50%;filter:drop-shadow(0 34px 68px rgba(0,0,0,.58));isolation:isolate}.wheel-wrap:after{content:\"\";position:absolute;left:13%;right:13%;bottom:-30px;height:54px;border-radius:50%;background:radial-gradient(ellipse at center,rgba(0,0,0,.54),transparent 68%);z-index:-2}<!-- [et_pb_line_break_holder] -->    .ring{position:absolute;inset:-18px;border-radius:50%;background:conic-gradient(from 0deg,var(--gold),#fff4c7,var(--blue),#d8e4ff,var(--gold));animation:ringPulse 3.2s ease-in-out infinite;z-index:0;box-shadow:0 0 0 1px rgba(255,255,255,.18),0 0 42px rgba(197,164,91,.28)}.ring:before{content:\"\";position:absolute;inset:6px;border-radius:50%;border:1px solid rgba(255,255,255,.42)}.ring:after{content:\"\";position:absolute;inset:13px;background:linear-gradient(145deg,#07101f,#102349);border-radius:50%;box-shadow:inset 0 0 42px rgba(0,0,0,.45)}@keyframes ringPulse{50%{filter:brightness(1.16) saturate(1.08)}}<!-- [et_pb_line_break_holder] -->    canvas#wheel{position:relative;width:100%;height:100%;border-radius:50%;z-index:1;background:#fff;border:8px solid rgba(255,255,255,.96);box-shadow:inset 0 0 0 9px rgba(7,16,31,.16),0 0 0 1px rgba(255,255,255,.22)}<!-- [et_pb_line_break_holder] -->    .hub{position:absolute;inset:33%;border-radius:50%;z-index:3;background:radial-gradient(circle at 38% 30%,#fff 0%,#fff8e7 48%,#d2b66d 78%,#9f8138 100%);display:grid;place-items:center;border:6px solid rgba(255,255,255,.96);box-shadow:0 18px 42px rgba(0,0,0,.45),0 0 0 9px rgba(197,164,91,.34),inset 0 2px 14px rgba(255,255,255,.78);cursor:pointer;transition:.2s transform,.2s filter,.2s box-shadow;overflow:hidden}.hub:before{content:\"\";position:absolute;inset:9px;border-radius:50%;border:1px solid rgba(58,94,171,.26)}.hub:hover{transform:scale(1.035);filter:brightness(1.08);box-shadow:0 24px 52px rgba(0,0,0,.48),0 0 0 12px rgba(197,164,91,.38)}.hub:active{transform:scale(.98)}.hub.disabled{opacity:.72;cursor:not-allowed}.hub img{width:86%;height:86%;object-fit:contain;filter:drop-shadow(0 4px 9px rgba(0,0,0,.2))}.hub .spin-label{position:absolute;bottom:8%;left:50%;transform:translateX(-50%);background:linear-gradient(135deg,var(--navy),#142849);color:#fff;border:1px solid rgba(197,164,91,.78);border-radius:999px;padding:4px 13px;font-size:clamp(9px,1.5vh,14px);font-weight:950;letter-spacing:.11em;box-shadow:0 6px 16px rgba(0,0,0,.28)}<!-- [et_pb_line_break_holder] -->    .pointer{position:absolute;top:-22px;left:50%;transform:translateX(-50%);width:70px;height:88px;z-index:4;filter:drop-shadow(0 8px 10px rgba(0,0,0,.48))}.pointer:before{content:\"\";position:absolute;left:50%;top:0;transform:translateX(-50%);width:0;height:0;border-left:35px solid transparent;border-right:35px solid transparent;border-top:82px solid var(--gold-2)}.pointer:after{content:\"\";position:absolute;left:50%;top:10px;transform:translateX(-50%);width:18px;height:18px;border-radius:50%;background:var(--navy);box-shadow:0 0 0 5px rgba(255,255,255,.88)}<!-- [et_pb_line_break_holder] -->    .panel{position:relative;margin-top:84px;background:linear-gradient(180deg,rgba(9,22,44,.78),rgba(7,16,31,.66));border:1px solid rgba(255,255,255,.18);border-radius:30px;padding:24px;backdrop-filter:blur(22px) saturate(1.25);box-shadow:var(--shadow);overflow:hidden}.panel:before{content:\"\";position:absolute;inset:0;background:linear-gradient(135deg,rgba(197,164,91,.15),transparent 30%,rgba(58,94,171,.15));pointer-events:none}.panel>*{position:relative}.panel h2{margin:0 0 14px;color:var(--gold-2);font-size:22px;letter-spacing:-.02em}.row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}label{font-size:13px;color:rgba(255,255,255,.82);display:block;margin-bottom:7px;font-weight:650}input,textarea,button{font:inherit}input[type=file],input,textarea{width:100%;padding:12px 13px;border-radius:15px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.09);color:#fff;outline:none;transition:border-color .2s,box-shadow .2s,background .2s}input:focus,textarea:focus{border-color:rgba(197,164,91,.76);box-shadow:0 0 0 4px rgba(197,164,91,.14);background:rgba(255,255,255,.12)}input[type=file]::file-selector-button{border:0;border-radius:11px;padding:8px 10px;margin-right:10px;background:linear-gradient(135deg,var(--gold),#f7dc92);color:#07101f;font-weight:900;cursor:pointer}textarea{height:96px;resize:vertical}.hint{font-size:12px;color:rgba(255,255,255,.66);line-height:1.45;margin-top:7px}.btns{display:grid;grid-template-columns:1.25fr 1fr;gap:10px;margin-top:16px}button{border:0;border-radius:17px;padding:14px 16px;font-weight:950;cursor:pointer;transition:.2s transform,.2s filter,.2s box-shadow}.primary{background:linear-gradient(135deg,var(--gold),#f7dc92);color:#07101f;box-shadow:0 12px 24px rgba(197,164,91,.24)}.secondary{background:rgba(255,255,255,.11);color:#fff;border:1px solid rgba(255,255,255,.2)}button:hover{transform:translateY(-1px);filter:brightness(1.07)}button:disabled{opacity:.45;cursor:not-allowed;transform:none}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:16px 0}.stat{background:rgba(255,255,255,.09);border:1px solid rgba(255,255,255,.13);border-radius:18px;padding:13px 10px;color:rgba(255,255,255,.7);font-size:12px}.stat b{display:block;color:var(--gold-2);font-size:21px;line-height:1.1}.winners{max-height:138px;overflow:auto;margin-top:10px;padding-right:4px}.winner-row{display:flex;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid rgba(255,255,255,.1);font-size:13px}.winner-row b{color:#fff}.winner-row span{color:rgba(255,255,255,.62)}<!-- [et_pb_line_break_holder] -->    .modal{position:fixed;inset:0;display:none;place-items:center;background:rgba(0,0,0,.62);backdrop-filter:blur(8px);z-index:10}.modal.show{display:grid}.card{position:relative;width:min(92vw,640px);padding:38px;border-radius:36px;text-align:center;background:linear-gradient(145deg,#fff,#f7efd8);color:#081225;box-shadow:0 35px 90px rgba(0,0,0,.55);overflow:hidden}.card:before{content:\"\";position:absolute;inset:-50%;background:conic-gradient(transparent,var(--gold),transparent,var(--blue),transparent);animation:glow 5s linear infinite;opacity:.22}.card>*{position:relative}.trophy{font-size:66px;animation:pop .9s ease infinite alternate}@keyframes pop{to{transform:scale(1.08) rotate(-3deg)}}.card h3{margin:8px 0;color:var(--blue);font-size:22px}.winner-name{font-size:clamp(36px,7vw,72px);font-weight:950;color:#111;letter-spacing:-.055em;margin:10px 0;text-wrap:balance}.modal.show .winner-name{animation:winnerBlink .62s ease-in-out infinite alternate}@keyframes winnerBlink{0%{opacity:1;transform:scale(1);text-shadow:0 0 0 rgba(197,164,91,0)}100%{opacity:.42;transform:scale(1.045);text-shadow:0 0 30px rgba(197,164,91,.9),0 0 52px rgba(58,94,171,.35)}}.confetti{position:fixed;top:-20px;width:10px;height:16px;z-index:11;animation:fall linear forwards}@keyframes fall{to{transform:translateY(110vh) rotate(720deg);opacity:.9}}<!-- [et_pb_line_break_holder] -->    @media(max-width:1080px){body{overflow:auto}.app{height:auto;min-height:100vh;grid-template-columns:1fr;padding-top:24px}.panel{margin:30px auto 0;width:min(94vw,640px)}.wheel-wrap{width:min(86vw,680px)}header{margin-bottom:18px}.title{max-width:92%;margin:auto}}<!-- [et_pb_line_break_holder] -->    @media(max-height:760px) and (min-width:1081px){.wheel-wrap{width:min(66vh,690px)}.title{font-size:clamp(28px,3.7vw,52px)}.panel{margin-top:58px}}<!-- [et_pb_line_break_holder] --><\/style>\n<p><!-- [et_pb_line_break_holder] --><\/head><!-- [et_pb_line_break_holder] --><body><!-- [et_pb_line_break_holder] -->  <\/p>\n<div class=\"bg\"><\/div>\n<div class=\"spark\"><\/div>\n<p><!-- [et_pb_line_break_holder] -->  <main class=\"app\"><!-- [et_pb_line_break_holder] -->    <\/p>\n<section class=\"wheel-zone\">\n<header>\n<div class=\"title\">Cabutan Bertuah<!\u2013- [et_pb_br_holder] -\u2013><span>Emas untuk e.Mas<\/span><\/div>\n<\/header>\n<div class=\"wheel-wrap\">\n<div class=\"ring\"><\/div>\n<p><canvas id=\"wheel\" width=\"1400\" height=\"1400\"><\/canvas><\/p>\n<div class=\"pointer\"><\/div>\n<p><button class=\"hub\" id=\"hubSpin\" aria-label=\"Spin lucky draw wheel\"><img decoding=\"async\" src=\"https:\/\/kabgold.my\/wp-content\/uploads\/2026\/07\/KABGOLD-LOGO-2026-vertical1.png\" alt=\"KAB Gold spin button\"><span class=\"spin-label\">SPIN<\/span><\/button><\/div>\n<\/section>\n<p><!-- [et_pb_line_break_holder] -->    <\/p>\n<aside class=\"panel\"><!-- [et_pb_line_break_holder] -->      <\/p>\n<h2>Entry &#038; Controls<\/h2>\n<p><!-- [et_pb_line_break_holder] -->      <label>CSV import: columns <b>name, weight<\/b><\/label><!-- [et_pb_line_break_holder] -->      <input id=\"csv\" type=\"file\" accept=\".csv,text\/csv\"><!-- [et_pb_line_break_holder] -->      <\/p>\n<div class=\"hint\">Supports tens of thousands of rows. Weight must be a positive number. Names are never displayed on the wheel.<\/div>\n<p><!-- [et_pb_line_break_holder] -->      <\/p>\n<div class=\"stats\">\n<div class=\"stat\"><b id=\"count\">0<\/b>Entries<\/div>\n<div class=\"stat\"><b id=\"totalWeight\">0<\/b>Total weight<\/div>\n<div class=\"stat\"><b id=\"winnerCount\">0<\/b>Winners<\/div>\n<\/div>\n<p><!-- [et_pb_line_break_holder] -->      <\/p>\n<div class=\"btns\"><button class=\"primary\" id=\"randomizer\">Randomizer<\/button><button class=\"secondary\" id=\"deleteWinner\" disabled>Past Winner Auto-Deleted<\/button><\/div>\n<p><!-- [et_pb_line_break_holder] -->      <\/p>\n<div class=\"hint\">Click the KAB Gold logo in the center of the wheel to spin. Past winner is automatically removed from the wheel after each spin, so the next spin cannot select the same entry.<\/div>\n<p><!-- [et_pb_line_break_holder] -->      <\/p>\n<div class=\"winners\" id=\"winners\"><\/div>\n<p><!-- [et_pb_line_break_holder] -->    <\/aside>\n<p><!-- [et_pb_line_break_holder] -->  <\/main><!-- [et_pb_line_break_holder] -->  <\/p>\n<div class=\"modal\" id=\"modal\">\n<div class=\"card\">\n<div class=\"trophy\">\ud83c\udfc6<\/div>\n<h3>Pemenang Cabutan Bertuah<\/h3>\n<div class=\"winner-name\" id=\"winnerName\"><\/div>\n<pee>Congratulations! \ud83c\udf89<\/pee><button class=\"primary\" id=\"closeModal\">Close<\/button><\/div>\n<\/div>\n<p><!-- [et_pb_line_break_holder] --><script><!-- [et_pb_line_break_holder] -->const canvas=document.getElementById('wheel'),ctx=canvas.getContext('2d');<!-- [et_pb_line_break_holder] -->let entries=[],angle=0,velocity=0.00025,last=performance.now(),spinning=false,lastWinner=null,lastWinnerIndex=-1,lastClick=0,lastPieIndex=-1;<!-- [et_pb_line_break_holder] -->const gold='#c5a45b',blue='#3a5eab',white='#ffffff';<!-- [et_pb_line_break_holder] -->const els={count:document.getElementById('count'),totalWeight:document.getElementById('totalWeight'),winnerCount:document.getElementById('winnerCount'),status:{textContent:''},hubSpin:document.getElementById('hubSpin'),randomizer:document.getElementById('randomizer'),deleteWinner:document.getElementById('deleteWinner'),winners:document.getElementById('winners'),modal:document.getElementById('modal'),winnerName:document.getElementById('winnerName')};<!-- [et_pb_line_break_holder] -->let audioCtx=null;function audio(){if(!audioCtx)audioCtx=new (window.AudioContext||window.webkitAudioContext)();return audioCtx}<!-- [et_pb_line_break_holder] -->function tickSound(speed,force=false){const now=performance.now();const interval=Math.max(10,120-Math.min(105,speed*9000));if(!force&&now-lastClick<interval)return;lastClick=now;const a=audio(),o=a.createOscillator(),g=a.createGain();o.type='square';o.frequency.value=150+Math.min(1050,speed*11000);g.gain.setValueAtTime(.0001,a.currentTime);g.gain.exponentialRampToValueAtTime(.065,a.currentTime+.004);g.gain.exponentialRampToValueAtTime(.0001,a.currentTime+.038);o.connect(g);g.connect(a.destination);o.start();o.stop(a.currentTime+.042)}<!-- [et_pb_line_break_holder] -->function tickOnPieChange(speed){const idx=indexAtPointer();if(idx!==lastPieIndex){lastPieIndex=idx;tickSound(speed,true)}}<!-- [et_pb_line_break_holder] -->function cheer(){<!-- [et_pb_line_break_holder] -->  const a=audio();<!-- [et_pb_line_break_holder] -->  \/\/ Short applause-style celebration: layered filtered noise claps with a small fanfare.<!-- [et_pb_line_break_holder] -->  const master=a.createGain();master.gain.value=.9;master.connect(a.destination);<!-- [et_pb_line_break_holder] -->  for(let i=0;i<46;i++){<!-- [et_pb_line_break_holder] -->    const t=i*.035+Math.random()*.035;<!-- [et_pb_line_break_holder] -->    const dur=.055+Math.random()*.055;<!-- [et_pb_line_break_holder] -->    const buffer=a.createBuffer(1,Math.max(1,Math.floor(a.sampleRate*dur)),a.sampleRate);<!-- [et_pb_line_break_holder] -->    const data=buffer.getChannelData(0);<!-- [et_pb_line_break_holder] -->    for(let j=0;j<data.length;j++)data[j]=(Math.random()*2-1)*Math.pow(1-j\/data.length,2.6);<!-- [et_pb_line_break_holder] -->    const src=a.createBufferSource();src.buffer=buffer;<!-- [et_pb_line_break_holder] -->    const filter=a.createBiquadFilter();filter.type='bandpass';filter.frequency.value=900+Math.random()*1800;filter.Q.value=.75+Math.random()*1.2;<!-- [et_pb_line_break_holder] -->    const g=a.createGain();g.gain.setValueAtTime(.0001,a.currentTime+t);g.gain.exponentialRampToValueAtTime(.14+Math.random()*.12,a.currentTime+t+.006);g.gain.exponentialRampToValueAtTime(.0001,a.currentTime+t+dur);<!-- [et_pb_line_break_holder] -->    src.connect(filter);filter.connect(g);g.connect(master);src.start(a.currentTime+t);src.stop(a.currentTime+t+dur+.02);<!-- [et_pb_line_break_holder] -->  }<!-- [et_pb_line_break_holder] -->  [0,.11,.22,.36].forEach((t,i)=>{const o=a.createOscillator(),g=a.createGain();o.type='triangle';o.frequency.value=[523,659,784,1046][i];g.gain.setValueAtTime(.0001,a.currentTime+t);g.gain.exponentialRampToValueAtTime(.055,a.currentTime+t+.02);g.gain.exponentialRampToValueAtTime(.0001,a.currentTime+t+.24);o.connect(g);g.connect(master);o.start(a.currentTime+t);o.stop(a.currentTime+t+.28)});<!-- [et_pb_line_break_holder] -->}<!-- [et_pb_line_break_holder] -->function parseCSV(text){const rows=[];let row=[],val='',q=false;for(let i=0;i<text.length;i++){const c=text[i],n=text[i+1];if(c==='\"'&#038;&#038;q&#038;&#038;n==='\"'){val+='\"';i++}else if(c==='\"'){q=!q}else if(c===','&#038;&#038;!q){row.push(val.trim());val=''}else if((c==='\\n'||c==='\\r')&#038;&#038;!q){if(c==='\\r'&#038;&#038;n==='\\n')i++;row.push(val.trim());if(row.some(Boolean))rows.push(row);row=[];val=''}else val+=c}row.push(val.trim());if(row.some(Boolean))rows.push(row);return rows}<!-- [et_pb_line_break_holder] -->function addRows(rows,replace=false){const out=[];let start=0;if(rows[0]&&String(rows[0][0]).toLowerCase().includes('name'))start=1;for(let i=start;i<rows.length;i++){const name=(rows[i][0]||'').trim();const weight=parseFloat(rows[i][1]||'1');if(name&#038;&#038;isFinite(weight)&#038;&#038;weight>0)out.push({name,weight})}if(replace)entries=out;else entries.push(...out);update();drawWheel()}<!-- [et_pb_line_break_holder] -->function randomizeWheel(){if(spinning||entries.length<2)return;for(let i=entries.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));[entries[i],entries[j]]=[entries[j],entries[i]];}angle=Math.random()*Math.PI*2;lastPieIndex=indexAtPointer();update();drawWheel();}<!-- [et_pb_line_break_holder] -->function update(){const total=entries.reduce((s,e)=>s+e.weight,0);els.count.textContent=entries.length.toLocaleString();els.totalWeight.textContent=total.toLocaleString(undefined,{maximumFractionDigits:2});els.hubSpin.disabled=spinning||entries.length===0;els.hubSpin.classList.toggle('disabled',spinning||entries.length===0);els.randomizer.disabled=spinning||entries.length<2;els.deleteWinner.disabled=true;}<!-- [et_pb_line_break_holder] -->function drawWheel(){const w=canvas.width,h=canvas.height,c=w\/2,r=w*.48;ctx.clearRect(0,0,w,h);ctx.save();ctx.translate(c,c);ctx.rotate(angle);const total=entries.reduce((s,e)=>s+e.weight,0)||1;let a=-Math.PI\/2;const minLabel=Math.PI\/90;for(let i=0;i<entries.length;i++){const seg=entries[i].weight\/total*Math.PI*2;ctx.beginPath();ctx.moveTo(0,0);ctx.arc(0,0,r,a,a+seg);ctx.closePath();ctx.fillStyle=i%3===0?gold:i%3===1?blue:white;ctx.fill();if(entries.length<6000&#038;&#038;seg>0.0008){ctx.strokeStyle='rgba(7,16,31,.16)';ctx.lineWidth=1;ctx.stroke()}a+=seg}ctx.beginPath();ctx.arc(0,0,r*.985,0,Math.PI*2);ctx.strokeStyle='rgba(255,255,255,.92)';ctx.lineWidth=12;ctx.stroke();<!-- [et_pb_line_break_holder] -->const gloss=ctx.createRadialGradient(-r*.28,-r*.34,r*.06,0,0,r);gloss.addColorStop(0,'rgba(255,255,255,.30)');gloss.addColorStop(.42,'rgba(255,255,255,.05)');gloss.addColorStop(1,'rgba(0,0,0,.10)');ctx.beginPath();ctx.arc(0,0,r*.96,0,Math.PI*2);ctx.fillStyle=gloss;ctx.fill();ctx.restore();}<!-- [et_pb_line_break_holder] -->function weightedPick(){const total=entries.reduce((s,e)=>s+e.weight,0);let x=Math.random()*total;for(let i=0;i<entries.length;i++){x-=entries[i].weight;if(x<=0)return i}return entries.length-1}<!-- [et_pb_line_break_holder] -->function centerAngleForIndex(idx){const total=entries.reduce((s,e)=>s+e.weight,0);let a=-Math.PI\/2;for(let i=0;i<idx;i++)a+=entries[i].weight\/total*Math.PI*2;return a+(entries[idx].weight\/total*Math.PI*2)\/2}<!-- [et_pb_line_break_holder] -->function indexAtPointer(){if(!entries.length)return-1;const total=entries.reduce((s,e)=>s+e.weight,0)||1;let local=(-Math.PI\/2-angle)%(Math.PI*2);if(local<-Math.PI\/2)local+=Math.PI*2;if(local>=Math.PI*1.5)local-=Math.PI*2;let a=-Math.PI\/2;for(let i=0;i<entries.length;i++){const seg=entries[i].weight\/total*Math.PI*2;if(local>=a&&local<a+seg)return i;a+=seg}return entries.length-1}<!-- [et_pb_line_break_holder] -->function easeOutCubic(t){return 1-Math.pow(1-t,3)}<!-- [et_pb_line_break_holder] -->function spin(){if(spinning||!entries.length)return;audio().resume();spinning=true;lastPieIndex=indexAtPointer();update();els.status.textContent='Spinning... rattle sound follows every pie segment';const idx=weightedPick();const targetCenter=centerAngleForIndex(idx);const pointer=-Math.PI\/2;const current=angle%(Math.PI*2);const desired=pointer-targetCenter;let delta=(desired-current)%(Math.PI*2);if(delta<0)delta+=Math.PI*2;const totalRot=delta+Math.PI*2*10;const start=angle,duration=15000,t0=performance.now();function step(now){const p=Math.min(1,(now-t0)\/duration);const eased=easeOutCubic(p);angle=start+totalRot*eased;velocity=(totalRot*3*Math.pow(1-p,2))\/duration;tickOnPieChange(velocity);drawWheel();if(p<1)requestAnimationFrame(step);else{angle=desired;velocity=0;spinning=false;lastWinner=entries[idx];lastWinnerIndex=-1;announce(lastWinner);entries.splice(idx,1);els.status.textContent='Winner selected and automatically removed from the next spin.';update();drawWheel();}}requestAnimationFrame(step)}<!-- [et_pb_line_break_holder] -->function announce(w){els.status.textContent='Winner selected!';els.winnerName.textContent=w.name;els.modal.classList.add('show');cheer();confetti();const row=document.createElement('div');row.className='winner-row';row.innerHTML=`<b>${escapeHTML(w.name)}<\/b><span>Weight ${w.weight}<\/span>`;els.winners.prepend(row);els.winnerCount.textContent=els.winners.children.length;}<!-- [et_pb_line_break_holder] -->function confetti(){const colors=[gold,blue,white,'#f8df8f','#8fb0ff'];for(let i=0;i<160;i++){const d=document.createElement('div');d.className='confetti';d.style.left=Math.random()*100+'vw';d.style.background=colors[i%colors.length];d.style.animationDuration=(1.8+Math.random()*2.4)+'s';d.style.animationDelay=(Math.random()*0.6)+'s';d.style.transform=`rotate(${Math.random()*360}deg)`;document.body.appendChild(d);setTimeout(()=>d.remove(),4800)}}<!-- [et_pb_line_break_holder] -->function escapeHTML(s){return s.replace(\/[&<>'\"]\/g,m=>({'&':'&amp;','<':'&lt;','>':'&gt;',\"'\":'&#39;','\"':'&quot;'}[m]))}<!-- [et_pb_line_break_holder] -->function loop(now){const dt=now-last;last=now;if(!spinning){angle+=velocity*dt;velocity=0.00025;drawWheel()}requestAnimationFrame(loop)}<!-- [et_pb_line_break_holder] -->requestAnimationFrame(loop);<!-- [et_pb_line_break_holder] -->document.getElementById('csv').onchange=e=>{const f=e.target.files[0];if(!f)return;const reader=new FileReader();reader.onload=()=>addRows(parseCSV(reader.result),true);reader.readAsText(f)};<!-- [et_pb_line_break_holder] -->document.getElementById('hubSpin').onclick=spin;<!-- [et_pb_line_break_holder] -->document.getElementById('randomizer').onclick=randomizeWheel;<!-- [et_pb_line_break_holder] -->document.getElementById('closeModal').onclick=()=>els.modal.classList.remove('show');<!-- [et_pb_line_break_holder] -->document.getElementById('deleteWinner').onclick=()=>{els.status.textContent='Past winner is already auto-deleted after every spin.'};<!-- [et_pb_line_break_holder] -->entries=[{name:'Demo A',weight:5},{name:'Demo B',weight:2},{name:'Demo C',weight:8},{name:'Demo D',weight:1},{name:'Demo E',weight:4}];update();drawWheel();<!-- [et_pb_line_break_holder] --><\/script><!-- [et_pb_line_break_holder] --><\/body><!-- [et_pb_line_break_holder] --><\/html><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->[\/et_pb_fullwidth_code][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page-template-blank.php","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_themeisle_gutenberg_block_has_review":false,"footnotes":""},"class_list":["post-1636","page","type-page","status-publish","hentry"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Cabutan Bertuah - Emas untuk e.Mas Cabutan BertuahEmas untuk e.MasSPIN Entry &amp; Controls CSV import: columns name, weight Supports tens of thousands of rows. Weight must be a positive number. Names are never displayed on the wheel. 0Entries0Total weight0Winners RandomizerPast Winner Auto-Deleted Click the KAB Gold logo in the center of the wheel to spin.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/kabgold.my\/index.php\/cabutan-bertuah\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"KAB Gold - Gold Trading Company\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Cabutan Bertuah - KAB Gold\" \/>\n\t\t<meta property=\"og:description\" content=\"Cabutan Bertuah - Emas untuk e.Mas Cabutan BertuahEmas untuk e.MasSPIN Entry &amp; Controls CSV import: columns name, weight Supports tens of thousands of rows. Weight must be a positive number. Names are never displayed on the wheel. 0Entries0Total weight0Winners RandomizerPast Winner Auto-Deleted Click the KAB Gold logo in the center of the wheel to spin.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/kabgold.my\/index.php\/cabutan-bertuah\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-07-03T06:36:23+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-07-03T06:52:48+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Cabutan Bertuah - KAB Gold\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Cabutan Bertuah - Emas untuk e.Mas Cabutan BertuahEmas untuk e.MasSPIN Entry &amp; Controls CSV import: columns name, weight Supports tens of thousands of rows. Weight must be a positive number. Names are never displayed on the wheel. 0Entries0Total weight0Winners RandomizerPast Winner Auto-Deleted Click the KAB Gold logo in the center of the wheel to spin.\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kabgold.my\\\/index.php\\\/cabutan-bertuah\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kabgold.my#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/kabgold.my\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kabgold.my\\\/index.php\\\/cabutan-bertuah\\\/#listItem\",\"name\":\"Cabutan Bertuah\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kabgold.my\\\/index.php\\\/cabutan-bertuah\\\/#listItem\",\"position\":2,\"name\":\"Cabutan Bertuah\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kabgold.my#listItem\",\"name\":\"Home\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/kabgold.my\\\/#organization\",\"name\":\"kabgold\",\"description\":\"Gold Trading Company\",\"url\":\"https:\\\/\\\/kabgold.my\\\/\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kabgold.my\\\/index.php\\\/cabutan-bertuah\\\/#webpage\",\"url\":\"https:\\\/\\\/kabgold.my\\\/index.php\\\/cabutan-bertuah\\\/\",\"name\":\"Cabutan Bertuah - KAB Gold\",\"description\":\"Cabutan Bertuah - Emas untuk e.Mas Cabutan BertuahEmas untuk e.MasSPIN Entry & Controls CSV import: columns name, weight Supports tens of thousands of rows. Weight must be a positive number. Names are never displayed on the wheel. 0Entries0Total weight0Winners RandomizerPast Winner Auto-Deleted Click the KAB Gold logo in the center of the wheel to spin.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kabgold.my\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kabgold.my\\\/index.php\\\/cabutan-bertuah\\\/#breadcrumblist\"},\"datePublished\":\"2026-07-03T06:36:23+00:00\",\"dateModified\":\"2026-07-03T06:52:48+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kabgold.my\\\/#website\",\"url\":\"https:\\\/\\\/kabgold.my\\\/\",\"name\":\"kabgold\",\"description\":\"Gold Trading Company\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/kabgold.my\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Cabutan Bertuah - KAB Gold","description":"Cabutan Bertuah - Emas untuk e.Mas Cabutan BertuahEmas untuk e.MasSPIN Entry & Controls CSV import: columns name, weight Supports tens of thousands of rows. Weight must be a positive number. Names are never displayed on the wheel. 0Entries0Total weight0Winners RandomizerPast Winner Auto-Deleted Click the KAB Gold logo in the center of the wheel to spin.","canonical_url":"https:\/\/kabgold.my\/index.php\/cabutan-bertuah\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/kabgold.my\/index.php\/cabutan-bertuah\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/kabgold.my#listItem","position":1,"name":"Home","item":"https:\/\/kabgold.my","nextItem":{"@type":"ListItem","@id":"https:\/\/kabgold.my\/index.php\/cabutan-bertuah\/#listItem","name":"Cabutan Bertuah"}},{"@type":"ListItem","@id":"https:\/\/kabgold.my\/index.php\/cabutan-bertuah\/#listItem","position":2,"name":"Cabutan Bertuah","previousItem":{"@type":"ListItem","@id":"https:\/\/kabgold.my#listItem","name":"Home"}}]},{"@type":"Organization","@id":"https:\/\/kabgold.my\/#organization","name":"kabgold","description":"Gold Trading Company","url":"https:\/\/kabgold.my\/"},{"@type":"WebPage","@id":"https:\/\/kabgold.my\/index.php\/cabutan-bertuah\/#webpage","url":"https:\/\/kabgold.my\/index.php\/cabutan-bertuah\/","name":"Cabutan Bertuah - KAB Gold","description":"Cabutan Bertuah - Emas untuk e.Mas Cabutan BertuahEmas untuk e.MasSPIN Entry & Controls CSV import: columns name, weight Supports tens of thousands of rows. Weight must be a positive number. Names are never displayed on the wheel. 0Entries0Total weight0Winners RandomizerPast Winner Auto-Deleted Click the KAB Gold logo in the center of the wheel to spin.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/kabgold.my\/#website"},"breadcrumb":{"@id":"https:\/\/kabgold.my\/index.php\/cabutan-bertuah\/#breadcrumblist"},"datePublished":"2026-07-03T06:36:23+00:00","dateModified":"2026-07-03T06:52:48+00:00"},{"@type":"WebSite","@id":"https:\/\/kabgold.my\/#website","url":"https:\/\/kabgold.my\/","name":"kabgold","description":"Gold Trading Company","inLanguage":"en-US","publisher":{"@id":"https:\/\/kabgold.my\/#organization"}}]},"og:locale":"en_US","og:site_name":"KAB Gold - Gold Trading Company","og:type":"article","og:title":"Cabutan Bertuah - KAB Gold","og:description":"Cabutan Bertuah - Emas untuk e.Mas Cabutan BertuahEmas untuk e.MasSPIN Entry &amp; Controls CSV import: columns name, weight Supports tens of thousands of rows. Weight must be a positive number. Names are never displayed on the wheel. 0Entries0Total weight0Winners RandomizerPast Winner Auto-Deleted Click the KAB Gold logo in the center of the wheel to spin.","og:url":"https:\/\/kabgold.my\/index.php\/cabutan-bertuah\/","article:published_time":"2026-07-03T06:36:23+00:00","article:modified_time":"2026-07-03T06:52:48+00:00","twitter:card":"summary_large_image","twitter:title":"Cabutan Bertuah - KAB Gold","twitter:description":"Cabutan Bertuah - Emas untuk e.Mas Cabutan BertuahEmas untuk e.MasSPIN Entry &amp; Controls CSV import: columns name, weight Supports tens of thousands of rows. Weight must be a positive number. Names are never displayed on the wheel. 0Entries0Total weight0Winners RandomizerPast Winner Auto-Deleted Click the KAB Gold logo in the center of the wheel to spin."},"aioseo_meta_data":{"post_id":"1636","title":null,"description":null,"keywords":null,"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"WebPage","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"created":"2026-07-03 06:30:02","updated":"2026-07-03 08:57:22","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/kabgold.my\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tCabutan Bertuah\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/kabgold.my"},{"label":"Cabutan Bertuah","link":"https:\/\/kabgold.my\/index.php\/cabutan-bertuah\/"}],"_links":{"self":[{"href":"https:\/\/kabgold.my\/index.php\/wp-json\/wp\/v2\/pages\/1636","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kabgold.my\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/kabgold.my\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/kabgold.my\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/kabgold.my\/index.php\/wp-json\/wp\/v2\/comments?post=1636"}],"version-history":[{"count":12,"href":"https:\/\/kabgold.my\/index.php\/wp-json\/wp\/v2\/pages\/1636\/revisions"}],"predecessor-version":[{"id":1658,"href":"https:\/\/kabgold.my\/index.php\/wp-json\/wp\/v2\/pages\/1636\/revisions\/1658"}],"wp:attachment":[{"href":"https:\/\/kabgold.my\/index.php\/wp-json\/wp\/v2\/media?parent=1636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}