/* =====================================================
KONFIGURASI AI (EDIT CUMA DI SINI)
===================================================== */
const AI_CONFIG = {
ai1: {
name: 'AI GRAND FORTUNE SUPER SCATTER',
rules: [
['pgsoft%2F135.png', 'https://ik.imagekit.io/oetjb6zot/Wild-Bounty-rjs69.gif']
]
},
};
const STORAGE_KEY = 'qp_ai_states';
/* =====================================================
STATE HELPER
===================================================== */
function getAIStates(){
try {
return JSON.parse(localStorage.getItem(STORAGE_KEY)) || {};
} catch {
return {};
}
}
function setAIState(key, value){
const states = getAIStates();
states[key] = value;
localStorage.setItem(STORAGE_KEY, JSON.stringify(states));
}
/* =====================================================
STYLE
===================================================== */
if (!document.getElementById('qp-style')) {
const style = document.createElement('style');
style.id = 'qp-style';
style.textContent = `
.qp-btn-trigger{
position:fixed;
right:5px;
top:50%;
transform:translateY(-50%);
writing-mode:vertical-rl;
text-orientation:upright;
padding:18px 4px;
font-size:10px;
font-weight:900;
letter-spacing:-1px;
background:linear-gradient(180deg,#f68c1b,#f68c1b,#f68c1b);
color:#fff;
border-radius:18px;
cursor:pointer;
z-index:99999;
animation:qpGlow 2.2s infinite;
}
@keyframes qpGlow{
0%{box-shadow:0 0 8px rgba(246,140,27,1)}
50%{box-shadow:0 0 24px rgba(246,140,27,1)}
100%{box-shadow:0 0 8px rgba(246,140,27,1)}
}
.qp-overlay{
position:fixed;
inset:0;
background:rgba(0,0,0,.5);
display:none;
align-items:center;
justify-content:center;
z-index:100000;
}
.qp-overlay.show{display:flex}
.qp-box{
width:420px;
max-width:92vw;
background:linear-gradient(180deg,#141414,#070707);
border-radius:20px;
padding:22px;
color:#fff;
border:1px solid rgba(246,140,27,1);
box-shadow:0 20px 60px rgba(0,0,0,.6);
}
.qp-header{
display:flex;
justify-content:space-between;
align-items:center;
font-size:18px;
font-weight:900;
}
.qp-close{
background:none;
border:none;
color:#f68c1b;
font-size:18px;
cursor:pointer;
}
.qp-body{
margin-top:18px;
display:flex;
flex-direction:column;
gap:14px;
}
.qp-item{
cursor:pointer;
transition:transform .15s ease, box-shadow .15s ease;
}
.qp-item:hover{
transform:translateY(-2px);
box-shadow:
0 0 0 1px rgba(246,140,27,1),
0 10px 30px rgba(246,140,27,1);
}
.qp-footer{
margin-top:18px;
padding-top:14px;
border-top:1px solid rgba(246,140,27,1);
font-size:12px;
color:rgba(246,140,27,1);
display:flex;
justify-content:space-between;
align-items:center;
}
.qp-footer .qp-left{
opacity:.9;
}
.qp-footer .qp-right{
font-weight:700;
color:#f68c1b;
text-shadow:0 0 6px rgba(246, 140, 27, 1);
}
.qp-toggle{
display:flex;
justify-content:space-between;
align-items:center;
font-weight:700;
font-size:14px;
color:#f68c1b;
}
.qp-toast{
position:fixed;
top:20px;
left:50%;
transform:translateX(-50%);
background:#f68c1b;
color:#fff;
padding:12px 20px;
border-radius:14px;
font-weight:700;
z-index:100001;
opacity:0;
transition:.4s;
}
.qp-toast.show{
opacity:1;
top:32px;
}
.qp-item{
position:relative;
overflow:hidden;
border-radius:18px;
}
.qp-item .flame{
width:45px;
height:450px;
background:linear-gradient(-45deg, #ff1200, #ff7a00);
border-radius:150px 150px 0 150px;
transform:rotate(-135deg);
animation: flameFlicker .20s infinite;
filter: blur(10px);
position:absolute;
top:50%;
left:-220px;
box-shadow:17px 20px 90px #700;
border:45px solid rgba(0,0,0,.85);
border-left-width:25px;
border-top-width:25px;
pointer-events:none;
z-index:5;
}
.qp-item .flame::after,
.qp-item .flame::before{
content:'';
width:100px;
height:100px;
display:block;
position:absolute;
background:linear-gradient(-45deg, #ff1200, #ff7a00);
animation: flameFlicker .40s infinite;
transform:scale(.8) rotate(20deg);
border-radius:100px 100px 0 100px;
top:20px;
left:20px;
}
.qp-item .flame::before{
top:0;
left:10px;
animation-duration:.08s;
transform:scale(.9) rotate(-15deg) translate(10px, 0);
}
/* your flicker */
@keyframes flameFlicker{
0% { width:150px; height:150px; }
50% { width:140px; height:140px; }
100% { width:150px; height:150px; }
}
.qp-item .flame.run{
animation:
flameMove 1650ms ease-out forwards,
flameFlicker .10s infinite;
}
/* translate keeps it smooth */
@keyframes flameMove{
0%{
transform: translate(20%, -50%) rotate(-135deg) scale(.95);
opacity:0;
}
12%{ opacity:1; }
100%{
transform: translate(250%, -50%) rotate(-135deg) scale(1.05);
opacity:0;
}
}
`;
document.head.appendChild(style);
}
/* =====================================================
HTML UI
===================================================== */
function injectUI(){
if (document.querySelector('.qp-btn-trigger')) return;
document.body.insertAdjacentHTML('beforeend',`
CHEAT SLOT AI X10.000
${Object.keys(AI_CONFIG).map(k=>`
`).join('')}
`);
bindUI();
updateFooterStatus();
}
/* =====================================================
TOAST
===================================================== */
function showToast(text){
let t = document.querySelector('.qp-toast');
if (!t){
t = document.createElement('div');
t.className = 'qp-toast';
document.body.appendChild(t);
}
t.textContent = text;
t.classList.add('show');
clearTimeout(t._timer);
t._timer = setTimeout(()=>t.classList.remove('show'),1600);
}
/* =====================================================
IMAGE LOGIC
===================================================== */
const ORIGINAL_SRC = new Map();
const SWAP_CLASS = "ai-img-swapped-img";
const STYLE_ID = "ai-img-swap-style";
function ensureSwapStyle() {
if (document.getElementById(STYLE_ID)) return;
const style = document.createElement("style");
style.id = STYLE_ID;
style.textContent = `
@keyframes aiSwapBlink {
0%, 100% {
outline-color: rgba(0,255,255,.15);
box-shadow: 0 0 0 rgba(92, 63, 9,0);
filter: brightness(1);
}
50% {
outline-color: rgba(0,255,255,.9);
box-shadow: 0 0 22px rgba(92, 63, 9,.55);
filter: brightness(1.06);
}
}
img.${SWAP_CLASS}{
outline: 2px solid rgba(0,255,255,.6);
border-radius: 12px;
animation: aiSwapBlink 0.85s ease-in-out infinite;
will-change: box-shadow, filter, outline-color;
}
`;
document.head.appendChild(style);
}
function rememberOriginal(img) {
if (ORIGINAL_SRC.has(img)) return;
ORIGINAL_SRC.set(img, {
src: img.getAttribute("src"),
srcset: img.getAttribute("srcset")
});
}
function getOriginalUrl(img) {
const orig = ORIGINAL_SRC.get(img);
return (orig && (orig.src || "")) || img.getAttribute("src") || img.src || "";
}
function processImage(img) {
if (!img || img.tagName !== "IMG") return;
ensureSwapStyle();
rememberOriginal(img);
const states = getAIStates();
const originalUrl = getOriginalUrl(img);
let shouldBeSwapped = false;
let nextUrl = null;
Object.keys(AI_CONFIG).forEach((ai) => {
if (!states[ai]) return;
AI_CONFIG[ai].rules.forEach(([find, replace]) => {
if (!shouldBeSwapped && originalUrl.includes(find)) {
shouldBeSwapped = true;
nextUrl = replace;
}
});
});
if (shouldBeSwapped && nextUrl) {
if (img.src !== nextUrl) img.src = nextUrl;
if (img.srcset !== nextUrl) img.srcset = nextUrl;
img.classList.add(SWAP_CLASS);
} else {
const orig = ORIGINAL_SRC.get(img);
if (orig) {
if (orig.src == null) img.removeAttribute("src");
else img.setAttribute("src", orig.src);
if (orig.srcset == null) img.removeAttribute("srcset");
else img.setAttribute("srcset", orig.srcset);
}
img.classList.remove(SWAP_CLASS);
}
}
function replaceImages() {
document.querySelectorAll("img").forEach(processImage);
}
function restoreImages() {
ORIGINAL_SRC.forEach((orig, img) => {
if (!img || img.tagName !== "IMG") return;
if (orig.src == null) img.removeAttribute("src");
else img.setAttribute("src", orig.src);
if (orig.srcset == null) img.removeAttribute("srcset");
else img.setAttribute("srcset", orig.srcset);
img.classList.remove(SWAP_CLASS);
});
}
/* =====================================================
OBSERVER (SPA SAFE)
===================================================== */
const observer = new MutationObserver(muts=>{
const states = getAIStates();
if (!Object.values(states).some(v=>v)) return;
muts.forEach(m=>{
m.addedNodes.forEach(n=>{
if (n.tagName === 'IMG') processImage(n);
if (n.querySelectorAll) n.querySelectorAll('img').forEach(processImage);
});
});
});
observer.observe(document.body,{childList:true,subtree:true});
(function hookHistory(){
const _pushState = history.pushState;
const _replaceState = history.replaceState;
function onRouteChange(){
const states = getAIStates();
if (Object.values(states).some(v=>v)) {
// kasih delay dikit biar DOM homepage kelar dirender
setTimeout(replaceImages, 300);
setTimeout(replaceImages, 800);
}
}
history.pushState = function(){
_pushState.apply(this, arguments);
onRouteChange();
};
history.replaceState = function(){
_replaceState.apply(this, arguments);
onRouteChange();
};
window.addEventListener('popstate', onRouteChange);
})();
/* =====================================================
ANIMASI API BERJALAN
===================================================== */
function runFlameAcrossItem(item){
if (!item) return;
const old = item.querySelector('.flame');
if (old) old.remove();
const flame = document.createElement('div');
flame.className = 'flame run';
item.appendChild(flame);
setTimeout(()=>flame.remove(), 3550);
}
/* =====================================================
BIND UI
===================================================== */
function bindUI(){
const btn = document.querySelector('.qp-btn-trigger');
const overlay = document.querySelector('.qp-overlay');
const close = document.querySelector('.qp-close');
btn.onclick = ()=>overlay.classList.add('show');
close.onclick = ()=>overlay.classList.remove('show');
overlay.onclick = e=>{
if (e.target === overlay) overlay.classList.remove('show');
};
const states = getAIStates();
document.querySelectorAll('[data-ai]').forEach(cb=>{
const key = cb.dataset.ai;
const item = cb.closest('.qp-item');
cb.checked = !!states[key];
function applyChange(){
setAIState(key, cb.checked);
if (cb.checked){
showToast(`✅ ${AI_CONFIG[key].name} AKTIF 🧧`);
runFlameAcrossItem(item);
replaceImages();
} else {
showToast(`â›” ${AI_CONFIG[key].name} NONAKTIF`);
restoreImages();
replaceImages();
}
updateFooterStatus();
}
// klik checkbox langsung
cb.onchange = applyChange;
// klik area card
if (item) {
item.onclick = (e)=>{
if (e.target === cb) return;
cb.checked = !cb.checked;
applyChange();
};
}
});
}
function updateFooterStatus(){
const states = getAIStates();
const active = Object.values(states).some(v=>v);
const el = document.querySelector('.qp-footer .qp-right');
if (!el) return;
el.textContent = active ? 'ACTIVE' : 'IDLE';
el.style.color = active ? '#1bff07ff' : '#777';
}
/* =====================================================
INIT LOOP
===================================================== */
setInterval(injectUI,700);