This content covers AI content generator India in detail.
AI Content Generator — India · Research First
/* ══════════════════════════════════════════
TOKENS
══════════════════════════════════════════ */
:root{
–bg:#edf0f7;
–s1:#ffffff;
–s2:#f4f6fc;
–s3:#ebeef7;
–s4:#e2e6f0;
–b1:#d6daea;
–b2:#c2c9dd;
–b3:#adb5ce;
–sf:#d96800;
–sf2:rgba(217,104,0,.10);
–sf3:rgba(217,104,0,.05);
–wh:#ffffff;
–gr:#0a7a05;
–bl:#2d55cc;
–bl2:rgba(45,85,204,.10);
–gd:#a06800;
–gd2:rgba(160,104,0,.10);
–cy:#007fa3;
–em:#0a8a40;
–rd:#c42a2a;
–txt:#1a1e2e;
–mut:#56607a;
–dim:#8a93aa;
–fh:’Unbounded’,sans-serif;
–fb:’Plus Jakarta Sans’,sans-serif;
–fm:’JetBrains Mono’,monospace;
–r:11px; –r2:18px; –tr:.18s;
–top:52px;
–drawer-h:92vh;
}
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box;}
html{scroll-behavior:smooth;height:100%;}
body{background:var(–bg);color:var(–txt);font-family:var(–fb);font-size:14px;line-height:1.65;min-height:100%;overflow-x:hidden;}
/* noise overlay removed for light theme */
::-webkit-scrollbar{width:4px;height:4px;}
::-webkit-scrollbar-track{background:transparent;}
::-webkit-scrollbar-thumb{background:var(–b3);border-radius:4px;}
select option{background:#fff;color:#1a1e2e;}
/* ══════════════════════════════════════════
TOPBAR
══════════════════════════════════════════ */
#top{
position:fixed; top:0; left:0; right:0; z-index:500;
height:var(–top); padding:0 16px;
background:rgba(255,255,255,.97); backdrop-filter:blur(20px); box-shadow:0 1px 0 var(–b1);
border-bottom:1px solid var(–b1);
display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.logo{
font-family:var(–fh); font-size:9px; font-weight:900; letter-spacing:.1em;
background:linear-gradient(90deg,#d96800,#8b3a00 50%,#0a7a05);
-webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
display:flex; align-items:center; gap:7px; white-space:nowrap;
}
.logo-svg{flex-shrink:0;}
.top-r{display:flex; align-items:center; gap:6px;}
.pill{padding:3px 9px; border-radius:100px; border:1px solid; font-size:9px; font-weight:700; letter-spacing:.05em; white-space:nowrap;}
.p-model{background:rgba(0,127,163,.08); border-color:rgba(0,127,163,.25); color:var(–cy); font-family:var(–fm);}
.p-free{background:rgba(255,153,51,.09); border-color:rgba(255,153,51,.25); color:var(–sf);}
.p-used{background:rgba(255,69,69,.09); border-color:rgba(255,69,69,.25); color:var(–rd);}
.p-pro{background:rgba(10,138,64,.1); border-color:rgba(10,138,64,.28); color:var(–em);}
/* mobile settings trigger */
#mob-settings-btn{
display:none;
width:34px; height:34px; border-radius:9px;
background:#f5f7ff; border:1px solid var(–b2);
align-items:center; justify-content:center;
cursor:pointer; font-size:16px; color:var(–sf);
transition:all var(–tr); flex-shrink:0;
}
#mob-settings-btn:hover{background:var(–s3);}
/* ══════════════════════════════════════════
DESKTOP LAYOUT (≥900px)
══════════════════════════════════════════ */
#shell{
margin-top:var(–top);
display:grid;
grid-template-columns:300px 1fr;
height:calc(100vh – var(–top));
overflow:hidden;
}
/* ══════════════════════════════════════════
SIDEBAR (desktop)
══════════════════════════════════════════ */
#sb{
background:var(–s1); border-right:1px solid var(–b1); box-shadow:1px 0 8px rgba(30,50,100,.06);
display:flex; flex-direction:column;
overflow-y:auto; overflow-x:hidden;
position:relative; padding-bottom:72px;
}
.sec{padding:13px 13px 11px; border-bottom:1px solid var(–b1);}
.slbl{font-family:var(–fh); font-size:7.5px; font-weight:700; letter-spacing:.18em; text-transform:uppercase; color:var(–mut); margin-bottom:8px;}
/* selects */
.inp-sel{
width:100%; background:#fff; border:1px solid var(–b2); border-radius:var(–r);
padding:9px 28px 9px 11px; color:var(–txt); font-family:var(–fb); font-size:12px;
outline:none; appearance:none; cursor:pointer; transition:border-color var(–tr);
}
.inp-sel:focus{border-color:var(–sf);}
.sw{position:relative; margin-bottom:7px;}
.sa{position:absolute; right:9px; top:50%; transform:translateY(-50%); color:var(–mut); pointer-events:none; font-size:10px;}
/* language chips */
.lchips{display:flex; flex-wrap:wrap; gap:4px; margin-top:5px;}
.lc{padding:3px 8px; border-radius:6px; font-size:10px; font-weight:600;
background:#fff; border:1px solid var(–b1); color:var(–mut);
cursor:pointer; transition:all var(–tr);}
.lc:hover{border-color:var(–b2); color:var(–txt);}
.lc.on{background:var(–sf2); border-color:rgba(255,153,51,.35); color:var(–sf);}
/* topic */
.tinp{
width:100%; background:#fff; border:1px solid var(–b2); border-radius:var(–r);
padding:9px 11px; color:var(–txt); font-family:var(–fb); font-size:13px;
outline:none; transition:border-color var(–tr); resize:none; min-height:64px;
}
.tinp:focus{border-color:var(–sf);}
.tinp::placeholder{color:var(–dim);}
/* content type grid */
.ctg{display:grid; grid-template-columns:repeat(3,1fr); gap:4px;}
.ctb{
background:#fff; border:1px solid var(–b1); border-radius:9px;
padding:7px 4px; cursor:pointer;
display:flex; flex-direction:column; align-items:center; gap:3px;
transition:all var(–tr);
}
.ctb:hover{background:#f0f2fa; border-color:var(–b2);}
.ctb.on{border-color:var(–sf); background:var(–sf2);}
.ct-ico{font-size:16px; line-height:1;}
.ct-nm{font-size:8.5px; font-weight:600; color:var(–mut); text-align:center; line-height:1.2;}
.ctb.on .ct-nm{color:var(–sf);}
/* tone */
.tone-row{display:flex; flex-wrap:wrap; gap:4px;}
.toneb{padding:3px 9px; border-radius:6px; border:1px solid var(–b1); background:transparent; color:var(–mut); font-size:10px; font-weight:500; cursor:pointer; transition:all var(–tr);}
.toneb:hover{color:var(–txt); border-color:var(–b2);}
.toneb.on{border-color:var(–gd); color:var(–gd); background:rgba(160,104,0,.08);}
/* range */
.rlbl{font-size:10px; color:var(–mut); font-weight:600; letter-spacing:.05em; text-transform:uppercase; display:flex; justify-content:space-between; margin-bottom:6px;}
.rlbl span{color:var(–cy); font-family:var(–fm);}
input[type=range]{-webkit-appearance:none; width:100%; height:3px; background:var(–b2); border-radius:2px; outline:none; cursor:pointer;}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none; width:14px; height:14px; background:var(–sf); border-radius:50%; box-shadow:0 0 9px rgba(255,153,51,.5);}
/* research toggle */
.rtog{display:flex; align-items:center; justify-content:space-between; gap:10px;}
.rtog-txt .rtog-lbl{font-size:12px; font-weight:600; color:var(–txt);}
.rtog-txt .rtog-sub{font-size:10px; color:var(–mut); margin-top:1px;}
.toggle{position:relative; width:42px; height:22px; flex-shrink:0;}
.toggle input{opacity:0; width:0; height:0; position:absolute;}
.tslider{position:absolute; inset:0; background:var(–b2); border-radius:100px; cursor:pointer; transition:background var(–tr);}
.tslider::before{content:”; position:absolute; width:16px; height:16px; left:3px; top:3px; background:#fff; border-radius:50%; transition:transform var(–tr);}
.toggle input:checked+.tslider{background:var(–sf);}
.toggle input:checked+.tslider::before{transform:translateX(20px);}
/* history */
.hi{padding:7px 9px; border-bottom:1px solid var(–b1); cursor:pointer; border-radius:8px; transition:background var(–tr); color:var(–txt);}
.hi:hover{background:var(–s3);}
.hi-t{font-size:11px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(–txt);}
.hi-m{font-size:9px; color:var(–dim); margin-top:1px; display:flex; gap:6px; flex-wrap:wrap;}
/* gen button bar */
.genbar{
position:absolute; bottom:0; left:0; width:100%; padding:10px 13px;
background:linear-gradient(to top,#ffffff 55%,transparent);
}
.genbtn{
width:100%; padding:12px; border:none; border-radius:var(–r);
background:linear-gradient(135deg,var(–sf),#e05a00);
font-family:var(–fh); font-size:10px; font-weight:700; letter-spacing:.08em;
color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center;
gap:7px; transition:all var(–tr); box-shadow:0 4px 20px rgba(255,153,51,.2);
}
.genbtn:hover:not(:disabled){box-shadow:0 8px 30px rgba(255,153,51,.35); transform:translateY(-1px);}
.genbtn:active:not(:disabled){transform:scale(.98);}
.genbtn:disabled{background:var(–dim); color:var(–mut); cursor:not-allowed; box-shadow:none;}
.genbtn.busy .sp{display:block;}
.genbtn.busy .btxt{opacity:.7;}
.sp{width:13px; height:13px; border:2px solid rgba(255,255,255,.25); border-top-color:#fff; border-radius:50%; animation:rot .6s linear infinite; display:none;}
@keyframes rot{to{transform:rotate(360deg);}}
.ftag{background:rgba(255,153,51,.22); border-radius:5px; padding:1px 7px; font-size:9px;}
/* ══════════════════════════════════════════
CONTENT PANE
══════════════════════════════════════════ */
#pane{display:flex; flex-direction:column; overflow:hidden; background:#f7f9ff; border-left:1px solid var(–b1);}
/* tabs */
.tabs{
display:flex; align-items:center;
border-bottom:1px solid var(–b1); padding:0 14px;
background:#fff; flex-shrink:0; overflow-x:auto;
scrollbar-width:none;
}
.tabs::-webkit-scrollbar{display:none;}
.tab{
padding:11px 13px; border:none; background:transparent;
color:var(–mut); font-family:var(–fb); font-size:12px; font-weight:600;
cursor:pointer; border-bottom:2px solid transparent;
transition:all var(–tr); margin-bottom:-1px; white-space:nowrap; flex-shrink:0;
}
.tab:hover{color:var(–txt);}
.tab.on{color:var(–sf); border-bottom-color:var(–sf); font-weight:700;}
.tgap{flex:1; min-width:8px;}
.tbtns{display:flex; gap:5px; align-items:center; flex-shrink:0;}
.tbtn{
padding:5px 10px; background:#f0f2fa; border:1px solid var(–b1);
border-radius:8px; color:var(–mut); font-size:11px; font-weight:500;
cursor:pointer; transition:all var(–tr); white-space:nowrap;
}
.tbtn:hover{border-color:var(–b2); color:var(–txt);}
.tbtn.ok{border-color:var(–em); color:var(–em);}
/* output scroll */
#oscroll{flex:1; overflow-y:auto; padding:18px 20px; background:#f7f9ff;}
/* empty */
.empty{display:flex; flex-direction:column; align-items:center; justify-content:center; height:100%; text-align:center; gap:12px; opacity:.6;}
.eico{width:64px; height:64px; border:2px dashed var(–b2); border-radius:13px; display:flex; align-items:center; justify-content:center; font-size:26px;}
.et{font-family:var(–fh); font-size:12px; font-weight:700; color:var(–txt);}
.es{font-size:12px; color:var(–mut); max-width:260px; line-height:1.6;}
/* research panel */
#research-panel{
display:none; background:#f0f4ff; border:1px solid #b8c8f0; box-shadow:0 2px 12px rgba(45,85,204,.07);
border-radius:var(–r2); padding:14px 16px; margin-bottom:16px;
}
.rp-hdr{display:flex; align-items:center; gap:9px; margin-bottom:12px;}
.rp-ico{width:30px; height:30px; border-radius:8px; background:var(–bl2); border:1px solid rgba(65,105,225,.25); display:flex; align-items:center; justify-content:center; font-size:14px; flex-shrink:0;}
.rp-title{font-family:var(–fh); font-size:10px; font-weight:700; color:#2244bb; letter-spacing:.02em;}
.rp-sub{font-size:10px; color:var(–mut); margin-top:1px;}
.rp-steps{display:flex; flex-direction:column; gap:6px;}
.rp-step{display:flex; align-items:flex-start; gap:9px; padding:8px 10px; background:#ffffff; border-radius:9px; border:1px solid var(–b1);}
.rp-step-n{width:20px; height:20px; border-radius:50%; border:1px solid var(–b2); display:flex; align-items:center; justify-content:center; font-size:9px; font-weight:700; color:var(–mut); flex-shrink:0; margin-top:1px; transition:all .3s;}
.rp-step-n.done{background:var(–em); border-color:var(–em); color:#000;}
.rp-step-n.act{background:#dde7ff; border-color:var(–bl); color:var(–bl); animation:pulse 1s ease-in-out infinite;}
@keyframes pulse{0%,100%{opacity:1;transform:scale(1);}50%{opacity:.4;transform:scale(.7);}}
.rp-step-txt{font-size:12px; font-weight:600; color:var(–txt);}
.rp-step-detail{font-size:10px; color:var(–mut); margin-top:2px; line-height:1.5;}
.rp-snippet{
display:none; margin-top:6px; background:#e8eeff; border-radius:7px;
padding:7px 10px; font-size:10px; color:var(–mut); line-height:1.6;
font-style:italic; border-left:2px solid var(–bl);
}
/* output header */
.ohdr{display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:13px; padding-bottom:11px; border-bottom:1px solid var(–b1); flex-wrap:wrap; gap:7px;}
.chips{display:flex; flex-wrap:wrap; gap:5px;}
.chip{padding:3px 9px; border-radius:6px; font-size:10px; font-weight:600; letter-spacing:.04em;}
.ch-ct{background:rgba(217,104,0,.09); color:var(–sf); border:1px solid rgba(217,104,0,.25);}
.ch-m{background:rgba(0,127,163,.08); color:var(–cy); border:1px solid rgba(0,127,163,.22); font-family:var(–fm);}
.ch-w{background:rgba(160,104,0,.08); color:var(–gd); border:1px solid rgba(160,104,0,.22);}
.ch-l{background:rgba(10,138,64,.09); color:var(–em); border:1px solid rgba(10,138,64,.25);}
.ch-r{background:rgba(45,85,204,.09); color:var(–bl); border:1px solid rgba(45,85,204,.25);}
.otim{font-size:10px; color:var(–dim); font-family:var(–fm); white-space:nowrap;}
/* output text */
#otxt{font-size:15px; line-height:1.9; color:#1a1e2e;}
#otxt h1,#otxt h2,#otxt h3{font-family:var(–fh); font-weight:700; letter-spacing:-.02em; margin:22px 0 8px; color:#111;}
#otxt h1{font-size:18px;}
#otxt h2{font-size:14px; color:var(–sf);}
#otxt h3{font-size:12px; color:var(–cy);}
#otxt p{margin-bottom:12px;}
#otxt ul,#otxt ol{margin:8px 0 12px 20px;}
#otxt li{margin-bottom:5px;}
#otxt strong{color:#111; font-weight:700;}
#otxt em{color:var(–gd); font-style:italic;}
#otxt blockquote{border-left:3px solid var(–sf); padding:8px 14px; background:rgba(217,104,0,.05); border-radius:0 8px 8px 0; margin:12px 0; color:var(–mut);}
#otxt code{font-family:var(–fm); font-size:11px; background:#e4eaf8; padding:2px 6px; border-radius:4px; color:var(–bl);}
#otxt hr{border:none; border-top:1px solid var(–b1); margin:16px 0;}
#otxt table{width:100%; border-collapse:collapse; margin:13px 0; font-size:13px; display:block; overflow-x:auto;}
#otxt th{background:#f0f3ff; padding:8px 11px; text-align:left; border:1px solid var(–b2); color:var(–sf); font-weight:600; white-space:nowrap;}
#otxt td{padding:7px 11px; border:1px solid var(–b1); color:var(–mut);}
.blink::after{content:’▋’; color:var(–sf); animation:bc .7s step-end infinite; opacity:.8;}
@keyframes bc{0%,100%{opacity:1;}50%{opacity:0;}}
#rawbox,#htmlbox{
display:none; background:#f4f6fc; border:1px solid var(–b1); border-radius:var(–r);
padding:14px; font-family:var(–fm); font-size:11px; line-height:1.7;
color:#445; white-space:pre-wrap; word-break:break-word; overflow-x:auto;
}
/* seo */
.seobox{display:none; margin-top:16px; background:#f8faff; border:1px solid var(–b1); border-radius:var(–r); padding:12px 14px;}
.seolbl{font-size:9px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(–sf); margin-bottom:8px; display:block;}
.seog{display:flex; flex-wrap:wrap; gap:5px;}
.seoi{display:flex; align-items:center; gap:5px; background:#fff; border:1px solid var(–b2); padding:5px 10px; border-radius:7px; font-size:11px;}
.seok{color:var(–mut);}
.seov{font-weight:700; color:var(–txt); font-family:var(–fm);}
/* status bar */
#sbar{
border-top:1px solid var(–b1); padding:5px 16px;
display:flex; align-items:center; gap:9px;
background:var(–s2); font-size:10px; color:var(–mut); flex-shrink:0;
overflow:hidden;
}
.sdot{width:6px; height:6px; border-radius:50%; background:var(–dim); transition:all .3s; flex-shrink:0;}
.sdot.act{background:var(–sf); box-shadow:0 0 8px var(–sf); animation:pulse 1s ease-in-out infinite;}
.sdot.ok{background:var(–em);}
.sdot.err{background:var(–rd);}
#stxt{font-family:var(–fm); font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
#stok{margin-left:auto; font-family:var(–fm); font-size:10px; flex-shrink:0;}
/* ══════════════════════════════════════════
MOBILE BOTTOM DRAWER
══════════════════════════════════════════ */
#drawer-backdrop{
display:none;
position:fixed; inset:0; z-index:600;
background:rgba(30,40,70,.45);
backdrop-filter:blur(4px);
opacity:0; transition:opacity .3s;
}
#drawer-backdrop.open{opacity:1;}
#drawer{
display:none;
position:fixed; bottom:0; left:0; right:0; z-index:700;
height:var(–drawer-h);
background:#fff;
border-radius:20px 20px 0 0;
border-top:1px solid var(–b2);
flex-direction:column;
transform:translateY(100%);
transition:transform .38s cubic-bezier(.32,1,.6,1);
overflow:hidden;
}
#drawer.open{transform:translateY(0);}
.drawer-handle-bar{
flex-shrink:0; padding:10px 16px 0;
display:flex; align-items:center; justify-content:space-between;
}
.drawer-handle{width:36px; height:4px; background:var(–b2); border-radius:4px; margin:0 auto;}
.drawer-close{
position:absolute; top:10px; right:14px;
width:28px; height:28px; background:#f0f2fa; border:1px solid var(–b1);
border-radius:8px; display:flex; align-items:center; justify-content:center;
cursor:pointer; font-size:12px; color:var(–mut); transition:all var(–tr);
}
.drawer-close:hover{border-color:var(–rd); color:var(–rd);}
#drawer-body{flex:1; overflow-y:auto; padding:0 0 80px;}
#drawer .genbar{position:sticky; bottom:0; background:linear-gradient(to top,var(–s1) 60%,transparent);}
/* ══════════════════════════════════════════
MOBILE BOTTOM GEN BAR (when drawer closed)
══════════════════════════════════════════ */
#mob-genbar{
display:none;
position:fixed; bottom:0; left:0; right:0; z-index:450;
padding:10px 14px 14px;
background:linear-gradient(to top,#edf0f7 70%,transparent);
}
.mob-genbtn{
width:100%; padding:14px; border:none; border-radius:14px;
background:linear-gradient(135deg,var(–sf),#e05a00);
font-family:var(–fh); font-size:10px; font-weight:700; letter-spacing:.08em;
color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center;
gap:8px; transition:all var(–tr); box-shadow:0 6px 24px rgba(255,153,51,.3);
}
.mob-genbtn:disabled{background:var(–dim); color:var(–mut); cursor:not-allowed; box-shadow:none;}
.mob-genbtn.busy .sp{display:block;}
/* ══════════════════════════════════════════
PAYMENT MODAL
══════════════════════════════════════════ */
.ovl{
position:fixed; inset:0; background:rgba(30,40,70,.55);
backdrop-filter:blur(14px); z-index:800;
display:flex; align-items:flex-end; justify-content:center;
padding:0; opacity:0; pointer-events:none; transition:opacity .3s;
}
.ovl.open{opacity:1; pointer-events:all;}
.pmod{
background:#fff; border:1px solid var(–b2);
border-radius:22px 22px 0 0;
width:100%; max-width:520px;
max-height:92vh; overflow-y:auto;
box-shadow:0 -2px 20px rgba(30,50,100,.12);
transform:translateY(100%);
transition:transform .38s cubic-bezier(.32,1,.6,1);
position:relative;
}
.ovl.open .pmod{transform:translateY(0);}
/* On larger screens, center modal */
@media(min-width:600px){
.ovl{align-items:center; padding:16px;}
.pmod{border-radius:22px; max-height:90vh;}
}
.tricolor{height:4px; background:linear-gradient(90deg,var(–sf) 33.3%,var(–wh) 33.3% 66.6%,var(–gr) 66.6%); border-radius:22px 22px 0 0;}
@media(min-width:600px){.tricolor{border-radius:22px 22px 0 0;}}
.pmod-handle{display:flex;align-items:center;justify-content:center;padding:8px 0 0;}
.pmod-drag{width:36px;height:4px;background:var(–b2);border-radius:4px;}
@media(min-width:600px){.pmod-handle{display:none;}}
.xbtn{
position:absolute; top:14px; right:14px;
width:28px; height:28px; background:#f0f2fa; border:1px solid var(–b1);
border-radius:8px; display:flex; align-items:center; justify-content:center;
cursor:pointer; font-size:11px; color:var(–mut); transition:all var(–tr); z-index:1;
}
.xbtn:hover{border-color:var(–rd); color:var(–rd);}
.pmhd{padding:16px 18px 0; text-align:center;}
.pmico{width:50px; height:50px; background:linear-gradient(135deg,rgba(255,153,51,.15),rgba(19,136,8,.08)); border:1px solid rgba(255,153,51,.22); border-radius:13px; display:flex; align-items:center; justify-content:center; font-size:20px; margin:0 auto 10px;}
.pmtit{font-family:var(–fh); font-size:15px; font-weight:900; letter-spacing:-.02em; margin-bottom:5px;}
.pmsub{font-size:11px; color:var(–mut); line-height:1.6; max-width:280px; margin:0 auto;}
.pmalert{margin:11px 18px 0; background:rgba(196,42,42,.06); border:1px solid rgba(196,42,42,.2); border-radius:9px; padding:8px 12px; display:flex; align-items:center; gap:8px; font-size:11px; color:#b82222;}
.plans{display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:13px 18px 0;}
.plan{background:var(–s2); border:1px solid var(–b2); border-radius:12px; padding:12px; cursor:pointer; transition:all var(–tr); position:relative;}
.plan:hover{background:#f0f2fa;}
.plan.on{border-color:var(–sf); background:rgba(217,104,0,.07); box-shadow:0 0 0 2px rgba(217,104,0,.15);}
.plbadge{position:absolute; top:-8px; right:10px; background:linear-gradient(135deg,var(–sf),#ff6600); color:#fff; font-family:var(–fh); font-size:7px; font-weight:700; padding:2px 8px; border-radius:100px; letter-spacing:.05em;}
.plnm{font-family:var(–fh); font-size:9px; font-weight:700; margin-bottom:3px;}
.plpr{font-family:var(–fh); font-size:19px; font-weight:900; color:var(–sf);}
.plpr span{font-size:11px; font-weight:400; color:var(–mut);}
.plft{margin-top:5px; font-size:10px; color:var(–mut); line-height:1.7;}
.plft li{list-style:none; padding-left:13px; position:relative;}
.plft li::before{content:’✓’; position:absolute; left:0; color:var(–em); font-weight:700;}
.qrsec{padding:14px 18px;}
.qdiv{display:flex; align-items:center; gap:8px; margin-bottom:12px;}
.qdiv::before,.qdiv::after{content:”; flex:1; height:1px; background:var(–b1);}
.qdiv span{font-size:10px; color:var(–dim); white-space:nowrap;}
.qwrap{background:#f7f9ff; border:1px solid var(–b2); border-radius:13px; padding:13px; display:flex; gap:13px; align-items:flex-start;}
.qbox{flex-shrink:0; width:128px; height:128px; background:#fff; border-radius:10px; overflow:hidden; display:flex; align-items:center; justify-content:center; border:2px solid var(–b2); box-shadow:0 2px 8px rgba(0,0,0,.08);}
.qbox img{width:120px; height:120px; display:block;}
.qinfo{flex:1; min-width:0;}
.qulbl{font-size:8px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(–dim); margin-bottom:4px;}
.quid{font-family:var(–fm); font-size:11px; color:var(–txt); font-weight:600; margin-bottom:8px; word-break:break-all;}
.uapps{display:flex; flex-wrap:wrap; gap:4px; margin-bottom:8px;}
.ua{padding:2px 7px; border-radius:5px; font-size:9px; font-weight:700; border:1px solid;}
.u-gp{background:rgba(66,133,244,.08); border-color:rgba(66,133,244,.22); color:#5090f0;}
.u-pp{background:rgba(99,54,157,.08); border-color:rgba(99,54,157,.22); color:#a07ae0;}
.u-pt{background:rgba(0,181,210,.08); border-color:rgba(0,181,210,.22); color:#00c0d8;}
.u-bh{background:rgba(255,107,24,.08); border-color:rgba(255,107,24,.22); color:#ff8040;}
.amtbox{background:rgba(255,153,51,.08); border:1px solid rgba(255,153,51,.2); border-radius:7px; padding:6px 10px; display:flex; justify-content:space-between; align-items:center;}
.amlbl{font-size:9px; color:var(–mut);}
.amval{font-family:var(–fh); font-size:13px; font-weight:900; color:var(–sf);}
.stepsbox{margin-top:10px; background:#f0f4ff; border:1px solid rgba(45,85,204,.15); border-radius:8px; padding:9px 11px;}
.stlbl{font-size:8px; font-weight:700; text-transform:uppercase; letter-spacing:.1em; color:#7090ff; margin-bottom:5px;}
.strow{display:flex; align-items:center; gap:6px; font-size:10px; color:var(–mut); margin-bottom:4px;}
.strow:last-child{margin-bottom:0;}
.stn{width:15px; height:15px; border-radius:50%; background:rgba(65,105,225,.1); border:1px solid rgba(65,105,225,.2); display:flex; align-items:center; justify-content:center; font-size:8px; font-weight:700; color:#7090ff; flex-shrink:0;}
.pmft{padding:0 18px 18px;}
.cbtn{width:100%; padding:12px; background:linear-gradient(135deg,#ff9a00,#e05000); border:none; border-radius:var(–r); font-family:var(–fh); font-size:10px; font-weight:700; letter-spacing:.08em; color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:6px; transition:all var(–tr); margin-bottom:8px;}
.cbtn:hover{transform:translateY(-1px); box-shadow:0 8px 22px rgba(255,107,24,.3);}
.pmnote{text-align:center; font-size:9px; color:var(–dim); line-height:1.5;}
/* txn modal */
.txmod{
background:#fff; border:1px solid var(–b2);
border-radius:22px 22px 0 0; width:100%; max-width:380px;
padding:24px 20px; text-align:center;
transform:translateY(100%); transition:transform .35s cubic-bezier(.32,1,.6,1);
}
.ovl.open .txmod{transform:translateY(0);}
@media(min-width:600px){
.txmod{border-radius:20px; transform:scale(.9) translateY(0);}
.ovl.open .txmod{transform:scale(1);}
}
.txnico{font-size:36px; margin-bottom:10px;}
.txntit{font-family:var(–fh); font-size:13px; font-weight:800; margin-bottom:5px;}
.txnsub{font-size:11px; color:var(–mut); margin-bottom:15px; line-height:1.6;}
.txni{width:100%; background:#fff; border:1px solid var(–b2); border-radius:var(–r); padding:10px 12px; color:var(–txt); font-family:var(–fm); font-size:12px; outline:none; margin-bottom:8px; transition:border-color var(–tr);}
.txni:focus{border-color:var(–sf);}
.txni::placeholder{color:var(–dim);}
.actbtn{width:100%; padding:12px; background:linear-gradient(135deg,var(–sf),#e05000); border:none; border-radius:var(–r); font-family:var(–fh); font-size:10px; font-weight:700; letter-spacing:.08em; color:#fff; cursor:pointer; transition:all var(–tr);}
.actbtn:hover{box-shadow:0 6px 20px rgba(255,153,51,.3);}
.blnk{margin-top:8px; font-size:10px; color:var(–mut); cursor:pointer; display:inline-block;}
.blnk:hover{color:var(–txt);}
/* toast */
.toast{
position:fixed; bottom:80px; left:50%; transform:translateX(-50%) translateY(20px);
background:#fff; border:1px solid var(–b2); box-shadow:0 4px 20px rgba(0,0,0,.12); border-radius:var(–r);
padding:10px 16px; display:flex; align-items:center; gap:8px;
font-size:12px; color:var(–txt); z-index:9000;
opacity:0; transition:all .3s; max-width:calc(100vw – 32px); white-space:nowrap;
}
.toast.show{transform:translateX(-50%) translateY(0); opacity:1;}
.toast.tok{border-color:var(–em);}
.toast.terr{border-color:var(–rd);}
/* ══════════════════════════════════════════
TABLET 768px – 899px
══════════════════════════════════════════ */
@media(max-width:899px){
#shell{grid-template-columns:240px 1fr;}
.ctg{grid-template-columns:repeat(2,1fr);}
}
/* ══════════════════════════════════════════
MOBILE ≤ 767px — BOTTOM DRAWER UI
══════════════════════════════════════════ */
@media(max-width:767px){
/* hide desktop sidebar, show drawer controls */
#sb{display:none;}
#mob-settings-btn{display:flex;}
#drawer{display:flex;}
#drawer-backdrop{display:block;}
#mob-genbar{display:block;}
/* shell is single column */
#shell{
grid-template-columns:1fr;
grid-template-rows:1fr;
height:calc(100vh – var(–top));
}
/* pane takes full width but leaves room for bottom gen bar */
#pane{height:100%; padding-bottom:72px;}
#oscroll{padding:14px 14px 16px;}
/* tab toolbar: hide text labels on copy/dl */
.tbtn-lbl{display:none;}
.tbtn{padding:6px 9px;}
/* output text smaller */
#otxt{font-size:14px;}
#otxt h1{font-size:16px;}
#otxt h2{font-size:14px;}
#otxt h3{font-size:12px;}
/* status bar compact */
#smod{display:none;}
/* toast above mob genbar */
.toast{bottom:82px;}
}
@media(max-width:400px){
.logo-txt{display:none;}
.logo{font-size:8px;}
#otxt{font-size:13px;}
.plans{grid-template-columns:1fr;}
}
/* ══════════════════════════════════════════
FOOTER ADMIN TRIGGER — hidden secret dot
══════════════════════════════════════════ */
#footer-bar{
position:fixed; bottom:0; right:0; z-index:440;
padding:10px 14px;
}
#admin-trigger{
display:block;
width:7px; height:7px;
border-radius:50%;
background:transparent;
cursor:default;
user-select:none;
-webkit-tap-highlight-color:transparent;
transition:background .15s, transform .12s;
}
#admin-trigger.tap-flash{
background:rgba(45,85,204,.35);
transform:scale(1.6);
}
@keyframes secret-unlock{
0%{transform:scale(1);}
40%{transform:scale(1.9);background:rgba(45,85,204,.5);}
100%{transform:scale(1);background:transparent;}
}
#admin-trigger.unlock-anim{
animation:secret-unlock .4s ease forwards;
}
/* ══════════════════════════════════════════
ADMIN PASSWORD GATE
══════════════════════════════════════════ */
#admin-gate-ovl{
position:fixed; inset:0; z-index:1000;
background:rgba(30,40,70,.55); backdrop-filter:blur(18px);
display:flex; align-items:center; justify-content:center; padding:16px;
opacity:0; pointer-events:none; transition:opacity .25s;
}
#admin-gate-ovl.open{opacity:1; pointer-events:all;}
.gate-box{
background:#fff; border:1px solid var(–b2); border-radius:20px;
width:100%; max-width:360px; padding:30px 24px; text-align:center;
transform:scale(.92); transition:transform .3s cubic-bezier(.34,1.56,.64,1);
}
#admin-gate-ovl.open .gate-box{transform:scale(1);}
.gate-ico{font-size:36px; margin-bottom:12px;}
.gate-tit{font-family:var(–fh); font-size:14px; font-weight:900; margin-bottom:6px; color:var(–txt);}
.gate-sub{font-size:11px; color:var(–mut); margin-bottom:18px; line-height:1.6;}
.gate-inp{
width:100%; background:#fff; border:1px solid var(–b2); border-radius:var(–r);
padding:11px 14px; color:var(–txt); font-family:var(–fm); font-size:14px;
outline:none; text-align:center; letter-spacing:.15em; margin-bottom:10px;
transition:border-color var(–tr);
}
.gate-inp:focus{border-color:var(–sf);}
.gate-inp.err{border-color:var(–rd); animation:shake .3s ease;}
@keyframes shake{0%,100%{transform:translateX(0);}25%{transform:translateX(-6px);}75%{transform:translateX(6px);}}
.err-shake{animation:shake .35s ease!important;}
.gate-btn{
width:100%; padding:11px; background:linear-gradient(135deg,var(–sf),#e05a00);
border:none; border-radius:var(–r); font-family:var(–fh); font-size:10px;
font-weight:700; letter-spacing:.08em; color:#fff; cursor:pointer;
transition:all var(–tr); margin-bottom:8px;
}
.gate-btn:hover{box-shadow:0 6px 20px rgba(255,153,51,.3);}
.gate-cancel{font-size:10px; color:var(–mut); cursor:pointer;}
.gate-cancel:hover{color:var(–txt);}
.gate-attempts{font-size:10px; color:var(–rd); margin-top:7px; min-height:16px;}
/* ══════════════════════════════════════════
ADMIN PANEL
══════════════════════════════════════════ */
#admin-ovl{
position:fixed; inset:0; z-index:900;
background:rgba(30,40,70,.50); backdrop-filter:blur(16px);
display:flex; align-items:flex-end; justify-content:center; padding:0;
opacity:0; pointer-events:none; transition:opacity .25s;
}
#admin-ovl.open{opacity:1; pointer-events:all;}
.admin-panel{
background:#fff; border:1px solid var(–b2);
border-radius:22px 22px 0 0; width:100%; max-width:560px;
max-height:90vh; overflow-y:auto;
transform:translateY(100%);
transition:transform .38s cubic-bezier(.32,1,.6,1);
}
#admin-ovl.open .admin-panel{transform:translateY(0);}
@media(min-width:600px){
#admin-ovl{align-items:center; padding:16px;}
.admin-panel{border-radius:20px; max-height:88vh;}
}
/* admin header */
.ap-stripe{height:4px; background:linear-gradient(90deg,var(–rd),#ff6b1a,var(–gd)); border-radius:22px 22px 0 0;}
@media(min-width:600px){.ap-stripe{border-radius:20px 20px 0 0;}}
.ap-drag{display:flex;align-items:center;justify-content:center;padding:8px 0 0;}
.ap-drag-bar{width:36px;height:4px;background:var(–b2);border-radius:4px;}
@media(min-width:600px){.ap-drag{display:none;}}
.ap-hd{
padding:18px 20px 14px; display:flex; align-items:center;
justify-content:space-between; border-bottom:1px solid var(–b1);
}
.ap-hd-l{display:flex; align-items:center; gap:10px;}
.ap-hd-ico{
width:38px; height:38px; border-radius:10px;
background:linear-gradient(135deg,rgba(196,42,42,.1),rgba(204,80,0,.07));
border:1px solid rgba(196,42,42,.18); display:flex; align-items:center;
justify-content:center; font-size:18px;
}
.ap-hd-tit{font-family:var(–fh); font-size:13px; font-weight:900; color:var(–txt);}
.ap-hd-sub{font-size:10px; color:var(–mut); margin-top:1px;}
.ap-close{
width:28px; height:28px; background:#f0f2fa; border:1px solid var(–b1);
border-radius:8px; display:flex; align-items:center; justify-content:center;
cursor:pointer; font-size:11px; color:var(–mut); transition:all var(–tr);
}
.ap-close:hover{border-color:var(–rd); color:var(–rd);}
/* stats strip */
.ap-stats{display:grid; grid-template-columns:repeat(3,1fr); gap:1px; background:var(–b1); border-top:1px solid var(–b1); border-bottom:1px solid var(–b1);}
.ap-stat{background:#fff; padding:12px 16px; text-align:center;}
.ap-stat-v{font-family:var(–fh); font-size:18px; font-weight:900; color:var(–sf);}
.ap-stat-k{font-size:9px; color:var(–dim); letter-spacing:.08em; text-transform:uppercase; margin-top:2px;}
/* generate code section */
.ap-sec{padding:16px 20px; border-bottom:1px solid var(–b1);}
.ap-sec-lbl{font-family:var(–fh); font-size:8px; font-weight:700; letter-spacing:.15em; text-transform:uppercase; color:var(–dim); margin-bottom:12px;}
.ap-row{display:flex; gap:8px; margin-bottom:10px; flex-wrap:wrap;}
.ap-inp{
flex:1; min-width:130px; background:#fff; border:1px solid var(–b2); border-radius:var(–r);
padding:9px 12px; color:var(–txt); font-family:var(–fm); font-size:12px;
outline:none; transition:border-color var(–tr);
}
.ap-inp:focus{border-color:var(–sf);}
.ap-inp::placeholder{color:var(–dim);}
.ap-sel{appearance:none; cursor:pointer; padding-right:26px; background-AI Image Reverse-prompt-analyzer :none;}
.ap-sel-w{position:relative; flex:1; min-width:120px;}
.ap-sel-a{position:absolute; right:9px; top:50%; transform:translateY(-50%); color:var(–mut); pointer-events:none; font-size:10px;}
.ap-gen-btn{
width:100%; padding:11px; background:linear-gradient(135deg,#4169e1,#2048b0);
border:none; border-radius:var(–r); font-family:var(–fh); font-size:10px;
font-weight:700; letter-spacing:.08em; color:#fff; cursor:pointer;
display:flex; align-items:center; justify-content:center; gap:7px;
transition:all var(–tr);
}
.ap-gen-btn:hover{box-shadow:0 6px 20px rgba(65,105,225,.35); transform:translateY(-1px);}
.ap-gen-btn:active{transform:scale(.98);}
/* code display */
.code-display{
display:none; margin-top:12px;
background:#f0f5ff;
border:1px solid rgba(45,85,204,.25); border-radius:14px; padding:16px 18px;
}
.code-display.visible{display:block; animation:fadeIn .3s ease;}
@keyframes fadeIn{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:translateY(0);}}
.cd-top{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px;}
.cd-lbl{font-size:10px; color:var(–mut); font-weight:600; letter-spacing:.06em; text-transform:uppercase;}
.cd-copy{
padding:3px 10px; background:#f0f2fa; border:1px solid var(–b2); border-radius:6px;
font-size:10px; color:var(–muted); cursor:pointer; transition:all var(–tr);
}
.cd-copy:hover{border-color:var(–cy); color:var(–cy);}
.code-val{
font-family:var(–fm); font-size:28px; font-weight:700; letter-spacing:.35em;
color:var(–bl); text-align:center; padding:8px 0; background:#fff; border-radius:9px; margin:6px 0;
}
.cd-meta{display:flex; justify-content:space-between; font-size:10px; color:var(–dim); margin-top:8px; flex-wrap:wrap; gap:4px;}
.cd-meta span{font-family:var(–fm);}
.cd-meta .cd-phone{color:var(–sf);}
.cd-meta .cd-plan{color:var(–em);}
/* whatsapp btn */
.wa-btn{
width:100%; padding:12px; margin-top:11px;
background:linear-gradient(135deg,#25d366,#128c3a);
border:none; border-radius:var(–r); font-family:var(–fh); font-size:10px;
font-weight:700; letter-spacing:.07em; color:#fff; cursor:pointer;
display:flex; align-items:center; justify-content:center; gap:8px;
transition:all var(–tr); box-shadow:0 4px 16px rgba(37,211,102,.2);
}
.wa-btn:hover{box-shadow:0 8px 24px rgba(37,211,102,.35); transform:translateY(-1px);}
.wa-btn:active{transform:scale(.98);}
.wa-ico{font-size:16px;}
/* issued codes table */
.codes-list{max-height:260px; overflow-y:auto;}
.code-row{
display:grid; grid-template-columns:auto 1fr auto auto auto;
gap:8px; align-items:center; padding:9px 12px;
border-bottom:1px solid var(–b1); font-size:11px; transition:background var(–tr);
}
.code-row:hover{background:#f4f6ff;}
.code-row:last-child{border-bottom:none;}
.cr-code{font-family:var(–fm); color:var(–cy); letter-spacing:.1em; font-size:12px;}
.cr-phone{color:var(–sf);}
.cr-plan{font-size:9px; padding:2px 7px; border-radius:5px; font-weight:700; white-space:nowrap;}
.plan-day{background:rgba(0,127,163,.08); border:1px solid rgba(0,127,163,.22); color:var(–cy);}
.plan-month{background:rgba(10,138,64,.08); border:1px solid rgba(10,138,64,.22); color:var(–em);}
.cr-status{font-size:9px; padding:2px 7px; border-radius:5px; font-weight:700; white-space:nowrap;}
.st-unused{background:rgba(217,104,0,.08); border:1px solid rgba(217,104,0,.22); color:var(–sf);}
.st-used{background:rgba(90,106,136,.08); border:1px solid rgba(90,106,136,.2); color:var(–mut);}
.cr-del{cursor:pointer; color:var(–dim); font-size:13px; transition:color var(–tr); background:none; border:none; padding:2px 4px;}
.cr-del:hover{color:var(–rd);}
.empty-codes{padding:20px; text-align:center; color:var(–dim); font-size:12px;}
.ap-col-hd{
display:grid; grid-template-columns:auto 1fr auto auto auto;
gap:8px; padding:7px 12px;
font-size:8px; font-weight:700; letter-spacing:.1em; text-transform:uppercase;
color:var(–dim); border-bottom:1px solid var(–b2); background:#eef0f8;
border-radius:var(–r) var(–r) 0 0;
}
/* redeem code section in payment modal */
.redeem-sec{margin:12px 18px 0; background:#f0f4ff; border:1px solid rgba(45,85,204,.2); border-radius:12px; padding:13px 14px;}
.redeem-lbl{font-size:10px; font-weight:700; color:#7090ff; margin-bottom:8px; letter-spacing:.05em; text-transform:uppercase;}
.redeem-row{display:flex; gap:8px;}
.redeem-inp{
flex:1; background:#fff; border:1px solid var(–b2); border-radius:9px;
padding:9px 12px; color:var(–txt); font-family:var(–fm); font-size:14px;
outline:none; text-align:center; letter-spacing:.2em; transition:border-color var(–tr);
}
.redeem-inp:focus{border-color:#7090ff;}
.redeem-inp::placeholder{color:var(–dim); letter-spacing:.05em; font-size:12px;}
.redeem-btn{
padding:9px 16px; background:linear-gradient(135deg,#4169e1,#2048b0);
border:none; border-radius:9px; font-family:var(–fh); font-size:9px;
font-weight:700; letter-spacing:.06em; color:#fff; cursor:pointer;
transition:all var(–tr); white-space:nowrap;
}
.redeem-btn:hover{box-shadow:0 4px 14px rgba(65,105,225,.35);}
/* ── New plan card extras ── */
.pl-tag{font-family:var(–fh);font-size:8px;font-weight:700;letter-spacing:.12em;color:var(–mut);margin-bottom:4px;text-transform:uppercase;}
.plan.on .pl-tag{color:var(–sf);}
.pl-daily-badge{
display:inline-flex;align-items:center;gap:4px;
margin:5px 0 8px;padding:3px 9px;border-radius:100px;
background:rgba(217,104,0,.10);border:1px solid rgba(217,104,0,.25);
font-family:var(–fh);font-size:9px;font-weight:700;color:var(–sf);
}
/* usage progress bar in topbar */
#usage-bar-wrap{
display:flex;align-items:center;gap:6px;
padding:3px 10px;border-radius:8px;
background:var(–s2);border:1px solid var(–b1);
font-size:10px;color:var(–mut);
}
#usage-bar{
width:60px;height:5px;background:var(–b1);border-radius:3px;overflow:hidden;
}
#usage-bar-fill{
height:100%;background:var(–sf);border-radius:3px;transition:width .4s ease;
}
/* subscription status card shown in topbar area on mobile */
.sub-status-banner{
display:none;position:fixed;top:var(–top);left:0;right:0;z-index:490;
background:linear-gradient(90deg,#fff9f0,#f0fff5);
border-bottom:1px solid var(–b1);
padding:6px 16px;font-size:11px;color:var(–txt);
display:flex;align-items:center;justify-content:space-between;gap:8px;
}
Preview
Raw
HTML
📋 Copy
⬇️ Download
🗑️
Idle
openai/gpt-4o
🚀 GENERATE — FREE
✕
🔒
Choose Your Plan
You’ve used your 1 free article today. Upgrade for unlimited generation.
🕐
Free limit reached for today
2 free posts/day · Resets at midnight
⚡ WEEKLY
7 Days
₹99/week
10 posts/day
10 posts per day
All 12 content types
Research-first AI
All Indian languages
7 days access
BEST VALUE
🏆 MONTHLY
30 Days
₹299/month
15 posts/day
15 posts per day
All 12 content types
Research-first AI
All Indian languages
30 days access
Priority generation
🎟️ Already Have an Access Code?
REDEEM
Pay via UPI — Instant & Secure
UPI ID
yourname@upi
GPay PhonePe
Paytm BHIM
Pay Amount
₹299
Selected: Monthly — 30 days
How to Activate
1 Choose a plan above & scan QR / pay UPI
2 Tap “I’ve Paid” → send WhatsApp to admin
3 Admin verifies & sends you a 6-digit code
4 Enter code above → plan activates instantly
✅ I’ve Paid — Notify Admin & Get Code
Admin sends your secret code via WhatsApp · usually within 5 mins
📱
Send Payment Proof to Admin
Enter your WhatsApp number. We’ll open a pre-filled message to the admin so they can verify and send you a secret access code.
Enter a valid 10-digit number
💬 Message Admin on WhatsApp
ℹ️ After sending the message, wait for admin to reply with a 6-digit code. Then come back and enter it below.
Already have a code?
ACTIVATE
← Back to payment
🔐
Admin Access
Enter admin password to access the panel.
UNLOCK PANEL
Cancel
🛡️
Admin Panel
Issue & manage premium access codes
✕
Generate Access Code
Weekly — ₹99 (7 days · 10/day)
Monthly — ₹299 (30 days · 15/day)
▾
⚡ Generate 6-Digit Code
— — — — — —
📱
📦
🕐
💬
Send via WhatsApp
🔒 LOCK & EXIT
✅
“use strict”;
/* ──────────────────────────────────────────
★ CONFIG
────────────────────────────────────────── */
const CFG = {
apiKey: “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”, // ← OpenRouter key
model: “openai/gpt-4o”,
upiId: “paytmqr6oxku2@ptys”, // ← your UPI ID
payeeName: “AI Content Generator”,
adminPassword: “om2014”, // ← change this
adminWhatsApp: “919614256047”, // ← admin WhatsApp (country code + number)
adminSession: “admSess_v3”,
codesKey: “aigCodes_v3”,,
/* ── Subscription Plans ──────────────────────────────
plan key : internal key stored in localStorage
freePerDay: daily posts allowed for free users
plans : paid subscription tiers
─────────────────────────────────────────────────── */
freePerDay: 2, // FREE users get 2 posts per day
plans: {
weekly: {
label: “Weekly”,
price: 99,
days: 7,
dailyLimit: 10, // 10 posts/day
badge: null,
features: [“10 posts/day”,”All 12 content types”,”Research-first AI”,”7 days access”,”All Indian languages”]
},
monthly: {
label: “Monthly”,
price: 299,
days: 30,
dailyLimit: 15, // 15 posts/day
badge: “BEST VALUE”,
features: [“15 posts/day”,”All 12 content types”,”Research-first AI”,”30 days access”,”All Indian languages”,”Priority generation”]
}
}
};
/* ──────────────────────────────────────────
INDIA STATE → LANGUAGES
────────────────────────────────────────── */
const INDIA = [
{state:”Andhra Pradesh”, langs:[“Telugu”,”Urdu”,”Hindi”,”English”]},
{state:”Arunachal Pradesh”, langs:[“English”,”Hindi”,”Bengali”,”Nyishi”,”Adi”]},
{state:”Assam”, langs:[“Assamese”,”Bengali”,”Bodo”,”English”,”Hindi”]},
{state:”Bihar”, langs:[“Hindi”,”Maithili”,”Bhojpuri”,”Urdu”,”English”]},
{state:”Chhattisgarh”, langs:[“Hindi”,”Chhattisgarhi”,”English”]},
{state:”Goa”, langs:[“Konkani”,”Marathi”,”English”,”Hindi”,”Portuguese”]},
{state:”Gujarat”, langs:[“Gujarati”,”Hindi”,”English”,”Urdu”]},
{state:”Haryana”, langs:[“Hindi”,”Haryanvi”,”Punjabi”,”English”,”Urdu”]},
{state:”Himachal Pradesh”, langs:[“Hindi”,”Pahari”,”Kangri”,”English”]},
{state:”Jharkhand”, langs:[“Hindi”,”Santali”,”Bengali”,”Urdu”,”English”]},
{state:”Karnataka”, langs:[“Kannada”,”Urdu”,”Telugu”,”Tamil”,”Hindi”,”English”]},
{state:”Kerala”, langs:[“Malayalam”,”Tamil”,”Kannada”,”English”,”Hindi”]},
{state:”Madhya Pradesh”, langs:[“Hindi”,”Urdu”,”Marathi”,”English”]},
{state:”Maharashtra”, langs:[“Marathi”,”Hindi”,”Urdu”,”Gujarati”,”English”,”Konkani”]},
{state:”Manipur”, langs:[“Meitei (Manipuri)”,”English”,”Hindi”,”Bengali”]},
{state:”Meghalaya”, langs:[“English”,”Khasi”,”Garo”,”Bengali”,”Hindi”]},
{state:”Mizoram”, langs:[“Mizo”,”English”,”Hindi”]},
{state:”Nagaland”, langs:[“English”,”Nagamese”,”Hindi”,”Bengali”]},
{state:”Odisha”, langs:[“Odia”,”Hindi”,”Bengali”,”Telugu”,”English”]},
{state:”Punjab”, langs:[“Punjabi”,”Hindi”,”Urdu”,”English”]},
{state:”Rajasthan”, langs:[“Hindi”,”Rajasthani”,”Urdu”,”English”]},
{state:”Sikkim”, langs:[“Nepali”,”Sikkimese”,”Lepcha”,”English”,”Hindi”]},
{state:”Tamil Nadu”, langs:[“Tamil”,”Telugu”,”Kannada”,”Urdu”,”English”]},
{state:”Telangana”, langs:[“Telugu”,”Urdu”,”Hindi”,”Marathi”,”English”]},
{state:”Tripura”, langs:[“Bengali”,”Kokborok”,”English”,”Hindi”]},
{state:”Uttar Pradesh”, langs:[“Hindi”,”Urdu”,”Awadhi”,”Bhojpuri”,”English”]},
{state:”Uttarakhand”, langs:[“Hindi”,”Garhwali”,”Kumaoni”,”Urdu”,”English”]},
{state:”West Bengal”, langs:[“Bengali”,”Hindi”,”Urdu”,”Santali”,”English”,”Nepali”]},
{state:”Andaman & Nicobar”, langs:[“Bengali”,”Hindi”,”Tamil”,”Telugu”,”English”]},
{state:”Chandigarh”, langs:[“Hindi”,”Punjabi”,”English”]},
{state:”Dadra & Nagar Haveli”,langs:[“Gujarati”,”Hindi”,”Marathi”,”English”]},
{state:”Delhi (NCT)”, langs:[“Hindi”,”Punjabi”,”Urdu”,”English”,”Bhojpuri”]},
{state:”Jammu & Kashmir”, langs:[“Kashmiri”,”Dogri”,”Hindi”,”Urdu”,”English”,”Punjabi”]},
{state:”Ladakh”, langs:[“Ladakhi”,”Hindi”,”Urdu”,”English”]},
{state:”Lakshadweep”, langs:[“Malayalam”,”English”]},
{state:”Puducherry”, langs:[“Tamil”,”French”,”Telugu”,”Malayalam”,”English”]},
];
const FLAGS = {
“Telugu”:”🇮🇳”,”Hindi”:”🇮🇳”,”English”:”🌐”,”Tamil”:”🇮🇳”,”Bengali”:”🇮🇳”,
“Marathi”:”🇮🇳”,”Gujarati”:”🇮🇳”,”Kannada”:”🇮🇳”,”Malayalam”:”🇮🇳”,”Punjabi”:”🇮🇳”,
“Odia”:”🇮🇳”,”Assamese”:”🇮🇳”,”Urdu”:”🇮🇳”,”Kashmiri”:”🇮🇳”,”Bodo”:”🇮🇳”,
“Santali”:”🇮🇳”,”Maithili”:”🇮🇳”,”Konkani”:”🇮🇳”,”Dogri”:”🇮🇳”,”Nepali”:”🇳🇵”,
“Mizo”:”🇮🇳”,”Khasi”:”🇮🇳”,”Garo”:”🇮🇳”,”French”:”🇫🇷”,”Portuguese”:”🇵🇹”,
“Rajasthani”:”🇮🇳”,”Bhojpuri”:”🇮🇳”,”Awadhi”:”🇮🇳”,”Haryanvi”:”🇮🇳”,
“Chhattisgarhi”:”🇮🇳”,”Pahari”:”🇮🇳”,”Garhwali”:”🇮🇳”,”Kumaoni”:”🇮🇳”,
“Nagamese”:”🇮🇳”,”Kokborok”:”🇮🇳”,”Ladakhi”:”🇮🇳”,”Meitei (Manipuri)”:”🇮🇳”,
“Adi”:”🇮🇳”,”Nyishi”:”🇮🇳”,”Sikkimese”:”🇮🇳”,”Lepcha”:”🇮🇳”,”Kangri”:”🇮🇳”
};
const CT_NAME = {
blog_post:”Viral Blog Post Engine Post”,blog_outline:”Blog Outline”,blog_intro:”Blog Intro”,
blog_title:”Blog Titles”,social_post:”Social Post”,ad_copy:”Ad Copy”,
email:”Email”,product_desc:”Product Desc”,seo_article:”SEO Article”,
landing_page:”Landing Page”,how_to:”How-To”,listicle:”Listicle”
};
/* ──────────────────────────────────────────
APP STATE
────────────────────────────────────────── */
const S = {
ct:”blog_post”, tone:”Professional”, length:”Medium”,
lang:”English”, state:””, busy:false, raw:””, tab:”preview”,
plan:”month”, amount:199, history:[], researchOn:true, researchNotes:””
};
/* ──────────────────────────────────────────
SIDEBAR HTML (shared desktop + drawer)
────────────────────────────────────────── */
function sidebarHTML() {
return `
State → Language
— Select State / UT —${
INDIA.map(r=>`${r.state}`).join(“”)
}
▾
🌐 English
▾
Content Type
📝 Blog Post
🗂️ Outline
🎯 Blog Intro
💡 Titles
📱 Social Post
📢 Ad Copy
✉️ Email
🛒 Product
🔍 SEO Article
🖥️ Landing Pg
🛠️ How-To
📋 Listicle
Tone & Length
Pro
Casual
Persuasive
Friendly
Authority
Length Medium
🔬 Research First
AI researches before writing
`;
}
/* ──────────────────────────────────────────
RENDER SIDEBAR
────────────────────────────────────────── */
function renderSidebar() {
const isMobile = window.innerWidth {
const container = document.getElementById(containerId);
if (!container) return;
// state select
const stateSel = container.querySelector(“#state-sel”);
if (stateSel) {
stateSel.value = S.state;
stateSel.addEventListener(“change”, function(){
S.state = this.value;
syncField(“state-sel”, this.value);
if (S.state) updateLangs(S.state, container);
});
}
// lang select
const langSel = container.querySelector(“#lang-sel”);
if (langSel) {
langSel.addEventListener(“change”, function(){
S.lang = this.value;
syncField(“lang-sel”, this.value);
updateLangChips(container, this.value);
});
}
// topic
const topic = container.querySelector(“#topic”);
if (topic) {
topic.value = S.topic || “”;
topic.addEventListener(“input”, function(){ S.topic = this.value; syncField(“topic”, this.value); });
topic.addEventListener(“keydown”, e=>{ if(e.key===”Enter”&&!e.shiftKey){e.preventDefault();generate();} });
}
// content type
const ctg = container.querySelector(“#ctg”);
if (ctg) {
ctg.querySelectorAll(“.ctb”).forEach(b=>{
if (b.dataset.ct === S.ct) b.classList.add(“on”); else b.classList.remove(“on”);
});
ctg.addEventListener(“click”, e=>{
const b = e.target.closest(“.ctb”); if(!b) return;
S.ct = b.dataset.ct;
document.querySelectorAll(“.ctb”).forEach(x=>x.classList.toggle(“on”, x.dataset.ct===S.ct));
});
}
// tone
const toneRow = container.querySelector(“#tone-row”);
if (toneRow) {
toneRow.querySelectorAll(“.toneb”).forEach(b=>{
if (b.dataset.tone===S.tone) b.classList.add(“on”); else b.classList.remove(“on”);
});
toneRow.addEventListener(“click”, e=>{
const b = e.target.closest(“.toneb”); if(!b) return;
S.tone = b.dataset.tone;
document.querySelectorAll(“.toneb”).forEach(x=>x.classList.toggle(“on”,x.dataset.tone===S.tone));
});
}
// length range
const lrange = container.querySelector(“#lrange”);
if (lrange) {
lrange.value = S.length===”Short”?”1″:S.length===”Long”?”3″:”2″;
lrange.addEventListener(“input”, function(){
const m={“1″:”Short”,”2″:”Medium”,”3″:”Long”};
S.length=m[this.value]||”Medium”;
document.querySelectorAll(“#lval”).forEach(el=>el.textContent=S.length);
syncField(“lrange”, this.value);
});
}
// research toggle
const rtog = container.querySelector(“#research-tog”);
if (rtog) {
rtog.checked = S.researchOn;
rtog.addEventListener(“change”, function(){
S.researchOn = this.checked;
syncChecked(“research-tog”, this.checked);
});
}
});
// desktop gen button
const desktopGenBtn = document.getElementById(“sb”).querySelector? null: null;
// render gen button only in desktop sb
const sbEl = document.getElementById(“sb”);
const genBarHTML = `🚀 GENERATE — FREE
`;
sbEl.insertAdjacentHTML(“beforeend”, genBarHTML);
document.getElementById(“desk-genbtn”).addEventListener(“click”, generate);
}
/* sync a field value across both sidebar instances */
function syncField(id, val) {
document.querySelectorAll(“#”+id).forEach(el=>{ if(el.value!==val) el.value=val; });
}
function syncChecked(id, checked) {
document.querySelectorAll(“#”+id).forEach(el=>{ if(el.checked!==checked) el.checked=checked; });
}
/* ──────────────────────────────────────────
LANG HELPERS
────────────────────────────────────────── */
function updateLangs(stateName, container) {
const row = INDIA.find(r=>r.state===stateName);
if (!row) return;
// update all lang-sel instances
document.querySelectorAll(“#lang-sel”).forEach(sel=>{
sel.innerHTML = row.langs.map(l=>`${(FLAGS[l]||”🌐”)+” “+l}`).join(“”);
sel.value = row.langs[0];
});
S.lang = row.langs[0];
// update chips in all containers
document.querySelectorAll(“#lang-chips”).forEach(chips=>{
chips.innerHTML = row.langs.map((l,i)=>{
const f = FLAGS[l]||”🌐”;
return `${f} ${l} `;
}).join(“”);
chips.querySelectorAll(“.lc”).forEach(c=>{
c.addEventListener(“click”,()=>{
S.lang = c.dataset.lang;
document.querySelectorAll(“#lang-sel”).forEach(sel=>sel.value=S.lang);
document.querySelectorAll(“.lc”).forEach(x=>x.classList.toggle(“on”,x.dataset.lang===S.lang));
});
});
});
}
function updateLangChips(container, lang) {
document.querySelectorAll(“.lc”).forEach(c=>c.classList.toggle(“on”, c.dataset.lang===lang));
}
/* ──────────────────────────────────────────
DRAWER
────────────────────────────────────────── */
function openDrawer() {
document.getElementById(“drawer”).classList.add(“open”);
document.getElementById(“drawer-backdrop”).classList.add(“open”);
document.body.style.overflow = “hidden”;
}
function closeDrawer() {
document.getElementById(“drawer”).classList.remove(“open”);
document.getElementById(“drawer-backdrop”).classList.remove(“open”);
document.body.style.overflow = “”;
}
window.openDrawer = openDrawer;
window.closeDrawer = closeDrawer;
/* Swipe down to close drawer */
(function(){
let startY=0, dragging=false;
const drawer = document.getElementById(“drawer”);
const handle = document.querySelector(“.drawer-handle-bar”);
if(!handle) return;
handle.addEventListener(“touchstart”,e=>{startY=e.touches[0].clientY;dragging=true;},{passive:true});
document.addEventListener(“touchmove”,e=>{
if(!dragging) return;
const dy=e.touches[0].clientY-startY;
if(dy>60) closeDrawer();
},{passive:true});
document.addEventListener(“touchend”,()=>{dragging=false;});
})();
/* ──────────────────────────────────────────
FREE TIER
────────────────────────────────────────── */
function todayKey(){ return “aig3_”+new Date().toISOString().slice(0,10); }
function usedToday(){ return parseInt(localStorage.getItem(todayKey())||”0”,10); }
function markUsed(){ localStorage.setItem(todayKey(), usedToday()+1); }
/* ── Subscription store keys ── */
const SUBS_KEY = “aigSubs_v3″; // {plan, activatedAt, expiresAt, dailyLimit}
function loadSub(){
try{ return JSON.parse(localStorage.getItem(SUBS_KEY)||”null”); }
catch(_){ return null; }
}
function saveSub(obj){ localStorage.setItem(SUBS_KEY, JSON.stringify(obj)); }
function clearSub(){ localStorage.removeItem(SUBS_KEY); }
/* Returns active subscription object or null */
function getActiveSub(){
const sub = loadSub();
if(!sub) return null;
if(Date.now() > sub.expiresAt){ clearSub(); return null; } // expired
return sub;
}
/* Daily usage counter */
function todayUsageKey(){ return “aigUsage_” + new Date().toISOString().slice(0,10); }
function usedToday(){
try{ return parseInt(localStorage.getItem(todayUsageKey())||”0″,10); }
catch(_){ return 0; }
}
function bumpUsage(){ localStorage.setItem(todayUsageKey(), usedToday()+1); }
/* How many posts can user still generate today? */
function postsLeft(){
const sub = getActiveSub();
const used = usedToday();
if(sub){
const left = sub.dailyLimit – used;
return Math.max(0, left);
}
// free tier
return Math.max(0, CFG.freePerDay – used);
}
function canGenerate(){ return postsLeft() > 0; }
function isPrem(){ return getActiveSub() !== null; }
/* Activate a plan after code is redeemed */
function activatePlan(planKey){
const plan = CFG.plans[planKey];
if(!plan) return false;
const now = Date.now();
saveSub({
plan: planKey,
label: plan.label,
price: plan.price,
dailyLimit: plan.dailyLimit,
activatedAt:now,
expiresAt: now + plan.days * 86400000
});
return true;
}
/* Days remaining */
function daysLeft(){
const sub = getActiveSub();
if(!sub) return 0;
return Math.ceil((sub.expiresAt – Date.now()) / 86400000);
}
/* ──────────────────────────────────────────
CODE STORE (localStorage)
────────────────────────────────────────── */
function loadCodes(){
try{ return JSON.parse(localStorage.getItem(CFG.codesKey)||”[]”); }
catch(_){ return []; }
}
function saveCodes(arr){ localStorage.setItem(CFG.codesKey, JSON.stringify(arr)); }
/* Generate a random 6-digit numeric code */
function genRaw6(){ return String(Math.floor(100000+Math.random()*900000)); }
/* Create a code tied to phone+plan; returns code string */
function issueCode(phone, plan){
const codes = loadCodes();
// one unused code per phone+plan is enough — replace if exists and unused
const existing = codes.find(c=>c.phone===phone && c.plan===plan && !c.used);
if(existing) return existing.code; // reuse if not yet sent/used
let code;
let tries = 0;
do { code = genRaw6(); tries++; } while(codes.some(c=>c.code===code) && triesc.code===code);
if(idx===-1) return {ok:false, error:”❌ Invalid code. Check and try again.”};
if(codes[idx].used) return {ok:false, error:”⚠️ This code has already been used.”};
// Mark used
codes[idx].used = true;
codes[idx].redeemedAt = Date.now();
saveCodes(codes);
// Activate the plan
const planKey = codes[idx].plan; // “weekly” or “monthly”
activatePlan(planKey);
return {ok:true, plan:planKey, phone:codes[idx].phone};
}
/* Delete a code by index */
function deleteCode(code){
const codes = loadCodes().filter(c=>c.code!==code);
saveCodes(codes);
}
function refreshUI() {
const up = document.getElementById(“upill”);
const sub = getActiveSub();
const left = postsLeft();
const used = usedToday();
if(sub){
const dl = sub.daysLeft || daysLeft();
up.textContent = “⭐ ” + sub.label.toUpperCase();
up.className = “pill p-pro”;
// show daily posts left
const tagTxt = left + “/” + sub.dailyLimit + ” today”;
document.querySelectorAll(“.ftag”).forEach(t=>{
t.textContent = tagTxt;
t.style.cssText= “background:rgba(10,138,64,.15);color:var(–em);font-size:9px;”;
});
if(left > 0){
setAllBtnText(‘🚀 GENERATE ‘+ tagTxt +’ ‘);
} else {
setAllBtnText(‘⏳ DAILY LIMIT REACHED’);
}
// Update topbar with sub info
const mpill = document.getElementById(“mpill”);
if(mpill) mpill.textContent = daysLeft()+”d left”;
} else if(left > 0){
up.textContent = “FREE · ” + left + ” LEFT”;
up.className = “pill p-free”;
const tagTxt = “FREE”;
document.querySelectorAll(“.ftag”).forEach(t=>{t.textContent=tagTxt;t.style.cssText=””;});
setAllBtnText(‘🚀 GENERATE — FREE (‘ + left + ‘ left) ‘);
} else {
up.textContent = “UPGRADE”;
up.className = “pill p-used”;
setAllBtnText(‘🔒 UPGRADE — FREE LIMIT REACHED’);
}
// Update usage bar
const sub3 = getActiveSub();
const used3 = usedToday();
const limit3 = sub3 ? sub3.dailyLimit : CFG.freePerDay;
const pct3 = Math.min(100, Math.round((used3 / limit3) * 100));
const barFill = document.getElementById(“usage-bar-fill”);
const barLbl = document.getElementById(“usage-bar-lbl”);
if(barFill) barFill.style.width = pct3 + “%”;
if(barFill) barFill.style.background = pct3 >= 100 ? “var(–rd)” : pct3 >= 70 ? “var(–gd)” : “var(–em)”;
if(barLbl) barLbl.textContent = used3 + “/” + limit3;
}
function setAllBtnText(html) {
[“desk-btxt”,”mob-btxt”,”drawer-btxt”].forEach(id=>{
const el=document.getElementById(id);
if(el) el.innerHTML=html;
});
}
function setBusy(busy) {
S.busy = busy;
[“desk-genbtn”,”mob-genbtn”,”drawer-genbtn”].forEach(id=>{
const btn=document.getElementById(id);
if(!btn) return;
btn.disabled = busy;
btn.classList.toggle(“busy”, busy);
});
if (busy) {
[“desk-btxt”,”mob-btxt”,”drawer-btxt”].forEach(id=>{
const el=document.getElementById(id);
if(el) el.textContent=”GENERATING…”;
});
[“desk-sp”,”mob-sp”,”drawer-sp”].forEach(id=>{
const el=document.getElementById(id);
if(el) el.style.display=”block”;
});
} else {
document.querySelectorAll(“.sp”).forEach(el=>el.style.display=”none”);
refreshUI();
}
}
/* ──────────────────────────────────────────
PROMPTS
────────────────────────────────────────── */
function makePrompt(ct,topic,tone,length,lang,notes){
const wc=length===”Short”?”400-600″:length===”Medium”?”800-1200″:”1500-2500″;
const r=notes?`\n\nResearch notes to use:\n—\n${notes}\n—\n`:””;
const base={
blog_post:`Write a comprehensive blog post about “${topic}”. Tone:${tone}. Length:${wc}w. Language:${lang}. H1+H2 sections, intro, conclusion. Markdown. Human expert tone.${r}`,
blog_outline:`Detailed blog outline for “${topic}” in ${lang}. Title, meta desc, H2→H3 structure, word count estimates.${r}`,
blog_intro:`3 blog intro options for “${topic}” in ${lang}. Tone:${tone}. 80-150w each, strong hooks. Label A/B/C.${r}`,
blog_title:`10 SEO-optimised blog titles for “${topic}” in ${lang}. Mix styles. Note why each works.${r}`,
social_post:`Social posts about “${topic}” in ${lang}: LinkedIn(150-200w), Twitter/X(<280c), Instagram(caption+hashtags), Facebook(80-120w). Tone:${tone}.${r}`,
ad_copy:`Ad copy for "${topic}" in ${lang}.\nGoogle: 3 headlines(30c), 2 descriptions(90c).\nFacebook: primary text, headline(40c), desc(30c), CTA. Tone:${tone}.${r}`,
email:`Marketing email about "${topic}" in ${lang}. 5 subject lines, preview text, body(${length==="Short"?"150-200":"250-350"}w), CTA. Tone:${tone}.${r}`,
product_desc:`Product descriptions for "${topic}" in ${lang}: short(50-80w), full(150-250w), feature bullets(6-8), SEO meta(({}));throw new Error(e?.error?.message||”Research error “+res.status);}
const d=await res.json();
return d?.choices?.[0]?.message?.content||””;
}
function rsStep(n,state,detail,snippet){
const nEl=document.getElementById(“rn”+n);
const dEl=document.getElementById(“rd”+n);
if(!nEl) return;
nEl.className=”rp-step-n “+state;
nEl.textContent=state===”done”?”✓”:n;
if(detail&&dEl) dEl.textContent=detail;
if(snippet){const s=document.getElementById(“rsnip”+n);if(s){s.textContent=snippet;s.style.display=”block”;}}
}
function resetResearch(){
for(let i=1;i<=4;i++){
const n=document.getElementById("rn"+i);if(n){n.className="rp-step-n";n.textContent=i;}
const s=document.getElementById("rsnip"+i);if(s){s.style.display="none";s.textContent="";}
const d=document.getElementById("rd"+i);
if(d){d.textContent=["Understanding topic and reader intent…","Gathering statistics and examples…","Organising headings and SEO strategy…","Generating research-backed content…"][i-1];}
}
}
/* ──────────────────────────────────────────
GENERATE
────────────────────────────────────────── */
async function generate(){
if(S.busy) return;
const topicEls=document.querySelectorAll("#topic");
const topic=(topicEls[0]?.value||"").trim();
if(!topic){toast("Please enter a topic or keyword.","err");topicEls[0]?.focus();return;}
if(!canGenerate()){openPayModal();return;}
S.busy=true; S.raw=""; S.researchNotes="";
setBusy(true);
// close drawer on mobile when generating
if(window.innerWidth<=767) closeDrawer();
document.getElementById("empty").style.display="none";
document.getElementById("outblock").style.display="block";
document.getElementById("seobox").style.display="none";
document.getElementById("research-panel").style.display="none";
document.getElementById("chips").innerHTML=
`${CT_NAME[S.ct]||S.ct} `+
`gpt-4o `+
`${S.lang} `+
(S.state?`${S.state} `:””)+
(S.researchOn?`🔬 Researched `:””)+
`0 words `;
document.getElementById(“otim”).textContent=new Date().toLocaleTimeString();
const otxt=document.getElementById(“otxt”);
otxt.innerHTML=””; otxt.classList.remove(“blink”);
try{
if(S.researchOn){
document.getElementById(“research-panel”).style.display=”block”;
resetResearch();
setStatus(“act”,”Researching topic…”);
rsStep(1,”act”,”Analysing: “+topic.slice(0,50));
await delay(500);
rsStep(1,”done”,”Topic analysed ✓”);
rsStep(2,”act”,”Gathering facts and statistics…”);
[“desk-btxt”,”mob-btxt”,”drawer-btxt”].forEach(id=>{const e=document.getElementById(id);if(e)e.textContent=”RESEARCHING…”;});
const notes=await doResearch(topic,S.lang);
S.researchNotes=notes;
const snip=notes.split(“\n”).filter(l=>l.trim().length>10).slice(0,2).join(” “).slice(0,150)+”…”;
rsStep(2,”done”,”Facts gathered ✓”,snip);
rsStep(3,”act”,”Planning structure and SEO…”);
await delay(400);
rsStep(3,”done”,”Structure planned ✓”);
rsStep(4,”act”,”Writing content…”);
[“desk-btxt”,”mob-btxt”,”drawer-btxt”].forEach(id=>{const e=document.getElementById(id);if(e)e.textContent=”WRITING…”;});
} else {
setStatus(“act”,”Generating…”);
}
const maxTok=S.length===”Short”?900:S.length===”Medium”?1900:3400;
const sys=`You are an expert content writer and SEO specialist. Write high-quality original content in ${S.lang}. Tone: ${S.tone}. Use markdown formatting. Never reveal you are AI. Write as a human expert.`+(S.state?` Content targets audiences in ${S.state}, India.`:””);
const res=await fetch(“https://openrouter.ai/api/v1/chat/completions”,{
method:”POST”,
headers:{“Authorization”:`Bearer ${CFG.apiKey}`,”Content-Type”:”application/json”,”HTTP-Referer”:window.location.href,”X-Title”:”AI Content Generator”},
body:JSON.stringify({
model:CFG.model, stream:true, temperature:.75, max_tokens:maxTok,
messages:[
{role:”system”,content:sys},
{role:”user”,content:makePrompt(S.ct,topic,S.tone,S.length,S.lang,S.researchNotes)}
]
})
});
if(!res.ok){const e=await res.json().catch(()=>({}));throw new Error(e?.error?.message||”API error “+res.status);}
if(!res.body) throw new Error(“Streaming not supported.”);
otxt.classList.add(“blink”);
setStatus(“act”,”Streaming…”);
const reader=res.body.getReader();
const dec=new TextDecoder(“utf-8″);
let buf=””;
while(true){
const{done,value}=await reader.read();
if(done) break;
buf+=dec.decode(value,{stream:true});
const parts=buf.split(“\n”);
buf=parts.pop();
for(const part of parts){
const line=part.trim();
if(!line.startsWith(“data: “)) continue;
const payload=line.slice(6).trim();
if(payload===”[DONE]”) continue;
let parsed;try{parsed=JSON.parse(payload);}catch(_){continue;}
const delta=parsed?.choices?.[0]?.delta?.content;
if(typeof delta===”string”&&delta.length>0){
S.raw+=delta;
otxt.innerHTML=md2html(S.raw);
const wc=wordCount(S.raw);
const wcEl=document.getElementById(“wcchip”);
if(wcEl) wcEl.textContent=wc+” words”;
document.getElementById(“stok”).textContent=wc+” words”;
document.getElementById(“oscroll”).scrollTop=999999;
}
}
}
otxt.classList.remove(“blink”);
if(S.researchOn) rsStep(4,”done”,”Content complete ✓”);
setStatus(“ok”,”Done ✓”);
document.getElementById(“rawbox”).textContent=S.raw;
document.getElementById(“htmlbox”).textContent=md2html(S.raw);
buildSEO(S.raw,topic);
bumpUsage(); // counts for both free and paid users
addHistory(topic,S.ct);
toast(“Content generated successfully!”,”ok”);
}catch(err){
otxt.classList.remove(“blink”);
setStatus(“err”,err.message);
toast(err.message,”err”);
if(!S.raw){
document.getElementById(“outblock”).style.display=”none”;
document.getElementById(“empty”).style.display=”flex”;
}
}finally{
S.busy=false;
setBusy(false);
}
}
/* ──────────────────────────────────────────
MARKDOWN → HTML
────────────────────────────────────────── */
function md2html(src){
if(!src) return “”;
const lines=src.split(“\n”);
const out=[];
let inUL=false,inOL=false;
function cl(){if(inUL){out.push(““);inUL=false;}if(inOL){out.push(““);inOL=false;}}
function il(t){
t=t.replace(/&/g,”&”).replace(//g,”>”);
t=t.replace(/`([^`]+)`/g,”$1“);
t=t.replace(/\*\*\*(.+?)\*\*\*/g,”$1 “);
t=t.replace(/\*\*(.+?)\*\*/g,”$1 “);
t=t.replace(/__(.+?)__/g,”$1 “);
t=t.replace(/\*([^\*\n]+)\*/g,”$1 “);
t=t.replace(/_([^_\n]+)_/g,”$1 “);
return t;
}
for(const l of lines){
if(/^### /.test(l)){cl();out.push(““+il(l.slice(4))+” “);continue;}
if(/^## /.test(l)){cl();out.push(““+il(l.slice(3))+” “);continue;}
if(/^# /.test(l)){cl();out.push(““+il(l.slice(2))+” “);continue;}
if(/^—+$/.test(l.trim())){cl();out.push(“ “);continue;}
if(/^> /.test(l)){cl();out.push(““+il(l.slice(2))+” “);continue;}
if(/^[\*\-] /.test(l)){
if(!inUL){if(inOL){out.push(““);inOL=false;}out.push(““);inUL=true;}
out.push(““+il(l.slice(2))+” “);continue;
}
if(/^\d+\. /.test(l)){
if(!inOL){if(inUL){out.push(“ “);inUL=false;}out.push(““);inOL=true;}
out.push(““+il(l.replace(/^\d+\. /,””))+” “);continue;
}
cl();
if(l.trim()===””){out.push(“
“);continue;}
out.push(““+il(l)+”
See also: YouTube SEO Master Optimizer
“);
}
cl();
return out.join(“\n”);
}
/* ──────────────────────────────────────────
HELPERS
────────────────────────────────────────── */
function wordCount(t){return t.trim().split(/\s+/).filter(w=>w.length>0).length;}
function delay(ms){return new Promise(r=>setTimeout(r,ms));}
function setStatus(type,msg){
const d=document.getElementById(“sdot”);
d.className=”sdot”+(type===”act”?” act”:type===”ok”?” ok”:type===”err”?” err”:””);
document.getElementById(“stxt”).textContent=msg;
}
function buildSEO(text,kw){
const wc=wordCount(text);
const sen=text.split(/[.!?]+/).filter(s=>s.trim()).length;
const aws=Math.round(wc/Math.max(sen,1));
const kc=text.toLowerCase().split(kw.toLowerCase()).length-1;
const den=((kc/Math.max(wc,1))*100).toFixed(1);
const rdg=aws<=15?"Excellent":aws<=20?"Good":"Needs Work";
const rc=rdg==="Excellent"?"var(–em)":rdg==="Good"?"var(–gd)":"var(–rd)";
document.getElementById("seog").innerHTML=
si("Words",wc)+si("Sentences",sen)+si("Avg W/Sentence",aws)+
si("Keyword Hits",kc)+si("Density",den+"%")+
`Readability ${rdg}
`;
document.getElementById(“seobox”).style.display=”block”;
}
function si(k,v){return `${k} ${v}
`;}
function addHistory(topic,ct){
S.history.unshift({topic,ct,content:S.raw,lang:S.lang,state:S.state,time:new Date()});
if(S.history.length>8) S.history.pop();
const html=S.history.map((h,i)=>
`
${esc(h.topic)}
${CT_NAME[h.ct]||h.ct} ${h.lang} ${h.time.toLocaleTimeString()}
`
).join(“”);
document.querySelectorAll(“#hist”).forEach(el=>el.innerHTML=html);
}
function loadHist(i){
const h=S.history[i];if(!h) return;
S.raw=h.content;
document.getElementById(“empty”).style.display=”none”;
document.getElementById(“outblock”).style.display=”block”;
document.getElementById(“research-panel”).style.display=”none”;
document.getElementById(“otxt”).innerHTML=md2html(h.content);
document.getElementById(“rawbox”).textContent=h.content;
document.getElementById(“htmlbox”).textContent=md2html(h.content);
setStatus(“ok”,”Loaded from history”);
if(window.innerWidth<=767) closeDrawer();
}
window.loadHist=loadHist;
function esc(s){return s.replace(/&/g,"&").replace(//g,”>”);}
/* ──────────────────────────────────────────
QR CODE
────────────────────────────────────────── */
function buildQR(amount){
const upi=`upi://pay?pa=${encodeURIComponent(CFG.upiId)}&pn=${encodeURIComponent(CFG.payeeName)}&am=${amount}&cu=INR&tn=${encodeURIComponent(“AI Content Generator”)}`;
const src=”https://api.qrserver.com/v1/create-qr-code/?size=260×260&margin=10&bgcolor=ffffff&color=000000&data=”+encodeURIComponent(upi);
const img=document.getElementById(“qimg”);
img.src=src;
img.onerror=()=>{document.getElementById(“qbox”).innerHTML=`${CFG.upiId}
`;};
document.getElementById(“quid”).textContent=CFG.upiId;
document.getElementById(“amval”).textContent=”₹”+amount;
}
/* ──────────────────────────────────────────
MODALS
────────────────────────────────────────── */
function openPayModal(){
closeAllModals();
// Update status bar text
const sub = getActiveSub();
const used = usedToday();
const stTxt = document.getElementById(“pm-status-txt”);
const pmSub = document.querySelector(“.pmsub”);
if(sub){
const left = sub.dailyLimit – used;
if(stTxt) stTxt.textContent = “Daily limit reached (” + sub.dailyLimit + ” posts/day on ” + sub.label + “)”;
if(pmSub) pmSub.textContent = “You’ve used all ” + sub.dailyLimit + ” posts for today. Upgrade plan or wait for midnight.”;
} else {
if(stTxt) stTxt.textContent = “Free limit reached (2 free posts/day)”;
if(pmSub) pmSub.textContent = “You’ve used your 2 free posts today. Subscribe for more.”;
}
document.getElementById(“payovl”).classList.add(“open”);
buildQR(S.amount);
}
function closeAllModals(){
[“payovl”,”step2ovl”].forEach(id=>{
const el=document.getElementById(id);
if(el) el.classList.remove(“open”);
});
}
function openStep2Modal(){
document.getElementById(“payovl”).classList.remove(“open”);
document.getElementById(“step2ovl”).classList.add(“open”);
// clear previous inputs and errors
const phoneInp = document.getElementById(“user-phone”);
const codeInp = document.getElementById(“user-code-inp”);
const phoneErr = document.getElementById(“phone-err”);
const codeErr = document.getElementById(“code-err”);
if(phoneInp) phoneInp.value=””;
if(codeInp) codeInp.value=””;
if(phoneErr) phoneErr.style.display=”none”;
if(codeErr) codeErr.style.display=”none”;
setTimeout(()=>{ if(phoneInp) phoneInp.focus(); }, 200);
}
function sendWhatsAppToAdmin(){
const phoneEl = document.getElementById(“user-phone”);
const phone = phoneEl.value.trim().replace(/\D/g,””);
const phoneErr= document.getElementById(“phone-err”);
if(phone.length codeEl.classList.remove(“err-shake”), 400);
return;
}
// SUCCESS — activatePlan called inside redeemCode
closeAllModals();
refreshUI();
codeEl.value=””;
const sub2 = getActiveSub();
const planLabel = sub2 ? sub2.label+” Plan · “+daysLeft()+” days · “+sub2.dailyLimit+” posts/day” : “Plan activated!”;
toast(“🎉 “+planLabel,”ok”);
}
/* ──────────────────────────────────────────
ADMIN GATE
────────────────────────────────────────── */
let gateAttempts = 0;
function openAdminGate(){
document.getElementById(“admin-gate-ovl”).classList.add(“open”);
document.getElementById(“gate-pw”).value=””;
document.getElementById(“gate-err”).textContent=””;
setTimeout(()=>document.getElementById(“gate-pw”).focus(),200);
}
function closeAdminGate(){
document.getElementById(“admin-gate-ovl”).classList.remove(“open”);
}
function checkAdminPassword(){
const pw = document.getElementById(“gate-pw”).value;
if(pw === CFG.adminPassword){
gateAttempts = 0;
sessionStorage.setItem(CFG.adminSession,”1″);
closeAdminGate();
openAdminPanel();
} else {
gateAttempts++;
const inp = document.getElementById(“gate-pw”);
inp.classList.add(“err”);
setTimeout(()=>inp.classList.remove(“err”),350);
inp.value=””;
const left = Math.max(0, 5-gateAttempts);
document.getElementById(“gate-err”).textContent =
left > 0 ? `Incorrect password. ${left} attempt${left===1?””:”s”} remaining.`
: “Too many attempts. Refresh and try again.”;
if(gateAttempts >= 5) document.getElementById(“gate-submit”).disabled=true;
}
}
/* ──────────────────────────────────────────
ADMIN PANEL
────────────────────────────────────────── */
let currentCode = null; // last generated code object
function openAdminPanel(){
document.getElementById(“admin-ovl”).classList.add(“open”);
document.body.style.overflow=”hidden”;
renderCodesTable();
updateAdminStats();
}
function closeAdminPanel(){
document.getElementById(“admin-ovl”).classList.remove(“open”);
document.body.style.overflow=””;
}
function lockAdmin(){
sessionStorage.removeItem(CFG.adminSession);
closeAdminPanel();
toast(“Admin panel locked.”,”ok”);
}
function updateAdminStats(){
const codes = loadCodes();
const used = codes.filter(c=>c.used).length;
document.getElementById(“stat-total”).textContent = codes.length;
document.getElementById(“stat-unused”).textContent = codes.length – used;
document.getElementById(“stat-used”).textContent = used;
}
function renderCodesTable(){
const codes = loadCodes();
const list = document.getElementById(“codes-list”);
if(!list) return;
if(codes.length===0){
list.innerHTML=’No codes issued yet
‘;
return;
}
// newest first
const sorted = […codes].reverse();
list.innerHTML = sorted.map(c=>{
const pObj = CFG.plans[c.plan] || {};
const planLbl = pObj.label || c.plan;
const planCls = c.plan===”weekly”?”plan-day”:”plan-month”;
const stLbl = c.used?”Used”:”Active”;
const stCls = c.used?”st-used”:”st-unused”;
const dt = c.issuedAt ? new Date(c.issuedAt).toLocaleDateString(“en-IN”,{day:”2-digit”,month:”short”}) : “”;
return `
${c.code}
${c.phone}
${planLbl}
${stLbl}
✕
`;
}).join(“”);
updateAdminStats();
}
window.adminDeleteCode = function(code){
if(!confirm(“Delete code “+code+”? This cannot be undone.”)) return;
deleteCode(code);
renderCodesTable();
toast(“Code “+code+” deleted.”,”ok”);
};
function adminGenerateCode(){
const phone = document.getElementById(“ap-phone”).value.trim();
const plan = document.getElementById(“ap-plan”).value;
if(!/^\d{7,15}$/.test(phone)){
toast(“Enter a valid phone number (digits only, 7-15 chars).”,”err”);
document.getElementById(“ap-phone”).focus();
return;
}
const code = issueCode(phone, plan);
currentCode = { code, phone, plan };
// Show code display
document.getElementById(“code-val”).textContent = code.split(“”).join(” “);
document.getElementById(“cd-phone-show”).textContent = phone;
const planShowObj = CFG.plans[plan] || {};
document.getElementById(“cd-plan-show”).textContent = planShowObj.label
? planShowObj.label + ” — ₹” + planShowObj.price + ” · ” + planShowObj.dailyLimit + “/day”
: plan;
document.getElementById(“cd-time-show”).textContent = new Date().toLocaleTimeString(“en-IN”);
document.getElementById(“code-display”).classList.add(“visible”);
renderCodesTable();
toast(“Code “+code+” generated for “+phone,”ok”);
}
function copyGeneratedCode(){
if(!currentCode) return;
navigator.clipboard.writeText(currentCode.code).then(()=>{
const b = document.getElementById(“cd-copy-btn”);
b.textContent=”✅ Copied!”;
setTimeout(()=>{ b.textContent=”📋 Copy Code”; },2000);
});
}
function sendViaWhatsApp(){
if(!currentCode) return;
const {code, phone, plan} = currentCode;
const planObj = CFG.plans[plan] || {};
const planLabel = planObj.label
? planObj.label + ” — ₹” + planObj.price + ” · ” + planObj.days + ” days · ” + planObj.dailyLimit + ” posts/day”
: plan;
const msg =
`🇮🇳 *AI Content Generator — Access Code*\n\n` +
`Hello! Your premium access code is ready.\n\n` +
`🔑 *Code:* \`${code}\`\n` +
`📦 *Plan:* ${planLabel}\n\n` +
`*How to activate:*\n` +
`1. Open the AI Content Generator\n` +
`2. Tap *Generate* → upgrade screen appears\n` +
`3. Enter code *${code}* in the “Have an Access Code?” box\n` +
`4. Tap *REDEEM* — instant access! ✅\n\n` +
`This code is unique to your number and can only be used once.\n\n` +
`Need help? Reply to this message. 🙏`;
// Strip leading zeros / + for wa.me
const cleanPhone = phone.replace(/^\+/,””).replace(/\s/g,””);
const url = `https://wa.me/${cleanPhone}?text=${encodeURIComponent(msg)}`;
window.open(url,”_blank”);
}
/* ──────────────────────────────────────────
TABS
────────────────────────────────────────── */
function switchTab(t){
S.tab=t;
document.querySelectorAll(“.tab”).forEach(b=>b.classList.toggle(“on”,b.dataset.tab===t));
document.getElementById(“tab-preview”).style.display=t===”preview”?”block”:”none”;
document.getElementById(“rawbox”).style.display=t===”raw”?”block”:”none”;
document.getElementById(“htmlbox”).style.display=t===”html”?”block”:”none”;
}
function copyContent(){
if(!S.raw) return;
navigator.clipboard.writeText(S.tab===”html”?md2html(S.raw):S.raw).then(()=>{
const b=document.getElementById(“copybtn”);
b.innerHTML=”✅”; setTimeout(()=>{b.innerHTML=’📋 Copy ‘;},2000);
}).catch(()=>toast(“Copy failed.”,”err”));
}
function downloadContent(){
if(!S.raw) return;
const slug=(document.querySelectorAll(“#topic”)[0]?.value||”content”).trim().slice(0,28).replace(/\s+/g,”-“);
const isH=S.tab===”html”;
const blob=new Blob([isH?md2html(S.raw):S.raw],{type:”text/plain;charset=utf-8″});
const url=URL.createObjectURL(blob);
const a=Object.assign(document.createElement(“a”),{href:url,download:slug+(isH?”.html”:”.txt”)});
document.body.appendChild(a);a.click();document.body.removeChild(a);
URL.revokeObjectURL(url);
}
function clearOutput(){
S.raw=””;
document.getElementById(“empty”).style.display=”flex”;
document.getElementById(“outblock”).style.display=”none”;
document.getElementById(“otxt”).innerHTML=””;
document.getElementById(“rawbox”).textContent=””;
document.getElementById(“htmlbox”).textContent=””;
setStatus(“”,”Idle”);
document.getElementById(“stok”).textContent=””;
}
/* ──────────────────────────────────────────
TOAST
────────────────────────────────────────── */
let _tt=null;
function toast(msg,type){
const el=document.getElementById(“toast”);
document.getElementById(“tico”).textContent=type===”ok”?”✅”:”⚠️”;
document.getElementById(“tmsg”).textContent=msg;
el.className=”toast show “+(type===”ok”?”tok”:”terr”);
clearTimeout(_tt);
_tt=setTimeout(()=>{el.className=”toast”;},4500);
}
/* ──────────────────────────────────────────
INIT
────────────────────────────────────────── */
document.addEventListener(“DOMContentLoaded”,()=>{
renderSidebar();
refreshUI();
// tabs
document.querySelectorAll(“.tab”).forEach(t=>t.addEventListener(“click”,()=>switchTab(t.dataset.tab)));
// toolbar
document.getElementById(“copybtn”).addEventListener(“click”,copyContent);
document.getElementById(“dlbtn”).addEventListener(“click”,downloadContent);
document.getElementById(“clrbtn”).addEventListener(“click”,clearOutput);
// mobile gen btn
const mobBtn=document.getElementById(“mob-genbtn”);
if(mobBtn) mobBtn.addEventListener(“click”,generate);
// plan select — dynamic from CFG.plans
document.querySelectorAll(“.plan”).forEach(p=>{
p.addEventListener(“click”,()=>{
document.querySelectorAll(“.plan”).forEach(x=>x.classList.remove(“on”));
p.classList.add(“on”);
S.plan = p.dataset.plan;
S.amount = parseInt(p.dataset.amt, 10);
const planObj = CFG.plans[S.plan];
document.getElementById(“amval”).textContent = “₹” + S.amount;
const planLbl = document.getElementById(“plan-selected-lbl”);
if(planLbl && planObj) planLbl.textContent = planObj.label + ” — ” + planObj.days + ” days”;
buildQR(S.amount);
});
});
// modal buttons
document.getElementById(“pclose”).addEventListener(“click”, closeAllModals);
document.getElementById(“paidbtn”).addEventListener(“click”, openStep2Modal);
// step2 modal
document.getElementById(“wa-notify-btn”).addEventListener(“click”, sendWhatsAppToAdmin);
document.getElementById(“redeem-code-btn”).addEventListener(“click”, redeemUserCode);
document.getElementById(“step2-back”).addEventListener(“click”, openPayModal);
// only allow digits in code input
const codeInp = document.getElementById(“user-code-inp”);
if(codeInp){
codeInp.addEventListener(“input”, function(){ this.value=this.value.replace(/\D/g,””).slice(0,6); });
codeInp.addEventListener(“keydown”, e=>{ if(e.key===”Enter”) redeemUserCode(); });
}
// close on backdrop click
[“payovl”,”step2ovl”].forEach(id=>{
const el=document.getElementById(id);
if(el) el.addEventListener(“click”,e=>{ if(e.target.id===id) closeAllModals(); });
});
document.addEventListener(“keydown”,e=>{ if(e.key===”Escape”){ closeAllModals(); closeAdminGate(); } });
/* ── ADMIN SECRET DOT: 5 rapid taps within 2 seconds ── */
(function(){
const dot = document.getElementById(“admin-trigger”);
let tapCount= 0;
let tapTimer= null;
const TAPS_NEEDED = 5;
const WINDOW_MS = 2000; // reset window
function flashDot(){
dot.classList.add(“tap-flash”);
setTimeout(()=>dot.classList.remove(“tap-flash”), 160);
}
function resetTaps(){
tapCount = 0;
clearTimeout(tapTimer);
}
function handleTap(e){
e.preventDefault();
e.stopPropagation();
tapCount++;
flashDot();
clearTimeout(tapTimer);
if(tapCount >= TAPS_NEEDED){
// UNLOCKED
tapCount = 0;
dot.classList.add(“unlock-anim”);
setTimeout(()=>dot.classList.remove(“unlock-anim”), 420);
setTimeout(()=>{
if(sessionStorage.getItem(CFG.adminSession)===”1″){
openAdminPanel();
} else {
openAdminGate();
}
}, 200);
} else {
// Reset if no next tap within window
tapTimer = setTimeout(resetTaps, WINDOW_MS);
}
}
dot.addEventListener(“click”, handleTap);
dot.addEventListener(“touchend”, handleTap, {passive:false});
})();
/* ── ADMIN GATE ── */
document.getElementById(“gate-submit”).addEventListener(“click”, checkAdminPassword);
document.getElementById(“gate-pw”).addEventListener(“keydown”,e=>{ if(e.key===”Enter”) checkAdminPassword(); });
document.getElementById(“gate-cancel”).addEventListener(“click”, closeAdminGate);
document.getElementById(“admin-gate-ovl”).addEventListener(“click”,e=>{
if(e.target.id===”admin-gate-ovl”) closeAdminGate();
});
/* ── ADMIN PANEL ── */
document.getElementById(“ap-close”).addEventListener(“click”, closeAdminPanel);
document.getElementById(“ap-lock-btn”).addEventListener(“click”, lockAdmin);
document.getElementById(“admin-ovl”).addEventListener(“click”,e=>{
if(e.target.id===”admin-ovl”) closeAdminPanel();
});
document.getElementById(“ap-gen-btn”).addEventListener(“click”, adminGenerateCode);
document.getElementById(“cd-copy-btn”).addEventListener(“click”, copyGeneratedCode);
document.getElementById(“wa-send-btn”).addEventListener(“click”, sendViaWhatsApp);
document.getElementById(“ap-phone”).addEventListener(“keydown”,e=>{ if(e.key===”Enter”) adminGenerateCode(); });
/* ── REDEEM shortcut in pay modal ── */
function redeemFromPayModal(){
const inp = document.getElementById(“redeem-inp”);
const err = document.getElementById(“redeem-err”);
err.style.display=”none”;
const raw = (inp.value||””).trim();
const result = redeemCode(raw);
if(!result.ok){
err.textContent = result.error;
err.style.display=”block”;
inp.classList.add(“err-shake”);
setTimeout(()=>inp.classList.remove(“err-shake”),400);
return;
}
closeAllModals();
refreshUI();
inp.value=””;
const sub2 = getActiveSub();
const lbl = sub2 ? sub2.label+” · “+daysLeft()+”d · “+sub2.dailyLimit+”/day” : “Plan active!”;
toast(“🎉 “+lbl,”ok”);
}
const redeemBtn = document.getElementById(“redeem-btn”);
const redeemInp = document.getElementById(“redeem-inp”);
if(redeemBtn) redeemBtn.addEventListener(“click”, redeemFromPayModal);
if(redeemInp){
redeemInp.addEventListener(“input”,function(){ this.value=this.value.replace(/\D/g,””).slice(0,6); });
redeemInp.addEventListener(“keydown”,e=>{ if(e.key===”Enter”) redeemFromPayModal(); });
}
});
My Name is Sourav Mukherjee. I am a Website Developer and SEO Expart. AllBestTool.com is a browser-based collection of free online utilities — everything from PDF converters and text tools to SEO helpers and calculators. The idea is pretty simple: make a bunch of useful web tools available in one place without requiring users to sign up.
Latest posts by allbesttool.com
(see all )