| <!DOCTYPE html> |
| <html lang="id"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <meta property="og:url" content="" /> |
| <meta property="og:title" PIJAR4D- Spin & Win" /> |
| <meta property="og:description" content="Putar roda keberuntungan dan menangkan hadiah hingga 200 ribu! Gratis dan mudah." /> |
| <meta property="og:type" content="website" /> |
| <meta property="og:image" content="https://motifninja.com/images/logo.png" /> |
| <meta property="og:image:width" content="1200" /> |
| <meta property="og:image:height" content="630" /> |
| <meta name="twitter:card" content="summary_large_image" /> |
| <meta name="twitter:site" content="@replit" /> |
| <meta name="twitter:title" content="PIJAR4D- Spin & Win" /> |
| <meta name="twitter:description" content="Putar roda keberuntungan dan menangkan hadiah hingga 200 ribu! Gratis dan mudah." /> |
| <meta name="twitter:image" content="https://pijartaff.com/images/logo.png" /> |
| <title>PIJAR4D - Spin & Win Lucky Wheel</title> |
| <style> |
| * { |
| margin: 0; |
| padding: 0; |
| box-sizing: border-box; |
| } |
|
| body, html { |
| margin: 0; |
| padding: 0; |
| width: 100%; |
| height: 100%; |
| } |
|
| .container { |
| min-height: 100vh; |
| background: linear-gradient( |
| 135deg, |
| #0f0f1e 0%, |
| #1a0f2e 50%, |
| #0f1f2e 100% |
| ); |
| } |
|
| color: #ffffff; |
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; |
| overflow-x: hidden; |
| } |
|
| .container { |
| max-width: 1200px; |
| margin: 0 auto; |
| padding: 20px; |
| } |
|
| header { |
| text-align: center; |
| padding: 30px 20px; |
| position: relative; |
| z-index: 10; |
| background: linear-gradient(to bottom, rgba(15, 15, 30, 0.8), rgba(15, 15, 30, 0.5)); |
| } |
|
| .logo-wrapper { |
| position: relative; |
| display: inline-block; |
| margin-bottom: 20px; |
| animation: fadeInDown 0.6s ease-out; |
| } |
|
| @keyframes fadeInDown { |
| from { |
| opacity: 0; |
| transform: translateY(-20px); |
| } |
| to { |
| opacity: 1; |
| transform: translateY(0); |
| } |
| } |
|
| .logo { |
| height: 100px; |
| display: block; |
| filter: drop-shadow(0 10px 25px rgba(0,0,0,0.5)); |
| position: relative; |
| z-index: 11; |
| } |
|
| .logo-image { |
| height: 120px; |
| width: auto; |
| max-width: 300px; |
| display: block; |
| filter: drop-shadow(0 10px 25px rgba(0,0,0,0.5)); |
| position: relative; |
| z-index: 11; |
| } |
|
| h1 { |
| font-size: 3rem; |
| font-weight: 900; |
| margin-bottom: 10px; |
| color: #ffffff; |
| animation: fadeIn 0.8s ease-out; |
| position: relative; |
| z-index: 11; |
| } |
|
| h1 .highlight { |
| color: #FFD700; |
| animation: pulse 2s infinite; |
| } |
|
| @keyframes fadeIn { |
| from { |
| opacity: 0; |
| } |
| to { |
| opacity: 1; |
| } |
| } |
|
| @keyframes pulse { |
| 0%, 100% { opacity: 1; } |
| 50% { opacity: 0.7; } |
| } |
|
| .subtitle { |
| font-size: 1.5rem; |
| color: rgba(255, 255, 255, 0.8); |
| font-weight: 500; |
| margin-bottom: 30px; |
| animation: fadeIn 1s ease-out; |
| position: relative; |
| z-index: 11; |
| } |
|
| .main-content { |
| display: grid; |
| grid-template-columns: 1fr 1fr; |
| gap: 40px; |
| align-items: start; |
| margin-bottom: 40px; |
| } |
|
| @media (max-width: 768px) { |
| .main-content { |
| grid-template-columns: 1fr; |
| gap: 30px; |
| } |
| h1 { |
| font-size: 2rem; |
| } |
| .subtitle { |
| font-size: 1.1rem; |
| } |
| } |
|
| .wheel-container { |
| position: relative; |
| display: flex; |
| justify-content: center; |
| align-items: center; |
| } |
|
| .wheel-wrapper { |
| position: relative; |
| width: 350px; |
| height: 350px; |
| max-width: 100%; |
| } |
|
| .pointer { |
| position: absolute; |
| top: -20px; |
| left: 50%; |
| transform: translateX(-50%); |
| z-index: 30; |
| width: 50px; |
| height: 60px; |
| filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5)); |
| } |
|
| .pointer svg { |
| width: 100%; |
| height: 100%; |
| } |
|
| .wheel-outer { |
| width: 100%; |
| height: 100%; |
| border-radius: 50%; |
| padding: 15px; |
| background: linear-gradient(to bottom, #D4A500, #996600); |
| box-shadow: 0 0 50px rgba(0,0,0,0.8), inset 0 0 20px rgba(0,0,0,0.3); |
| border: 4px solid #664400; |
| position: relative; |
| } |
|
| .wheel-inner { |
| width: 100%; |
| height: 100%; |
| border-radius: 50%; |
| background: conic-gradient( |
| from 0deg, |
| #ef4444 0deg 60deg, |
| #ffffff 60deg 120deg, |
| #ef4444 120deg 180deg, |
| #ffffff 180deg 240deg, |
| #ef4444 240deg 300deg, |
| #ffffff 300deg 360deg |
| ); |
| border: 4px solid #664400; |
| box-shadow: inset 0 0 20px rgba(0,0,0,0.2); |
| position: relative; |
| animation: spin-placeholder 0s linear; |
| } |
|
| .wheel-inner.spinning { |
| animation: spin-wheel 6s cubic-bezier(0.15, 0, 0.15, 1) forwards; |
| } |
|
| @keyframes spin-wheel { |
| from { |
| transform: rotate(0deg); |
| } |
| to { |
| transform: rotate(var(--rotation)); |
| } |
| } |
|
| .prize-text { |
| position: absolute; |
| font-weight: 900; |
| font-size: 24px; |
| text-shadow: 0 2px 4px rgba(0,0,0,0.3); |
| } |
|
| .wheel-center { |
| position: absolute; |
| top: 50%; |
| left: 50%; |
| transform: translate(-50%, -50%); |
| width: 60px; |
| height: 60px; |
| border-radius: 50%; |
| background: linear-gradient(to bottom-right, #FFD700, #B8860B); |
| border: 4px solid #664400; |
| box-shadow: 0 0 15px rgba(0,0,0,0.4); |
| z-index: 20; |
| display: flex; |
| align-items: center; |
| justify-content: center; |
| } |
|
| .wheel-center::after { |
| content: ''; |
| width: 35px; |
| height: 35px; |
| border-radius: 50%; |
| background: #CC0000; |
| border: 2px solid #880000; |
| box-shadow: inset 0 0 5px rgba(0,0,0,0.3); |
| } |
|
| .input-section { |
| background: rgba(255, 215, 0, 0.05); |
| backdrop-filter: blur(20px); |
| border: 1px solid rgba(255, 215, 0, 0.2); |
| border-radius: 20px; |
| padding: 30px; |
| box-shadow: 0 0 50px -12px rgba(255, 215, 0, 0.1); |
| margin-bottom: 30px; |
| } |
|
| .input-section h2 { |
| font-size: 1.5rem; |
| margin-bottom: 10px; |
| text-shadow: 0 2px 4px rgba(0,0,0,0.3); |
| } |
|
| .input-section p { |
| color: rgba(255, 255, 255, 0.7); |
| margin-bottom: 20px; |
| font-size: 0.95rem; |
| } |
|
| input { |
| width: 100%; |
| height: 56px; |
| font-size: 18px; |
| text-align: center; |
| font-family: 'Courier New', monospace; |
| letter-spacing: 2px; |
| background: rgba(0, 0, 0, 0.5); |
| border: 2px solid rgba(255, 215, 0, 0.3); |
| border-radius: 10px; |
| color: #FFD700; |
| margin-bottom: 15px; |
| transition: all 0.3s ease; |
| } |
|
| input:focus { |
| outline: none; |
| border-color: #FFD700; |
| box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); |
| background: rgba(0, 0, 0, 0.7); |
| } |
|
| input::placeholder { |
| color: rgba(255, 255, 255, 0.3); |
| } |
|
| button { |
| width: 100%; |
| height: 64px; |
| font-size: 24px; |
| font-weight: 900; |
| letter-spacing: 2px; |
| background: linear-gradient(to bottom, #FFD700, #CCAA00); |
| color: #000000; |
| border: 4px solid #997700; |
| border-radius: 10px; |
| cursor: pointer; |
| transition: all 0.2s ease; |
| box-shadow: 0 0 30px rgba(255, 215, 0, 0.4); |
| font-family: inherit; |
| } |
|
| button:hover:not(:disabled) { |
| transform: scale(1.02); |
| box-shadow: 0 0 40px rgba(255, 215, 0, 0.6); |
| background: linear-gradient(to bottom, #FFED4E, #FFD700); |
| } |
|
| button:active:not(:disabled) { |
| transform: scale(0.98); |
| box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); |
| } |
|
| button:disabled { |
| opacity: 0.6; |
| cursor: not-allowed; |
| } |
|
| .jackpot-display { |
| display: flex; |
| flex-direction: column; |
| align-items: center; |
| gap: 5px; |
| padding-top: 15px; |
| } |
|
| .jackpot-label { |
| font-size: 0.85rem; |
| color: rgba(255, 255, 255, 0.6); |
| } |
|
| .jackpot-amount { |
| font-size: 1.3rem; |
| font-weight: bold; |
| color: #4ade80; |
| font-family: 'Courier New', monospace; |
| letter-spacing: 1px; |
| } |
|
| .spun-message { |
| text-align: center; |
| padding: 15px; |
| background: rgba(239, 68, 68, 0.2); |
| border: 1px solid rgba(239, 68, 68, 0.5); |
| border-radius: 8px; |
| color: rgba(248, 113, 113, 0.9); |
| animation: pulse 2s infinite; |
| margin-bottom: 20px; |
| } |
|
| .winners-section { |
| background: rgba(0, 0, 0, 0.3); |
| backdrop-filter: blur(20px); |
| border: 1px solid rgba(255, 255, 255, 0.1); |
| border-radius: 15px; |
| overflow: hidden; |
| } |
|
| .winners-header { |
| background: linear-gradient(to right, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05)); |
| padding: 15px 20px; |
| border-bottom: 1px solid rgba(255, 215, 255, 0.1); |
| font-weight: bold; |
| font-size: 1.1rem; |
| } |
|
| .winners-table { |
| width: 100%; |
| border-collapse: collapse; |
| max-height: 300px; |
| overflow-y: auto; |
| display: block; |
| scrollbar-width: thin; |
| scrollbar-color: rgba(255, 215, 0, 0.3) rgba(0, 0, 0, 0.2); |
| } |
|
| .winners-table::-webkit-scrollbar { |
| width: 6px; |
| } |
|
| .winners-table::-webkit-scrollbar-track { |
| background: rgba(0, 0, 0, 0.2); |
| } |
|
| .winners-table::-webkit-scrollbar-thumb { |
| background: rgba(255, 215, 0, 0.3); |
| border-radius: 3px; |
| } |
|
| .winners-table::-webkit-scrollbar-thumb:hover { |
| background: rgba(255, 215, 0, 0.5); |
| } |
|
| .winners-table-header { |
| display: grid; |
| grid-template-columns: 60px 1fr 150px; |
| gap: 10px; |
| padding: 12px 20px; |
| background: rgba(0, 0, 0, 0.5); |
| font-weight: bold; |
| color: #FFD700; |
| position: sticky; |
| top: 0; |
| z-index: 100; |
| border-bottom: 2px solid rgba(255, 215, 0, 0.3); |
| backdrop-filter: blur(10px); |
| } |
|
| .winners-table-row { |
| display: grid; |
| grid-template-columns: 60px 1fr 150px; |
| gap: 10px; |
| padding: 12px 20px; |
| border-bottom: 1px solid rgba(255, 255, 255, 0.05); |
| align-items: center; |
| animation: slideInLeft 0.3s ease-out; |
| } |
|
| @keyframes slideInLeft { |
| from { |
| opacity: 0; |
| transform: translateX(-20px); |
| } |
| to { |
| opacity: 1; |
| transform: translateX(0); |
| } |
| } |
|
| .winners-table-row:hover { |
| background: rgba(255, 255, 255, 0.02); |
| } |
|
| .winner-no { |
| font-family: 'Courier New', monospace; |
| color: rgba(255, 255, 255, 0.6); |
| text-align: center; |
| } |
|
| .winner-id { |
| font-weight: 500; |
| color: #ffffff; |
| text-transform: uppercase; |
| } |
|
| .winner-prize { |
| text-align: right; |
| font-weight: bold; |
| color: #4ade80; |
| } |
|
| .modal { |
| display: none; |
| position: fixed; |
| top: 0; |
| left: 0; |
| width: 100%; |
| height: 100%; |
| background: rgba(0, 0, 0, 0.8); |
| z-index: 1000; |
| align-items: center; |
| justify-content: center; |
| } |
|
| .modal.show { |
| display: flex; |
| } |
|
| .modal-content { |
| background: linear-gradient(135deg, rgba(20, 10, 40, 0.95), rgba(30, 20, 50, 0.95)); |
| border: 2px solid rgba(255, 215, 0, 0.5); |
| border-radius: 20px; |
| padding: 40px; |
| text-align: center; |
| max-width: 500px; |
| width: 90%; |
| box-shadow: 0 0 60px rgba(255, 215, 0, 0.3); |
| animation: zoomIn 0.3s ease-out; |
| } |
|
| @keyframes zoomIn { |
| from { |
| opacity: 0; |
| transform: scale(0.9); |
| } |
| to { |
| opacity: 1; |
| transform: scale(1); |
| } |
| } |
|
| .modal-content h1 { |
| font-size: 2.5rem; |
| margin-bottom: 10px; |
| } |
|
| .modal-content p { |
| color: rgba(255, 255, 255, 0.8); |
| margin-bottom: 20px; |
| font-size: 1.1rem; |
| } |
|
| .prize-amount { |
| font-size: 3rem; |
| font-weight: 900; |
| color: #FFD700; |
| margin: 30px 0; |
| animation: bounce 0.6s ease-in-out infinite; |
| } |
|
| @keyframes bounce { |
| 0%, 100% { transform: translateY(0); } |
| 50% { transform: translateY(-10px); } |
| } |
|
| .modal-content button { |
| margin-top: 20px; |
| max-width: 300px; |
| margin-left: auto; |
| margin-right: auto; |
| } |
|
| .floating-chat { |
| position: fixed; |
| bottom: 30px; |
| right: 30px; |
| z-index: 100; |
| } |
|
| .chat-button { |
| width: 60px; |
| height: 60px; |
| border-radius: 50%; |
| background: linear-gradient(to right, #10b981, #059669); |
| border: 3px solid rgba(255, 255, 255, 0.2); |
| cursor: pointer; |
| display: flex; |
| align-items: center; |
| justify-content: center; |
| box-shadow: 0 0 20px rgba(16, 185, 129, 0.4); |
| animation: float 3s ease-in-out infinite; |
| transition: transform 0.2s ease; |
| } |
|
| .chat-button:hover { |
| transform: scale(1.1); |
| } |
|
| @keyframes float { |
| 0%, 100% { transform: translateY(0); } |
| 50% { transform: translateY(-10px); } |
| } |
|
| .chat-button svg { |
| width: 32px; |
| height: 32px; |
| color: white; |
| } |
|
| .mute-button { |
| position: fixed; |
| top: 20px; |
| right: 20px; |
| width: 50px; |
| height: 50px; |
| border-radius: 50%; |
| background: rgba(0, 0, 0, 0.5); |
| border: 2px solid rgba(255, 255, 255, 0.2); |
| color: white; |
| cursor: pointer; |
| display: flex; |
| align-items: center; |
| justify-content: center; |
| z-index: 50; |
| transition: all 0.3s ease; |
| } |
|
| .mute-button:hover { |
| background: rgba(0, 0, 0, 0.7); |
| border-color: rgba(255, 255, 255, 0.4); |
| } |
|
| .mute-button svg { |
| width: 24px; |
| height: 24px; |
| } |
|
| .pulse-ring { |
| position: absolute; |
| top: 50%; |
| left: 50%; |
| width: 60px; |
| height: 60px; |
| border: 3px solid rgba(16, 185, 129, 0.3); |
| border-radius: 50%; |
| transform: translate(-50%, -50%); |
| animation: pulse-ring 2s ease-in-out infinite; |
| pointer-events: none; |
| } |
|
| @keyframes pulse-ring { |
| 0% { |
| transform: translate(-50%, -50%) scale(1); |
| opacity: 1; |
| } |
| 100% { |
| transform: translate(-50%, -50%) scale(1.5); |
| opacity: 0; |
| } |
| } |
| </style> |
| <link rel="me" href="https://i.pinimg.com/736x/63/52/c8/6352c874b5af7ff6a80b77a4c0d01e20.jpg" /> |
| <meta name='google-adsense-platform-account' content='ca-host-pub-1556223355139109'/> |
| <meta name='google-adsense-platform-domain' content='blogspot.com'/> |
| <style type="text/css">@import url(//www.blogger.com/static/v1/v-css/navbar/3334278262-classic.css); |
| div.b-mobile {display:none;} |
| </style> |
|
| <meta name='google-adsense-platform-account' content='ca-host-pub-1556223355139109'/> |
| <meta name='google-adsense-platform-domain' content='blogspot.com'/> |
| <style type="text/css">@import url(//www.blogger.com/static/v1/v-css/navbar/3334278262-classic.css); |
| div.b-mobile {display:none;} |
| </style> |
|
| </head> |
| <body><script type="text/javascript"> |
| function setAttributeOnload(object, attribute, val) { |
| if(window.addEventListener) { |
| window.addEventListener('load', |
| function(){ object[attribute] = val; }, false); |
| } else { |
| window.attachEvent('onload', function(){ object[attribute] = val; }); |
| } |
| } |
| </script> |
| <div id="navbar-iframe-container"></div> |
| <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> |
| <script type="text/javascript"> |
| gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { |
| if (gapi.iframes && gapi.iframes.getContext) { |
| gapi.iframes.getContext().openChild({ |
| url: 'https://www.blogger.com/navbar/6862924449339889760?origin\x3dhttps://lucky-spin-pijar4d.blogspot.com', |
| where: document.getElementById("navbar-iframe-container"), |
| id: "navbar-iframe" |
| }); |
| } |
| }); |
| </script><script type="text/javascript"> |
| function setAttributeOnload(object, attribute, val) { |
| if(window.addEventListener) { |
| window.addEventListener('load', |
| function(){ object[attribute] = val; }, false); |
| } else { |
| window.attachEvent('onload', function(){ object[attribute] = val; }); |
| } |
| } |
| </script> |
| <div id="navbar-iframe-container"></div> |
| <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> |
| <script type="text/javascript"> |
| gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { |
| if (gapi.iframes && gapi.iframes.getContext) { |
| gapi.iframes.getContext().openChild({ |
| url: 'https://www.blogger.com/navbar/5652804863310719910?origin\x3dhttps://akutahanbanting.blogspot.com', |
| where: document.getElementById("navbar-iframe-container"), |
| id: "navbar-iframe" |
| }); |
| } |
| }); |
| </script> |
| <button class="mute-button" id="muteBtn" title="Toggle Sound"> |
| <svg fill="currentColor" viewBox="0 0 24 24" xmlns="https://id.pinterest.com/pin/129689664264525797/"> |
| <path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.26 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/> |
| </svg> |
| </button> |
|
| <div class="container"> |
| <header> |
| <div class=""> |
| </div> |
| <h1>SELAMAT DATANG DI <span class="highlight">PIJAR4D</span></h1> |
| <p class="subtitle">PUTAR RODANYA & DAPATKAN HADIAH FANTASTIS HINGGA 200 RIBU RUPIAH!</p> |
| </header> |
|
| <div class="main-content"> |
| <div class="wheel-container"> |
| <div class="wheel-wrapper"> |
| <div class="pointer"> |
| <svg viewBox="0 0 48 64" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| <path d="M24 60L4 20C4 20 8 4 24 4C40 4 44 20 44 20L24 60Z" fill="#FFD700" stroke="#B8860B" stroke-width="2"/> |
| <circle cx="24" cy="16" r="8" fill="#FFF" stroke="#B8860B" stroke-width="2"/> |
| </svg> |
| </div> |
| <div class="wheel-outer"> |
| <div class="wheel-inner" id="wheel"> |
| <div class="wheel-center"></div> |
| |
| </div> |
| </div> |
| </div> |
| </div> |
|
| <div> |
| <div class="input-section"> |
| <h2>MASUKAN USER ID</h2> |
| <p>Masukan User ID anda untuk memutar roda keberuntungan!</p> |
| <input type="text" id="userIdInput" placeholder="Contoh: USER123" maxlength="20" /> |
| <button id="spinBtn" onclick="startSpin()">SPIN SEKARANG!</button> |
| <div class="jackpot-display"> |
| <div class="jackpot-label">Total Jackpot</div> |
| <div class="jackpot-amount" id="jackpot">IDR 888.888.888</div> |
| </div> |
| </div> |
| <div id="spunMessage" class="spun-message" style="display: none;"> |
| Kesempatan spin anda sudah habis. Silahkan klaim hadiah anda. |
| </div> |
| <div class="winners-section"> |
| <div class="winners-header">π 50 Daftar Riwayat Spin Terakhir</div> |
| <div class="winners-table" id="winnersTable"> |
| <div class="winners-table-header"> |
| <div>NO</div> |
| <div>USER ID</div> |
| <div>HADIAH</div> |
| </div> |
| |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
|
| <div class="modal" id="prizeModal"> |
| <div class="modal-content"> |
| <h1>SELAMAT!</h1> |
| <p>Anda memenangkan hadiah sebesar</p> |
| <div class="prize-amount" id="prizeAmount">IDR 1.000.000</div> |
| <p>Silahkan hubungi CS untuk klaim hadiah anda dengan screenshot ini.</p> |
| <button onclick="claimPrize()">KLAIM SEKARANG</button> |
| </div> |
| </div> |
|
| <div class="floating-chat"> |
| <div class="pulse-ring"></div> |
| <a href="https://motifninja.com/" target="_blank" rel="noopener noreferrer" class="chat-button" title="Chat CS 24/7"> |
| <svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> |
| <path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"/> |
| </svg> |
| </a> |
| </div> |
|
| <audio id="bgMusic" loop></audio> |
| <audio id="spinSound"></audio> |
| <audio id="winSound"></audio> |
|
| <script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.9.0/dist/confetti.browser.min.js"></script> |
| <script> |
| const PRIZES = ["25K", "50K", "75K", "100K", "150K", "200K"]; |
| const PRIZE_AMOUNTS = ["25.000", "50.000", "75.000", "100.000", "150.000", "200.000"]; |
| |
| let hasSpun = localStorage.getItem("hasSpun") === "true"; |
| let isSpin = false; |
| let currentRotation = 0; |
| let muted = true; |
| let winners = generateMockWinners(); |
| let jackpot = 888888888; |
|
| // Initialize |
| document.addEventListener('DOMContentLoaded', () => { |
| drawWheelPrizes(); |
| renderWinners(); |
| updateUI(); |
| setupAudio(); |
| startJackpotAnimation(); |
| }); |
|
| function generateMockWinners() { |
| return Array.from({ length: 50 }, (_, i) => ({ |
| username: `USER${Math.floor(Math.random() * 9000) + 1000}***`, |
| amount: PRIZE_AMOUNTS[Math.floor(Math.random() * PRIZE_AMOUNTS.length)] |
| })); |
| } |
|
| function drawWheelPrizes() { |
| const wheel = document.getElementById("wheel"); |
| const segmentAngle = 360 / PRIZES.length; |
| |
| PRIZES.forEach((prize, index) => { |
| const angle = index * segmentAngle + segmentAngle / 2; |
| const div = document.createElement('div'); |
| div.className = 'prize-text'; |
| div.textContent = prize; |
| |
| const isWhite = (index + 1) % 2 === 0; |
| div.style.color = isWhite ? '#000000' : '#ffffff'; |
| div.style.textShadow = isWhite ? 'none' : '0 2px 4px rgba(0,0,0,0.5)'; |
| |
| const radius = 100; |
| const x = Math.cos((angle - 90) * Math.PI / 180) * radius; |
| const y = Math.sin((angle - 90) * Math.PI / 180) * radius; |
| |
| div.style.left = `calc(50% + ${x}px - 20px)`; |
| div.style.top = `calc(50% + ${y}px - 20px)`; |
| |
| wheel.appendChild(div); |
| }); |
| } |
|
| function setupAudio() { |
| const bgMusic = document.getElementById('bgMusic'); |
| const spinSound = document.getElementById('spinSound'); |
| const winSound = document.getElementById('winSound'); |
| |
| bgMusic.src = 'https://cdn.pixabay.com/download/audio/2022/03/24/audio_197846c632.mp3?filename=casino-music-1-2518.mp3'; |
| spinSound.src = 'https://assets.mixkit.co/active_storage/sfx/2003/2003-preview.mp3'; |
| winSound.src = 'https://assets.mixkit.co/active_storage/sfx/2019/2019-preview.mp3'; |
| |
| bgMusic.volume = 0.3; |
| spinSound.volume = 0.6; |
| winSound.volume = 0.8; |
| |
| // Try to play on page load |
| setTimeout(() => { |
| if (!muted) { |
| bgMusic.play().catch(e => console.log('Autoplay blocked by browser')); |
| } |
| }, 500); |
| |
| // Also try on first click/interaction anywhere on page |
| document.addEventListener('click', () => { |
| if (!muted && bgMusic.paused) { |
| bgMusic.play().catch(e => console.log('Autoplay blocked')); |
| } |
| }); |
| } |
|
| function toggleMute() { |
| muted = !muted; |
| const bgMusic = document.getElementById('bgMusic'); |
| const muteBtn = document.getElementById('muteBtn'); |
| |
| if (muted) { |
| bgMusic.pause(); |
| muteBtn.innerHTML = '<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16.6915026,12.4744748 L3.50612381,13.2599618 C3.19218622,13.2599618 3.03521743,13.4170592 3.03521743,13.5741566 L1.15159189,20.0151496 C0.8376543,20.8006365 0.99,21.89 1.77946707,22.52 C2.41,22.99 3.50612381,23.1 4.13399899,22.8429026 L21.714504,14.0454487 C22.6563168,13.5741566 23.1272231,12.6315722 22.9702544,11.6889879 L4.13399899,1.16751336 C3.34915502,0.9104159 2.40734225,1.02605983 1.77946707,1.4973519 C0.994623095,2.13399899 0.837654299,3.22259692 1.15159189,3.95411374 L3.03521743,10.3951066 C3.03521743,10.5522041 3.34915502,10.7093015 3.50612381,10.7093015 L16.6915026,11.4947884 C16.6915026,11.4947884 17.1624089,11.4947884 17.1624089,11.0234963 L17.1624089,12.6315722 C17.1624089,12.4744748 16.6915026,12.4744748 16.6915026,12.4744748 Z"/></svg>'; |
| muteBtn.style.opacity = '0.5'; |
| } else { |
| bgMusic.play().catch(e => console.log('Autoplay blocked')); |
| muteBtn.innerHTML = '<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.26 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/></svg>'; |
| muteBtn.style.opacity = '1'; |
| } |
| } |
|
| document.getElementById('muteBtn').addEventListener('click', toggleMute); |
|
| function startJackpotAnimation() { |
| setInterval(() => { |
| const change = Math.floor(Math.random() * 20000) - 5000; |
| jackpot = Math.max(800000000, jackpot + change); |
| document.getElementById('jackpot').textContent = `IDR ${jackpot.toLocaleString('id-ID')}`; |
| }, 1000); |
| } |
|
| function startSpin() { |
| const userIdInput = document.getElementById('userIdInput'); |
| const userId = userIdInput.value.trim(); |
| |
| if (!userId) { |
| alert('Masukan User ID terlebih dahulu!'); |
| return; |
| } |
| |
| if (hasSpun) { |
| alert('Anda sudah melakukan spin! Kesempatan hanya 1x.'); |
| return; |
| } |
| |
| if (isSpin) return; |
| |
| isSpin = true; |
| const spinBtn = document.getElementById('spinBtn'); |
| spinBtn.disabled = true; |
| spinBtn.textContent = 'SPINNING...'; |
| |
| // Play spin sound |
| if (!muted) { |
| const spinSound = document.getElementById('spinSound'); |
| spinSound.currentTime = 0; |
| spinSound.play().catch(e => console.log('Audio play failed')); |
| } |
| |
| // Random antara 25K, 50K, 100K (index 3, 4, 5) |
| const highPrizes = [3, 4, 5]; |
| const prizeIndex = highPrizes[Math.floor(Math.random() * highPrizes.length)]; |
| const selectedPrize = PRIZES[prizeIndex]; |
| const formattedAmount = PRIZE_AMOUNTS[prizeIndex]; |
| |
| // Calculate rotation |
| const segmentAngle = 360 / PRIZES.length; // 60 |
| const currentSegmentCenter = (prizeIndex * segmentAngle) + (segmentAngle / 2); |
| const rotationNeeded = 360 - currentSegmentCenter; |
| const fullSpins = 360 * (8 + Math.floor(Math.random() * 4)); |
| const randomOffset = (Math.random() - 0.5) * (segmentAngle * 0.6); |
| |
| const currentRotationMod = currentRotation % 360; |
| const distanceToNextZero = 360 - currentRotationMod; |
| const totalRotation = currentRotation + distanceToNextZero + fullSpins + rotationNeeded + randomOffset; |
| |
| currentRotation = totalRotation; |
| |
| // Animate wheel |
| const wheel = document.getElementById('wheel'); |
| wheel.classList.add('spinning'); |
| wheel.style.setProperty('--rotation', totalRotation + 'deg'); |
| |
| setTimeout(() => { |
| wheel.classList.remove('spinning'); |
| wheel.style.transform = `rotate(${totalRotation}deg)`; |
| |
| // Play win sound |
| if (!muted) { |
| const winSound = document.getElementById('winSound'); |
| winSound.currentTime = 0; |
| winSound.play().catch(e => console.log('Audio play failed')); |
| } |
| |
| // Stop spin sound |
| const spinSound = document.getElementById('spinSound'); |
| spinSound.pause(); |
| spinSound.currentTime = 0; |
| |
| // Show prize |
| document.getElementById('prizeAmount').textContent = `IDR ${formattedAmount}`; |
| document.getElementById('prizeModal').classList.add('show'); |
| |
| // Add to winners |
| winners.unshift({ username: userId, amount: formattedAmount }); |
| winners = winners.slice(0, 50); |
| renderWinners(); |
| |
| // Mark as spun |
| hasSpun = true; |
| localStorage.setItem('hasSpun', 'true'); |
| updateUI(); |
| |
| // Confetti |
| celebrateWin(); |
| |
| isSpin = false; |
| }, 6000); |
| } |
|
| function updateUI() { |
| const spinBtn = document.getElementById('spinBtn'); |
| const userIdInput = document.getElementById('userIdInput'); |
| const spunMessage = document.getElementById('spunMessage'); |
| |
| if (hasSpun) { |
| spinBtn.disabled = true; |
| spinBtn.textContent = 'SUDAH SPIN'; |
| userIdInput.disabled = true; |
| spunMessage.style.display = 'block'; |
| } else { |
| spinBtn.disabled = false; |
| spinBtn.textContent = 'SPIN SEKARANG!'; |
| userIdInput.disabled = false; |
| spunMessage.style.display = 'none'; |
| } |
| } |
|
| function renderWinners() { |
| const table = document.getElementById('winnersTable'); |
| const header = table.querySelector('.winners-table-header'); |
| table.innerHTML = header.outerHTML; |
| |
| winners.forEach((winner, index) => { |
| const row = document.createElement('div'); |
| row.className = 'winners-table-row'; |
| row.innerHTML = ` |
| <div class="winner-no">${index + 1}</div> |
| <div class="winner-id">${winner.username}</div> |
| <div class="winner-prize">IDR ${winner.amount}</div> |
| `; |
| table.appendChild(row); |
| }); |
| } |
|
| function claimPrize() { |
| window.location.href = 'https://motifninja.com/'; |
| } |
|
| function celebrateWin() { |
| const duration = 3000; |
| const end = Date.now() + duration; |
| |
| const frame = () => { |
| confetti({ |
| particleCount: 5, |
| angle: 60, |
| spread: 55, |
| origin: { x: 0 }, |
| colors: ['#FFD700', '#ff0000', '#ffffff'] |
| }); |
| confetti({ |
| particleCount: 5, |
| angle: 120, |
| spread: 55, |
| origin: { x: 1 }, |
| colors: ['#FFD700', '#ff0000', '#ffffff'] |
| }); |
| |
| if (Date.now() < end) { |
| requestAnimationFrame(frame); |
| } |
| }; |
| frame(); |
| } |
|
| // Close modal on background click |
| document.getElementById('prizeModal').addEventListener('click', (e) => { |
| if (e.target.id === 'prizeModal') { |
| document.getElementById('prizeModal').classList.remove('show'); |
| } |
| }); |
| </script> |
| </body> |
| </html> |
|
|
|
|
|
|
Komentar
Posting Komentar