!DOCTYPE html html lang=en head meta charset=UTF-8 meta name=viewport content=width=device-width, initial-scale=1, viewport-fit=cover meta name=theme-color content=#07070b titleVIDORA — Photos, Videos & Newstitle link rel=preconnect href=httpsfonts.googleapis.com link rel=preconnect href=httpsfonts.gstatic.com crossorigin link href=httpsfonts.googleapis.comcss2family=Hind+Siliguriwght@400;500;600;700&family=Playfair+Displaywght@700;800&display=swap rel=stylesheet script src=httpswww.gstatic.comfirebasejs10.12.2firebase-app-compat.jsscript script src=httpswww.gstatic.comfirebasejs10.12.2firebase-auth-compat.jsscript script src=httpswww.gstatic.comfirebasejs10.12.2firebase-firestore-compat.jsscript style root { --bg #07070b; --card #12121a; --card2 #1a1a25; --tx #f4f0e6; --mut #9a95a8; --ac #f0c45c; --ac2 #c58a22; --ln rgba(240, 196, 92, .22); --ok #22c55e; --bad #ef4444; --r 16px; --sh 0 14px 40px rgba(0, 0, 0, .55); } { box-sizing border-box; margin 0; padding 0; -webkit-tap-highlight-color transparent; } html { scroll-behavior smooth; } body { background var(--bg); color var(--tx); font-family 'Hind Siliguri', system-ui, -apple-system, sans-serif; line-height 1.6; overflow-x hidden; min-height 100vh; } bodybefore { content ''; position fixed; inset 0; z-index -1; background radial-gradient(600px 400px at 10% -5%, rgba(240, 196, 92, .16), transparent 70%), radial-gradient(700px 500px at 100% 10%, rgba(197, 138, 34, .12), transparent 70%), radial-gradient(500px 400px at 50% 110%, rgba(139, 92, 246, .08), transparent 70%); } a { color inherit; text-decoration none; } img, video { max-width 100%; display block; } button, input, select, textarea { font inherit; color inherit; } input, select, textarea { font-size 16px; } .wrap { max-width 1280px; margin 0 auto; padding 0 14px; } .serif { font-family 'Playfair Display', 'Hind Siliguri', serif; } .mut { color var(--mut); } .sm { font-size .82rem; } Buttons .btn { border 0; cursor pointer; padding 11px 22px; border-radius 99px; font-weight 700; color #1b1406; background linear-gradient(135deg, #fbe9a8, var(--ac), var(--ac2)); box-shadow 0 6px 20px rgba(240, 196, 92, .25); transition .25s ease; white-space nowrap; display inline-flex; align-items center; justify-content center; gap 6px; } .btnhovernot(disabled) { transform translateY(-2px); box-shadow 0 10px 26px rgba(240, 196, 92, .4); } .btn.gh { background var(--card2); color var(--tx); border 1px solid var(--ln); box-shadow none; } .btn.ghhovernot(disabled) { border-color var(--ac); color var(--ac); } .btn.ok { background var(--ok); color #fff; box-shadow none; } .btn.bad { background var(--bad); color #fff; box-shadow none; } .btn.sm2 { padding 7px 14px; font-size .82rem; } .btndisabled { opacity .5; cursor not-allowed; } Header .hd { position sticky; top 0; z-index 50; background rgba(7, 7, 11, .82); backdrop-filter blur(18px); border-bottom 1px solid var(--ln); } .hd .wrap { display flex; align-items center; gap 8px; height 64px; overflow-x auto; } .brand { font-family 'Playfair Display', serif; font-weight 800; font-size 1.4rem; letter-spacing 2.5px; background linear-gradient(135deg, #fff3c4, var(--ac), var(--ac2)); -webkit-background-clip text; background-clip text; color transparent; display flex; align-items center; gap 8px; white-space nowrap; } .brand img { height 34px; } .brand i { font-style normal; -webkit-text-fill-color var(--ac); } .sp { flex 1; } .ib { position relative; min-width 40px; height 40px; padding 0 13px; border-radius 99px; border 1px solid var(--ln); background var(--card); cursor pointer; display inline-flex; align-items center; justify-content center; gap 6px; font-size .9rem; transition .2s; white-space nowrap; } .ibhover { border-color var(--ac); } .ib b { color var(--ac); } .dot { position absolute; top -3px; right -3px; min-width 18px; height 18px; border-radius 99px; background var(--bad); color #fff; font-size .7rem; font-weight 700; display flex; align-items center; justify-content center; padding 0 4px; } Hero .hero { margin 18px 0 10px; border-radius 24px; padding 28px 22px; position relative; overflow hidden; border 1px solid var(--ln); background linear-gradient(120deg, rgba(240, 196, 92, .14), rgba(26, 26, 37, .75) 60%, rgba(197, 138, 34, .12)); } .heroafter { content ''; position absolute; right -60px; top -60px; width 220px; height 220px; border-radius 50%; background radial-gradient(circle, rgba(240, 196, 92, .32), transparent 70%); } .hero h1 { font-family 'Playfair Display', 'Hind Siliguri', serif; font-size 1.75rem; line-height 1.25; margin-bottom 6px; } .hero h1 span { background linear-gradient(135deg, #fff3c4, var(--ac), var(--ac2)); -webkit-background-clip text; background-clip text; color transparent; } .hero p { color var(--mut); max-width 580px; } @media (min-width 760px) { .hero { padding 40px; } .hero h1 { font-size 2.45rem; } } .ann { margin-top 12px; display inline-block; padding 5px 14px; border-radius 99px; background rgba(0, 0, 0, .4); border 1px solid var(--ln); font-size .85rem; color var(--ac); } Section Tabs & Toolbar .sec-nav { display flex; gap 10px; margin 18px 0 8px; flex-wrap wrap; } .sec-btn { padding 10px 22px; border-radius 99px; border 1px solid var(--ln); background var(--card); color var(--tx); font-weight 700; cursor pointer; transition .25s; } .sec-btnhover { border-color var(--ac); } .sec-btn.active { background linear-gradient(135deg, #fbe9a8, var(--ac), var(--ac2)); color #1b1406; border-color transparent; box-shadow 0 6px 20px rgba(240, 196, 92, .3); } .bar { display flex; align-items center; gap 10px; margin 14px 0 14px; flex-wrap wrap; } .bar h2 { font-family 'Playfair Display', 'Hind Siliguri', serif; font-size 1.35rem; } .bar h2after { content ''; display block; width 48px; height 2px; margin-top 6px; background linear-gradient(90deg, var(--ac), transparent); } .srch { margin-left auto; display flex; align-items center; background var(--card); border 1px solid var(--ln); border-radius 99px; padding 0 14px; flex 1; max-width 360px; min-width 180px; } .srch input { background none; border 0; outline 0; padding 10px 8px; width 100%; } Grids .grid { display grid; gap 14px; grid-template-columns repeat(2, 1fr); } @media (min-width 640px) { .grid { grid-template-columns repeat(3, 1fr); gap 16px; } } @media (min-width 960px) { .grid { grid-template-columns repeat(4, 1fr); } } @media (min-width 1240px) { .grid { grid-template-columns repeat(5, 1fr); } } .news-grid { display grid; gap 16px; grid-template-columns 1fr; } @media (min-width 680px) { .news-grid { grid-template-columns repeat(2, 1fr); } } @media (min-width 1024px) { .news-grid { grid-template-columns repeat(3, 1fr); } } .vc, .icard { display block; cursor pointer; transition transform .25s; } @media (hover hover) { .vchover, .icardhover { transform translateY(-5px); } } .th { position relative; border-radius var(--r); overflow hidden; background linear-gradient(135deg, #252532, #101018); border 1px solid var(--ln); box-shadow var(--sh); aspect-ratio 16 9; transition .25s; } .vc.pt .th { aspect-ratio 9 14; } .icard .th { aspect-ratio 4 3; } @media (hover hover) { .vchover .th, .icardhover .th { border-color var(--ac); box-shadow 0 16px 40px rgba(0, 0, 0, .65), 0 0 22px rgba(240, 196, 92, .22); } } .th .ph { position absolute; inset 0; display flex; align-items center; justify-content center; font-size 2.3rem; opacity .45; } .th img, .th video { position absolute; inset 0; width 100%; height 100%; object-fit cover; transition transform .5s; } @media (hover hover) { .vchover .th img, .vchover .th video, .icardhover .th img { transform scale(1.07); } } .pl { position absolute; left 50%; top 50%; width 46px; height 46px; margin -23px 0 0 -23px; border-radius 50%; background rgba(0, 0, 0, .55); backdrop-filter blur(4px); border 1.5px solid var(--ac); color var(--ac); display flex; align-items center; justify-content center; padding-left 3px; transition .25s; } @media (hover hover) { .vchover .pl { background var(--ac); color #1b1406; transform scale(1.1); } } .bd { position absolute; top 9px; left 9px; font-size .7rem; font-weight 700; padding 3px 10px; border-radius 99px; letter-spacing .3px; } .bd.f { background rgba(22, 163, 74, .92); color #fff; } .bd.p { background linear-gradient(135deg, #fbe9a8, var(--ac2)); color #1b1406; } .bd.cat { background rgba(18, 18, 26, .88); border 1px solid var(--ln); color var(--ac); } .vn { position absolute; top 9px; right 9px; font-size .68rem; padding 2px 8px; border-radius 7px; background rgba(0, 0, 0, .65); color #fff; } .cap { position absolute; left 0; right 0; bottom 0; padding 34px 10px 9px; background linear-gradient(transparent, rgba(0, 0, 0, .92)); } .cap h3 { font-size .9rem; font-weight 600; line-height 1.35; display -webkit-box; -webkit-line-clamp 2; -webkit-box-orient vertical; overflow hidden; } News Cards .ncard { background var(--card); border 1px solid var(--ln); border-radius var(--r); overflow hidden; box-shadow var(--sh); display flex; flex-direction column; cursor pointer; transition .25s; } .ncardhover { transform translateY(-4px); border-color var(--ac); } .ncard .nth { position relative; aspect-ratio 16 9; background var(--card2); overflow hidden; } .ncard .nth img { width 100%; height 100%; object-fit cover; } .ncard .nbody { padding 15px; flex 1; display flex; flex-direction column; gap 8px; } .ncard h3 { font-size 1.08rem; line-height 1.35; display -webkit-box; -webkit-line-clamp 2; -webkit-box-orient vertical; overflow hidden; } .ncard p { font-size .88rem; color var(--mut); display -webkit-box; -webkit-line-clamp 3; -webkit-box-orient vertical; overflow hidden; } .ncard .nmeta { margin-top auto; display flex; justify-content space-between; align-items center; font-size .78rem; color var(--ac); padding-top 8px; border-top 1px solid rgba(255, 255, 255, .06); } .sk { background linear-gradient(90deg, #14141c 25%, #1e1e2a 50%, #14141c 75%); background-size 200% 100%; animation sh 1.3s infinite; border-radius var(--r); aspect-ratio 16 9; } @keyframes sh { to { background-position -200% 0; } } .empty { grid-column 1 -1; text-align center; color var(--mut); padding 50px 0; } Ads .ad { margin 14px 0; text-align center; overflow hidden; max-width 100%; } .ad small { display block; font-size .66rem; color var(--mut); margin-bottom 3px; } .ad.feed { grid-column 1 -1; margin 2px 0; } Footer .ft { border-top 1px solid var(--ln); margin-top 44px; padding 26px 0 80px; text-align center; color var(--mut); font-size .88rem; } .ft .so { display flex; gap 10px; justify-content center; flex-wrap wrap; margin-bottom 12px; } .ft .so a { padding 8px 16px; border-radius 99px; background var(--card); border 1px solid var(--ln); color var(--tx); } .ft .so ahover { border-color var(--ac); color var(--ac); } Modals .mo { position fixed; inset 0; z-index 100; background rgba(0, 0, 0, .82); backdrop-filter blur(5px); display flex; padding 14px; overflow-y auto; } .box { position relative; margin auto; width 100%; max-width 460px; background linear-gradient(180deg, var(--card2), var(--card)); border 1px solid var(--ln); border-radius 20px; padding 22px; box-shadow var(--sh); animation pop .22s; } .box.big { max-width 780px; } @keyframes pop { from { transform scale(.96); opacity 0; } to { transform none; opacity 1; } } .box h3 { font-family 'Playfair Display', 'Hind Siliguri', serif; color var(--ac); margin-bottom 8px; padding-right 40px; } .x { position absolute; right 12px; top 12px; width 36px; height 36px; border-radius 50%; border 0; background rgba(255, 255, 255, .08); cursor pointer; z-index 3; } .box label { display block; margin-top 10px; font-size .82rem; color var(--mut); } .box input, .box select, .box textarea { width 100%; margin-top 4px; padding 11px 12px; border-radius 12px; border 1px solid rgba(255, 255, 255, .14); background rgba(0, 0, 0, .38); outline 0; } .box inputfocus, .box selectfocus, .box textareafocus { border-color var(--ac); } .box .btn.full { width 100%; margin-top 14px; } .tabs { display flex; gap 6px; margin 10px 0; background rgba(0, 0, 0, .35); padding 5px; border-radius 99px; flex-wrap wrap; } .tabs button { flex 1; min-width 75px; border 0; padding 8px 10px; border-radius 99px; background none; cursor pointer; font-size .84rem; color var(--mut); font-weight 600; } .tabs button.on { background linear-gradient(135deg, #fbe9a8, var(--ac), var(--ac2)); color #1b1406; font-weight 700; } .bal { padding 16px; border-radius 16px; background linear-gradient(135deg, rgba(240, 196, 92, .2), rgba(197, 138, 34, .12)); border 1px solid var(--ln); text-align center; margin 8px 0; } .bal b { display block; font-size 2rem; color var(--ac); } .num { display flex; align-items center; gap 8px; margin-top 8px; padding 10px 12px; border-radius 12px; border 1px dashed var(--ln); background rgba(0, 0, 0, .3); } .num span { flex 1; font-weight 700; } .num button { border 0; background var(--ac); color #1b1406; border-radius 8px; padding 6px 12px; font-weight 700; cursor pointer; font-size .8rem; } .li { padding 12px; border-radius 12px; background rgba(0, 0, 0, .28); border 1px solid rgba(255, 255, 255, .07); margin-top 10px; font-size .9rem; } .li .t { display flex; justify-content space-between; align-items center; gap 8px; flex-wrap wrap; } .st { font-size .72rem; padding 2px 9px; border-radius 99px; font-weight 700; } .st.pending { background #f59e0b; color #1b1406; } .st.approved, .st.paid, .st.bought { background var(--ok); color #fff; } .st.rejected { background var(--bad); color #fff; } .adm-row { display grid; grid-template-columns 1fr 1fr; gap 10px; } @media (max-width 560px) { .adm-row { grid-template-columns 1fr; } } .adm-actions { display flex; gap 6px; margin-top 8px; flex-wrap wrap; } Fullscreen Viewer (Player Lightbox Reader) .pg { position fixed; inset 0; z-index 80; background var(--bg); overflow-y auto; } .pg .top { position sticky; top 0; z-index 5; display flex; align-items center; gap 10px; padding 10px 14px; background rgba(7, 7, 11, .88); backdrop-filter blur(14px); border-bottom 1px solid var(--ln); } .pg .top b { flex 1; white-space nowrap; overflow hidden; text-overflow ellipsis; } .pw { max-width 980px; margin 0 auto; padding 16px 14px 80px; } .stage { position relative; margin 0 auto; aspect-ratio 16 9; background #000; border 1px solid var(--ln); border-radius 20px; overflow hidden; box-shadow 0 20px 60px rgba(0, 0, 0, .75); } .stage.pt { aspect-ratio 9 16; max-width min(420px, calc((100svh - 140px) .5625)); } .stage iframe, .stage video { position absolute; inset 0; width 100%; height 100%; border 0; background #000; } .stage img { position absolute; inset 0; width 100%; height 100%; object-fit cover; } .ov { position absolute; inset 0; display flex; flex-direction column; align-items center; justify-content center; gap 8px; text-align center; padding 16px; background rgba(6, 6, 10, .8); backdrop-filter blur(8px); } .ov .ic { font-size 2.5rem; } .cnt { font-size 2rem; font-weight 800; color var(--ac); font-family 'Playfair Display', serif; } .ptitle { font-size 1.5rem; margin 16px 0 6px; font-family 'Playfair Display', 'Hind Siliguri', serif; } .meta { display flex; gap 8px 14px; flex-wrap wrap; color var(--mut); font-size .88rem; } .shr { display flex; gap 8px; flex-wrap wrap; margin 14px 0; align-items center; } .shr a, .shr button { padding 8px 16px; border-radius 99px; border 0; cursor pointer; color #fff; font-size .85rem; font-weight 600; } .art-body { margin-top 16px; font-size 1.05rem; line-height 1.85; white-space pre-line; color #ece7db; } .lb-img { max-height 76vh; width auto; margin 0 auto; border-radius 16px; border 1px solid var(--ln); box-shadow var(--sh); } .spin { width 42px; height 42px; border 4px solid rgba(255, 255, 255, .2); border-top-color var(--ac); border-radius 50%; animation sp .8s linear infinite; } @keyframes sp { to { transform rotate(360deg); } } Live Chat .fab { position fixed; right 14px; bottom 18px; z-index 60; width 56px; height 56px; border-radius 50%; border 0; cursor pointer; font-size 1.5rem; background linear-gradient(135deg, #fbe9a8, var(--ac), var(--ac2)); color #1b1406; box-shadow 0 10px 28px rgba(197, 138, 34, .5); } .chat { position fixed; right 12px; bottom 84px; z-index 95; width min(370px, calc(100vw - 24px)); height min(500px, calc(100svh - 110px)); display flex; flex-direction column; background var(--card); border 1px solid var(--ln); border-radius 20px; box-shadow var(--sh); overflow hidden; } .chat .h { padding 12px 14px; background linear-gradient(135deg, rgba(240, 196, 92, .25), rgba(197, 138, 34, .18)); display flex; justify-content space-between; align-items center; font-weight 700; } .chat .h button { border 0; background rgba(255, 255, 255, .1); width 30px; height 30px; border-radius 50%; cursor pointer; } .chat .ms { flex 1; overflow-y auto; padding 12px; display flex; flex-direction column; gap 8px; } .m { max-width 80%; padding 8px 12px; border-radius 14px; font-size .92rem; word-break break-word; } .m.u { align-self flex-end; background linear-gradient(135deg, #fbe9a8, var(--ac2)); color #1b1406; } .m.a { align-self flex-start; background var(--card2); border 1px solid var(--ln); } .chat form { display flex; gap 6px; padding 10px; border-top 1px solid var(--ln); } .chat input { flex 1; min-width 0; padding 10px 14px; border-radius 99px; border 1px solid var(--ln); background var(--bg); outline 0; } .chat form button { border 0; border-radius 99px; padding 0 16px; background var(--ac); color #1b1406; font-weight 700; cursor pointer; } .toast { position fixed; left 50%; bottom 90px; transform translateX(-50%); z-index 300; background #14141c; color var(--ac); border 1px solid var(--ln); padding 10px 20px; border-radius 99px; box-shadow var(--sh); max-width 92vw; text-align center; } .setup { max-width 560px; margin 80px auto; padding 24px; border 1px dashed var(--ln); border-radius 18px; text-align center; } style head body header class=hd div class=wrap a class=brand href=# id=brandi▶i VIDORAa span class=spspan button class=ib id=badm type=button style=displaynone⚙️ Adminbutton button class=ib id=bnote type=button aria-label=Notifications🔔button button class=ib id=bwal type=button style=displaynone💰 b id=balv৳0bbutton button class=btn sm2 id=blog type=buttonLog Inbutton div header main div class=wrap section class=hero h1 id=hTPhotos, Videos & News, spanAll in One Placespanh1 p id=hPCurated galleries, daily videos, and breaking updates in one streamlined hub.p div class=ann id=ann style=displaynonediv section div id=adtopdiv nav class=sec-nav aria-label=Content Sections button class=sec-btn active data-sec=videos type=button🎬 Videosbutton button class=sec-btn data-sec=images type=button🖼️ Photosbutton button class=sec-btn data-sec=news type=button📰 Newsbutton nav div class=bar h2 id=secTitle🎬 All Videosh2 label class=srch🔍input id=q type=search placeholder=Search content... label div div class=grid id=grid div class=skdivdiv class=skdivdiv class=skdivdiv class=skdiv div div id=adbotdiv div main footer class=ft div class=wrap div class=so id=sodiv div id=fcopydiv div footer button class=fab id=fab type=button aria-label=Live chat💬span class=dot id=fdot style=displaynone1spanbutton div id=rootdiv script (function () { 'use strict'; ============ 1. FIREBASE CONFIGURATION ============ var FBCFG = { apiKey '', authDomain '', projectId '', appId '' }; Set your Admin Email here (or add a doc at Firestore admins{uid}) var ADMIN_EMAIL = ''; =================================================== var D = document; var $ = function (s, r) { return (r D).querySelector(s); }; var esc = function (s) { return String(s == null '' s).replace([&']g, function (c) { return { '&' '&', '' '<', '' '>', '' '"', ' ''' }[c]; }); }; function money(n) { return '৳' + (Math.round((+n 0) 100) 100); } function toast(m) { var t = D.createElement('div'); t.className = 'toast'; t.textContent = m; D.body.appendChild(t); setTimeout(function () { t.remove(); }, 2800); } function copy(txt) { if (navigator.clipboard && navigator.clipboard.writeText) { navigator.clipboard.writeText(txt).then(function () { toast('Copied ✓'); }); return; } var i = D.createElement('textarea'); i.value = txt; D.body.appendChild(i); i.select(); try { D.execCommand('copy'); toast('Copied ✓'); } catch (e) {} i.remove(); } function fdate(ts) { try { var d = ts && ts.toDate ts.toDate() new Date(); return d.toLocaleDateString('en-US', { day 'numeric', month 'short', year 'numeric' }); } catch (e) { return ''; } } if (!FBCFG.apiKey !FBCFG.projectId) { $('main .wrap').innerHTML = 'div class=setuph2⚙️ Firebase Setup Requiredh2' + 'p class=mut style=margin-top8pxOpen codeindex.htmlcode and paste your Firebase Web App credentials into codeFBCFGcode.pdiv'; return; } firebase.initializeApp(FBCFG); var auth = firebase.auth(); var db = firebase.firestore(); var FV = firebase.firestore.FieldValue; var S = { user null, prof null, isAdmin false, set {}, section 'videos', videos [], vById {}, images [], iById {}, news [], nById {}, notes [], notesAll [], notesMe [], chatOpen false }; var unsubs = []; ---------- Video URL Parser ---------- function parseVideo(u) { u = String(u '').trim(); var m; if (drive.google.com.test(u) && ((m = u.match(d([w-]+))) (m = u.match([&]id=([w-]+))))) return { p 'drive', embed 'httpsdrive.google.comfiled' + m[1] + 'preview', thumb 'httpsdrive.google.comthumbnailid=' + m[1] + '&sz=w640' }; if (facebook.comfb.watchfb.com.test(u)) return { p 'facebook', embed 'httpswww.facebook.compluginsvideo.phphref=' + encodeURIComponent(u) + '&show_text=false&t=0', thumb '' }; if (tera1024terafreeterabox4funboxmirroboxnephoboxmomeryboxi.test(u) && ((m = u.match(s1([w-]+))) (m = u.match(surl=([w-]+))))) return { p 'terabox', embed 'httpswww.terabox.comsharingembedsurl=' + m[1] + '&autoplay=true&mute=false', thumb '' }; if (.(mp4webmmovm3u8)(#$)i.test(u)) return { p 'direct', embed u, thumb '' }; return { p 'other', embed u, thumb '' }; } var PICON = { drive '📁', facebook '📘', terabox '📦', direct '🎞', other '🎬' }; ---------- Ads ---------- function adEl(pos) { var a = S.set.ads {}; if (!a.enabled !a[pos]) return null; var d = D.createElement('div'); d.className = 'ad'; d.innerHTML = 'smallAdvertisementsmalldiv class=indiv'; var inn = $('.in', d); inn.innerHTML = a[pos]; Array.prototype.slice.call(inn.querySelectorAll('script')).forEach(function (o) { var n = D.createElement('script'); Array.prototype.slice.call(o.attributes).forEach(function (at) { n.setAttribute(at.name, at.value); }); n.text = o.text; o.parentNode.replaceChild(n, o); }); return d; } function putAd(id, pos) { var h = $(id); if (!h) return; h.innerHTML = ''; var e = adEl(pos); if (e) h.appendChild(e); } ---------- Modal Helper ---------- function modal(html, big) { var m = D.createElement('div'); m.className = 'mo'; m.innerHTML = 'div class=box' + (big ' big' '') + 'button class=x type=button aria-label=Close✕button' + html + 'div'; m.addEventListener('click', function (e) { if (e.target === m e.target.closest('.x')) m.remove(); }); $('#root').appendChild(m); return m; } ---------- Settings & Cards ---------- function applySettings() { var s = S.set; var br = $('#brand'); br.innerHTML = s.logo 'img src=' + esc(s.logo) + ' alt=' 'i▶i ' + esc(s.siteName 'VIDORA'); if (s.siteName) D.title = s.siteName; if (s.heroTitle) $('#hT').textContent = s.heroTitle; if (s.heroText) $('#hP').textContent = s.heroText; if (s.announce) { var a = $('#ann'); a.textContent = '📢 ' + s.announce; a.style.display = ''; } var links = [ ['Facebook', s.facebook], ['Telegram', s.telegram], ['YouTube', s.youtube], ['WhatsApp', s.whatsapp 'httpswa.me' + String(s.whatsapp).replace(Dg, '') ''] ].filter(function (x) { return x[1]; }); $('#so').innerHTML = links.map(function (x) { return 'a href=' + esc(x[1]) + ' target=_blank rel=noopener' + x[0] + 'a'; }).join(''); $('#fcopy').textContent = '© ' + new Date().getFullYear() + ' ' + (s.siteName 'VIDORA'); putAd('#adtop', 'top'); putAd('#adbot', 'bottom'); } function thumbHtml(v) { var t = v.thumb v.thumbAuto; var h = 'div class=ph' + (PICON[v.platform] '🎬') + 'div'; if (t) return h + 'img loading=lazy referrerpolicy=no-referrer src=' + esc(t) + ' alt= onerror=this.style.display='none''; if (!v.paid && v.platform === 'direct' && v.url) return h + 'video muted playsinline preload=metadata src=' + esc(v.url) + '#t=0.8video'; return h; } function videoCard(v) { return 'a class=vc' + (v.ratio === '916' ' pt' '') + ' href=#v=' + esc(v.id) + '' + 'div class=th' + thumbHtml(v) + 'span class=pl▶span' + (v.paid 'span class=bd p🔒 ' + money(v.price) + 'span' 'span class=bd fFREEspan') + (v.views 'span class=vn👁 ' + v.views + 'span' '') + 'div class=caph3' + esc(v.title) + 'h3divdiva'; } function imageCard(img) { return 'a class=icard href=#i=' + esc(img.id) + '' + 'div class=thdiv class=ph🖼️div' + 'img loading=lazy referrerpolicy=no-referrer src=' + esc(img.url) + ' alt=' + esc(img.title) + '' + (img.category 'span class=bd cat' + esc(img.category) + 'span' '') + 'div class=caph3' + esc(img.title) + 'h3divdiva'; } function newsCard(n) { return 'a class=ncard href=#n=' + esc(n.id) + '' + (n.image 'div class=nthimg loading=lazy referrerpolicy=no-referrer src=' + esc(n.image) + ' alt=span class=bd cat' + esc(n.category 'News') + 'spandiv' '') + 'div class=nbody' + (!n.image 'span class=st pending style=align-selfflex-start' + esc(n.category 'News') + 'span' '') + 'h3' + esc(n.title) + 'h3p' + esc(n.summary n.body '') + 'p' + 'div class=nmetaspan📅 ' + fdate(n.createdAt) + 'spanspanRead More →spandivdiva'; } function renderSection() { var q = ($('#q').value '').trim().toLowerCase(); var g = $('#grid'); Array.prototype.forEach.call(D.querySelectorAll('.sec-btn'), function (b) { b.classList.toggle('active', b.getAttribute('data-sec') === S.section); }); if (S.section === 'videos') { $('#secTitle').textContent = '🎬 All Videos'; g.className = 'grid'; var vList = S.videos.filter(function (v) { return !q String(v.title).toLowerCase().indexOf(q) -1; }); g.innerHTML = vList.length vList.map(videoCard).join('') 'div class=empty😕 No videos founddiv'; } else if (S.section === 'images') { $('#secTitle').textContent = '🖼️ Photo Gallery'; g.className = 'grid'; var iList = S.images.filter(function (x) { return !q String(x.title + ' ' + (x.category '')).toLowerCase().indexOf(q) -1; }); g.innerHTML = iList.length iList.map(imageCard).join('') 'div class=empty🖼️ No photos founddiv'; } else { $('#secTitle').textContent = '📰 Latest News'; g.className = 'news-grid'; var nList = S.news.filter(function (x) { return !q String(x.title + ' ' + (x.summary '') + ' ' + (x.category '')).toLowerCase().indexOf(q) -1; }); g.innerHTML = nList.length nList.map(newsCard).join('') 'div class=empty📰 No news articles founddiv'; } } Array.prototype.forEach.call(D.querySelectorAll('.sec-btn'), function (btn) { btn.onclick = function () { S.section = btn.getAttribute('data-sec'); renderSection(); }; }); $('#q').addEventListener('input', renderSection); function loadAll() { db.doc('settingssite').get().then(function (s) { S.set = s.exists s.data() {}; }).catch(function () { S.set = {}; }).then(function () { applySettings(); if (S.user) checkAdmin(S.user); return Promise.all([ db.collection('videos').orderBy('createdAt', 'desc').limit(300).get(), db.collection('images').orderBy('createdAt', 'desc').limit(300).get().catch(function () { return { forEach function () {} }; }), db.collection('news').orderBy('createdAt', 'desc').limit(200).get().catch(function () { return { forEach function () {} }; }) ]); }).then(function (res) { S.videos = []; S.vById = {}; res[0].forEach(function (d) { var v = d.data(); v.id = d.id; if (!v.hidden) { S.videos.push(v); S.vById[v.id] = v; } }); S.images = []; S.iById = {}; res[1].forEach(function (d) { var img = d.data(); img.id = d.id; if (!img.hidden) { S.images.push(img); S.iById[img.id] = img; } }); S.news = []; S.nById = {}; res[2].forEach(function (d) { var n = d.data(); n.id = d.id; if (!n.hidden) { S.news.push(n); S.nById[n.id] = n; } }); renderSection(); route(); }).catch(function () { $('#grid').innerHTML = 'div class=emptyCould not load contentdiv'; }); } ---------- Auth & Admin Verification ---------- function authModal() { var mode = 'in'; var m = modal( 'h3🔐 Accounth3' + 'div class=tabsbutton class=on data-m=in type=buttonLog Inbuttonbutton data-m=up type=buttonCreate Accountbuttondiv' + 'div id=anm style=displaynonelabelNameinput id=an autocomplete=namelabeldiv' + 'labelEmailinput id=ae type=email autocomplete=emaillabel' + 'labelPasswordinput id=ap type=password autocomplete=current-passwordlabel' + 'button class=btn full id=ago type=buttonLog Inbutton' + 'button class=btn gh full id=agg type=button🌐 Continue with Googlebutton' ); Array.prototype.forEach.call(m.querySelectorAll('.tabs button'), function (b) { b.onclick = function () { mode = b.getAttribute('data-m'); Array.prototype.forEach.call(m.querySelectorAll('.tabs button'), function (x) { x.classList.toggle('on', x === b); }); $('#anm', m).style.display = mode === 'up' '' 'none'; $('#ago', m).textContent = mode === 'up' 'Create Account' 'Log In'; }; }); $('#ago', m).onclick = function () { var e = $('#ae', m).value.trim(), p = $('#ap', m).value; if (!e !p) { toast('Enter email and password'); return; } var pr = mode === 'up' auth.createUserWithEmailAndPassword(e, p).then(function (c) { return c.user.updateProfile({ displayName $('#an', m).value.trim() }); }) auth.signInWithEmailAndPassword(e, p); pr.then(function () { m.remove(); }).catch(function (er) { toast(er.message); }); }; $('#agg', m).onclick = function () { auth.signInWithPopup(new firebase.auth.GoogleAuthProvider()).then(function () { m.remove(); }).catch(function (er) { toast(er.message); }); }; } $('#blog').onclick = authModal; function checkAdmin(u) { if (!u) { S.isAdmin = false; $('#badm').style.display = 'none'; return; } var match = (ADMIN_EMAIL && u.email && u.email.toLowerCase() === ADMIN_EMAIL.toLowerCase()) (S.set.adminEmail && u.email && u.email.toLowerCase() === S.set.adminEmail.toLowerCase()); if (match) { S.isAdmin = true; $('#badm').style.display = ''; return; } db.doc('admins' + u.uid).get().then(function (s) { S.isAdmin = s.exists; $('#badm').style.display = S.isAdmin '' 'none'; }).catch(function () { S.isAdmin = false; $('#badm').style.display = 'none'; }); } function clearSubs() { unsubs.forEach(function (u) { try { u(); } catch (e) {} }); unsubs = []; } auth.onAuthStateChanged(function (u) { clearSubs(); S.user = u; S.prof = null; S.notesMe = []; $('#blog').style.display = u 'none' ''; $('#bwal').style.display = u '' 'none'; checkAdmin(u); if (u) { var ref = db.doc('users' + u.uid); ref.get().then(function (s) { if (!s.exists) return ref.set({ email u.email '', name u.displayName '', balance 0, createdAt FV.serverTimestamp() }); }).catch(function () {}).then(function () { unsubs.push(ref.onSnapshot(function (s) { S.prof = s.exists s.data() { balance 0 }; $('#balv').textContent = money(S.prof.balance); }, function () {})); }); unsubs.push(db.collection('notifications').where('to', '==', u.uid).onSnapshot(function (qs) { S.notesMe = qs.docs.map(function (d) { return d.data(); }); mergeNotes(); }, function () {})); watchChat(); } else { $('#balv').textContent = money(0); mergeNotes(); } if (D.getElementById('pgv')) route(true); }); ---------- FULL ADMIN PANEL ---------- function adminModal() { if (!S.isAdmin) { toast('Admin access required'); return; } var m = modal( 'h3⚙️ VIDORA Admin Panelh3' + 'div class=tabs' + 'button class=on data-at=vid type=button🎬 Videosbutton' + 'button data-at=img type=button🖼️ Photosbutton' + 'button data-at=nws type=button📰 Newsbutton' + 'button data-at=pay type=button💰 Walletbutton' + 'button data-at=cht type=button💬 Chatsbutton' + 'button data-at=set type=button🔧 Settingsbutton' + 'div' + 'div id=abody style=margin-top10pxdiv', true ); function renderAdminTab(tab) { Array.prototype.forEach.call(m.querySelectorAll('.tabs button'), function (b) { b.classList.toggle('on', b.getAttribute('data-at') === tab); }); var ab = $('#abody', m); 1. Videos Manager if (tab === 'vid') { ab.innerHTML = 'div class=lib➕ Add New Videob' + 'div class=adm-row' + 'labelTitleinput id=av_t placeholder=Video titlelabel' + 'labelVideo URL (Drive, FB, Terabox, MP4)input id=av_u placeholder=https...label' + 'div' + 'div class=adm-row' + 'labelThumbnail URL (Optional)input id=av_th placeholder=https...label' + 'labelAspect Ratioselect id=av_roption value=169169 Landscapeoptionoption value=916916 Portraitoptionselectlabel' + 'div' + 'div class=adm-row' + 'labelAccessselect id=av_poption value=0Freeoptionoption value=1Paid (Locked)optionselectlabel' + 'labelPrice (৳)input id=av_pr type=number value=0label' + 'div' + 'labelDescriptiontextarea id=av_d rows=2textarealabel' + 'button class=btn full id=av_add type=buttonPublish Videobuttondiv' + 'div id=av_list style=margin-top14pxLoading...div'; $('#av_add', ab).onclick = function () { var title = $('#av_t', ab).value.trim(); var url = $('#av_u', ab).value.trim(); if (!title !url) { toast('Title and URL required'); return; } var parsed = parseVideo(url); var paid = $('#av_p', ab).value === '1'; var price = parseFloat($('#av_pr', ab).value) 0; var docRef = db.collection('videos').doc(); var batch = db.batch(); batch.set(docRef, { title title, url paid '' url, platform parsed.p, thumb $('#av_th', ab).value.trim(), thumbAuto parsed.thumb '', ratio $('#av_r', ab).value, paid paid, price price, desc $('#av_d', ab).value.trim(), views 0, hidden false, createdAt FV.serverTimestamp() }); if (paid) batch.set(docRef.collection('private').doc('src'), { url url }); batch.commit().then(function () { toast('Video published ✓'); loadAll(); renderAdminTab('vid'); }).catch(function (e) { toast(e.message); }); }; db.collection('videos').orderBy('createdAt', 'desc').limit(50).get().then(function (qs) { var h = 'bExisting Videos (' + qs.size + ')b'; qs.forEach(function (d) { var v = d.data(); h += 'div class=lidiv class=tspanb' + esc(v.title) + 'b ' + (v.paid '(৳' + v.price + ')' '(Free)') + (v.hidden ' [HIDDEN]' '') + 'spandiv' + 'div class=adm-actions' + 'button class=btn gh sm2 type=button data-vh=' + d.id + ' data-cur=' + (v.hidden '1' '0') + '' + (v.hidden 'Unhide' 'Hide') + 'button' + 'button class=btn bad sm2 type=button data-vd=' + d.id + 'Deletebutton' + 'divdiv'; }); $('#av_list', ab).innerHTML = h; Array.prototype.forEach.call(ab.querySelectorAll('[data-vh]'), function (b) { b.onclick = function () { db.doc('videos' + b.getAttribute('data-vh')).update({ hidden b.getAttribute('data-cur') !== '1' }).then(function () { toast('Updated ✓'); loadAll(); renderAdminTab('vid'); }); }; }); Array.prototype.forEach.call(ab.querySelectorAll('[data-vd]'), function (b) { b.onclick = function () { if (!confirm('Delete this video permanently')) return; db.doc('videos' + b.getAttribute('data-vd')).delete().then(function () { toast('Deleted ✓'); loadAll(); renderAdminTab('vid'); }); }; }); }); } 2. Photos Manager else if (tab === 'img') { ab.innerHTML = 'div class=lib➕ Add New Photob' + 'div class=adm-row' + 'labelPhoto Titleinput id=ai_t placeholder=Title or captionlabel' + 'labelCategoryinput id=ai_c placeholder=e.g. Wallpaper, Event, Portraitlabel' + 'div' + 'labelDirect Image URLinput id=ai_u placeholder=https...label' + 'labelDescription (Optional)textarea id=ai_d rows=2textarealabel' + 'button class=btn full id=ai_add type=buttonPublish Photobuttondiv' + 'div id=ai_list style=margin-top14pxLoading...div'; $('#ai_add', ab).onclick = function () { var title = $('#ai_t', ab).value.trim(); var url = $('#ai_u', ab).value.trim(); if (!title !url) { toast('Title and Image URL required'); return; } db.collection('images').add({ title title, category $('#ai_c', ab).value.trim() 'Gallery', url url, desc $('#ai_d', ab).value.trim(), hidden false, createdAt FV.serverTimestamp() }).then(function () { toast('Photo published ✓'); loadAll(); renderAdminTab('img'); }).catch(function (e) { toast(e.message); }); }; db.collection('images').orderBy('createdAt', 'desc').limit(50).get().then(function (qs) { var h = 'bGallery Photos (' + qs.size + ')b'; qs.forEach(function (d) { var x = d.data(); h += 'div class=lidiv class=tspanb' + esc(x.title) + 'b [' + esc(x.category '') + ']spandiv' + 'div class=adm-actionsbutton class=btn bad sm2 type=button data-id=' + d.id + 'Deletebuttondivdiv'; }); $('#ai_list', ab).innerHTML = h; Array.prototype.forEach.call(ab.querySelectorAll('[data-id]'), function (b) { b.onclick = function () { if (!confirm('Delete this photo')) return; db.doc('images' + b.getAttribute('data-id')).delete().then(function () { toast('Deleted ✓'); loadAll(); renderAdminTab('img'); }); }; }); }); } 3. News Manager else if (tab === 'nws') { ab.innerHTML = 'div class=lib➕ Publish News Articleb' + 'div class=adm-row' + 'labelHeadlineinput id=an_t placeholder=News headlinelabel' + 'labelCategoryinput id=an_c placeholder=e.g. Breaking, Tech, Updateslabel' + 'div' + 'labelCover Image URL (Optional)input id=an_i placeholder=https...label' + 'labelShort Summaryinput id=an_s placeholder=Brief summary for the cardlabel' + 'labelFull Article Bodytextarea id=an_b rows=5 placeholder=Write the full article...textarealabel' + 'button class=btn full id=an_add type=buttonPublish Newsbuttondiv' + 'div id=an_list style=margin-top14pxLoading...div'; $('#an_add', ab).onclick = function () { var title = $('#an_t', ab).value.trim(); var body = $('#an_b', ab).value.trim(); if (!title !body) { toast('Headline and body required'); return; } db.collection('news').add({ title title, category $('#an_c', ab).value.trim() 'News', image $('#an_i', ab).value.trim(), summary $('#an_s', ab).value.trim() body.slice(0, 140) + '...', body body, hidden false, createdAt FV.serverTimestamp() }).then(function () { toast('News published ✓'); loadAll(); renderAdminTab('nws'); }).catch(function (e) { toast(e.message); }); }; db.collection('news').orderBy('createdAt', 'desc').limit(50).get().then(function (qs) { var h = 'bPublished Articles (' + qs.size + ')b'; qs.forEach(function (d) { var x = d.data(); h += 'div class=lidiv class=tspanb' + esc(x.title) + 'b (' + fdate(x.createdAt) + ')spandiv' + 'div class=adm-actionsbutton class=btn bad sm2 type=button data-nd=' + d.id + 'Deletebuttondivdiv'; }); $('#an_list', ab).innerHTML = h; Array.prototype.forEach.call(ab.querySelectorAll('[data-nd]'), function (b) { b.onclick = function () { if (!confirm('Delete this article')) return; db.doc('news' + b.getAttribute('data-nd')).delete().then(function () { toast('Deleted ✓'); loadAll(); renderAdminTab('nws'); }); }; }); }); } 4. Deposits & Withdrawals else if (tab === 'pay') { ab.innerHTML = 'p class=mutLoading wallet requests...p'; Promise.all([ db.collection('deposits').where('status', '==', 'pending').get(), db.collection('withdrawals').where('status', '==', 'pending').get() ]).then(function (res) { var h = 'b⬇️ Pending Deposits (' + res[0].size + ')b'; res[0].forEach(function (d) { var x = d.data(); h += 'div class=lidiv class=tspanb' + money(x.amount) + 'b (' + esc(x.method) + ') — TrxID code' + esc(x.trx) + 'codespanspan class=mut sm' + esc(x.email) + 'spandiv' + 'div class=adm-actions' + 'button class=btn ok sm2 type=button data-da=' + d.id + ' data-uid=' + x.uid + ' data-amt=' + x.amount + '✅ Approvebutton' + 'button class=btn bad sm2 type=button data-dr=' + d.id + '❌ Rejectbutton' + 'divdiv'; }); h += 'brb⬆️ Pending Withdrawals (' + res[1].size + ')b'; res[1].forEach(function (d) { var x = d.data(); h += 'div class=lidiv class=tspanb' + money(x.amount) + 'b to ' + esc(x.method) + ' b' + esc(x.number) + 'bspanspan class=mut sm' + esc(x.email) + 'spandiv' + 'div class=adm-actions' + 'button class=btn ok sm2 type=button data-wa=' + d.id + '✅ Mark Paidbutton' + 'button class=btn bad sm2 type=button data-wr=' + d.id + ' data-uid=' + x.uid + ' data-amt=' + x.amount + '❌ Reject & Refundbutton' + 'divdiv'; }); ab.innerHTML = h; Array.prototype.forEach.call(ab.querySelectorAll('[data-da]'), function (b) { b.onclick = function () { var bt = db.batch(); bt.update(db.doc('deposits' + b.getAttribute('data-da')), { status 'approved' }); bt.update(db.doc('users' + b.getAttribute('data-uid')), { balance FV.increment(parseFloat(b.getAttribute('data-amt'))) }); bt.commit().then(function () { toast('Approved ✓'); renderAdminTab('pay'); }); }; }); Array.prototype.forEach.call(ab.querySelectorAll('[data-dr]'), function (b) { b.onclick = function () { db.doc('deposits' + b.getAttribute('data-dr')).update({ status 'rejected' }).then(function () { toast('Rejected'); renderAdminTab('pay'); }); }; }); Array.prototype.forEach.call(ab.querySelectorAll('[data-wa]'), function (b) { b.onclick = function () { db.doc('withdrawals' + b.getAttribute('data-wa')).update({ status 'paid' }).then(function () { toast('Marked Paid ✓'); renderAdminTab('pay'); }); }; }); Array.prototype.forEach.call(ab.querySelectorAll('[data-wr]'), function (b) { b.onclick = function () { var bt = db.batch(); bt.update(db.doc('withdrawals' + b.getAttribute('data-wr')), { status 'rejected' }); bt.update(db.doc('users' + b.getAttribute('data-uid')), { balance FV.increment(parseFloat(b.getAttribute('data-amt'))) }); bt.commit().then(function () { toast('Refunded ✓'); renderAdminTab('pay'); }); }; }); }); } 5. Live Chat Inbox else if (tab === 'cht') { ab.innerHTML = 'p class=mutLoading support chats...p'; db.collection('chats').orderBy('lastAt', 'desc').limit(30).get().then(function (qs) { var h = 'b💬 User Support Threads (' + qs.size + ')b'; qs.forEach(function (d) { var x = d.data(); h += 'div class=lidiv class=tspanb' + esc(x.name x.email d.id) + 'b' + (x.unreadAdmin ' span class=st pendingNEWspan' '') + 'spanspan class=mut sm' + esc(x.last '') + 'spandiv' + 'div style=displayflex;gap6px;margin-top8pxinput id=rep_' + d.id + ' placeholder=Write reply...button class=btn sm2 type=button data-rep=' + d.id + 'Replybuttondivdiv'; }); ab.innerHTML = h; Array.prototype.forEach.call(ab.querySelectorAll('[data-rep]'), function (b) { b.onclick = function () { var uid = b.getAttribute('data-rep'); var inp = $('#rep_' + uid, ab); var txt = inp.value.trim(); if (!txt) return; inp.value = ''; var ref = db.doc('chats' + uid); ref.set({ unreadAdmin false, unreadUser true, last txt, lastAt FV.serverTimestamp() }, { merge true }) .then(function () { return ref.collection('msgs').add({ from 'admin', text txt, at FV.serverTimestamp() }); }) .then(function () { toast('Reply sent ✓'); renderAdminTab('cht'); }); }; }); }); } 6. Site Settings & Broadcast Notification else if (tab === 'set') { var s = S.set {}, P = s.payment {}, V = s.verify {}; ab.innerHTML = 'div class=lib📢 Broadcast Notification to All Usersb' + 'div class=adm-rowlabelTitleinput id=nt_t placeholder=Alert titlelabellabelMessageinput id=nt_b placeholder=Notification bodylabeldiv' + 'button class=btn gh sm2 id=nt_send type=button style=margin-top8pxSend Broadcastbuttondiv' + 'div class=adm-row' + 'labelSite Nameinput id=st_nm value=' + esc(s.siteName 'VIDORA') + 'label' + 'labelAdmin Emailinput id=st_em value=' + esc(s.adminEmail '') + 'label' + 'div' + 'labelHero Titleinput id=st_ht value=' + esc(s.heroTitle '') + 'label' + 'labelAnnouncement Bannerinput id=st_an value=' + esc(s.announce '') + 'label' + 'div class=adm-row' + 'labelbKash Numberinput id=st_bk value=' + esc(P.bkash '') + 'label' + 'labelNagad Numberinput id=st_ng value=' + esc(P.nagad '') + 'label' + 'div' + 'div class=adm-row' + 'labelSponsor Verify URLinput id=st_vu value=' + esc(V.url '') + 'label' + 'labelCountdown Secondsinput id=st_vs type=number value=' + esc(V.seconds 5) + 'label' + 'div' + 'button class=btn full id=st_save type=buttonSave Settingsbutton'; $('#nt_send', ab).onclick = function () { var t = $('#nt_t', ab).value.trim(), b = $('#nt_b', ab).value.trim(); if (!t !b) { toast('Title and message required'); return; } db.collection('notifications').add({ to 'all', title t, body b, at FV.serverTimestamp() }).then(function () { toast('Notification sent ✓'); $('#nt_t', ab).value = ''; $('#nt_b', ab).value = ''; }); }; $('#st_save', ab).onclick = function () { db.doc('settingssite').set({ siteName $('#st_nm', ab).value.trim(), adminEmail $('#st_em', ab).value.trim(), heroTitle $('#st_ht', ab).value.trim(), announce $('#st_an', ab).value.trim(), payment { bkash $('#st_bk', ab).value.trim(), nagad $('#st_ng', ab).value.trim(), minDeposit (P.minDeposit 10), minWithdraw (P.minWithdraw 50) }, verify { enabled !!$('#st_vu', ab).value.trim(), url $('#st_vu', ab).value.trim(), seconds parseInt($('#st_vs', ab).value, 10) 5 } }, { merge true }).then(function () { toast('Settings saved ✓'); loadAll(); }).catch(function (e) { toast(e.message); }); }; } } m.addEventListener('click', function (e) { var t = e.target.closest('.tabs button'); if (t) renderAdminTab(t.getAttribute('data-at')); }); renderAdminTab('vid'); } $('#badm').onclick = adminModal; ---------- Notifications ---------- db.collection('notifications').where('to', '==', 'all').onSnapshot(function (qs) { S.notesAll = qs.docs.map(function (d) { return d.data(); }); mergeNotes(); }, function () {}); function mergeNotes() { S.notes = S.notesAll.concat(S.notesMe).sort(function (a, b) { return (b.at b.at.seconds 0) - (a.at a.at.seconds 0); }); var seen = 0; try { seen = +localStorage.getItem('vn_seen') 0; } catch (e) {} var n = S.notes.filter(function (x) { return x.at && x.at.seconds 1000 seen; }).length; var b = $('#bnote'), d = $('.dot', b); if (d) d.remove(); if (n) b.insertAdjacentHTML('beforeend', 'span class=dot' + n + 'span'); } $('#bnote').onclick = function () { modal('h3🔔 Notificationsh3' + (S.notes.length S.notes.slice(0, 30).map(function (n) { return 'div class=lidiv class=tb' + esc(n.title) + 'bspan class=mut sm' + fdate(n.at) + 'spandivdiv class=mut' + esc(n.body) + 'divdiv'; }).join('') 'p class=mutNo notificationsp')); try { localStorage.setItem('vn_seen', String(Date.now())); } catch (e) {} mergeNotes(); }; ---------- User Wallet ---------- function walletModal(tab) { if (!S.user) { authModal(); return; } var P = S.set.payment {}, minD = +P.minDeposit 10, minW = +P.minWithdraw 50; var m = modal( 'h3💰 My Walleth3div class=balspan class=mut smCurrent Balancespanb id=wb' + money(S.prof && S.prof.balance) + 'bdiv' + 'div class=tabsbutton data-t=dep type=buttonDepositbuttonbutton data-t=wd type=buttonWithdrawbuttonbutton data-t=his type=buttonHistorybuttondiv' + 'div id=wbodydivbutton class=btn gh full id=wout type=buttonLog Outbutton', true ); var live = setInterval(function () { if (!m.isConnected) { clearInterval(live); return; } var e = $('#wb', m); if (e) e.textContent = money(S.prof && S.prof.balance); }, 800); function show(t) { Array.prototype.forEach.call(m.querySelectorAll('.tabs button'), function (b) { b.classList.toggle('on', b.getAttribute('data-t') === t); }); var w = $('#wbody', m); if (t === 'dep') { w.innerHTML = 'p class=mut smSend money to the number below and submit the Transaction ID.p' + (P.bkash 'div class=numbbKashbspan' + esc(P.bkash) + 'spanbutton data-c=' + esc(P.bkash) + ' type=buttonCopybuttondiv' '') + (P.nagad 'div class=numbNagadbspan' + esc(P.nagad) + 'spanbutton data-c=' + esc(P.nagad) + ' type=buttonCopybuttondiv' '') + 'labelPayment Methodselect id=dmoptionbKashoptionoptionNagadoptionselectlabel' + 'labelAmount (min ' + money(minD) + ')input id=da type=number inputmode=decimallabel' + 'labelTransaction IDinput id=dt autocomplete=offlabel' + 'button class=btn full id=dgo type=buttonSubmit Deposit Requestbutton'; $('#dgo', m).onclick = function () { var a = parseFloat($('#da', m).value), tx = $('#dt', m).value.trim(); if (!(a = minD)) { toast('Minimum ' + money(minD)); return; } if (!tx) { toast('Enter Transaction ID'); return; } db.collection('deposits').add({ uid S.user.uid, email S.user.email '', method $('#dm', m).value, trx tx, amount a, status 'pending', at FV.serverTimestamp() }) .then(function () { toast('Deposit submitted ✓'); show('his'); }); }; } else if (t === 'wd') { w.innerHTML = 'labelPayment Methodselect id=wmoptionbKashoptionoptionNagadoptionselectlabel' + 'labelYour Phone Numberinput id=wn inputmode=tel placeholder=01XXXXXXXXXlabel' + 'labelAmount (min ' + money(minW) + ')input id=wa type=number inputmode=decimallabel' + 'button class=btn full id=wgo type=buttonSubmit Withdrawalbutton'; $('#wgo', m).onclick = function () { var a = parseFloat($('#wa', m).value), n = $('#wn', m).value.trim(), bal = (S.prof && S.prof.balance) 0; if (!(a = minW)) { toast('Minimum ' + money(minW)); return; } if (a bal) { toast('Insufficient balance'); return; } if (!^d{11}$.test(n.replace(Dg, ''))) { toast('Enter valid 11-digit number'); return; } var b = db.batch(); b.update(db.doc('users' + S.user.uid), { balance FV.increment(-a) }); b.set(db.collection('withdrawals').doc(), { uid S.user.uid, email S.user.email '', method $('#wm', m).value, number n, amount a, status 'pending', at FV.serverTimestamp() }); b.commit().then(function () { toast('Withdrawal submitted ✓'); show('his'); }); }; } else { w.innerHTML = 'p class=mutLoading...p'; var uid = S.user.uid; Promise.all([ db.collection('deposits').where('uid', '==', uid).get(), db.collection('withdrawals').where('uid', '==', uid).get(), db.collection('purchases').where('uid', '==', uid).get() ]).then(function (r) { var rows = []; r[0].forEach(function (d) { var x = d.data(); rows.push({ at x.at, h '⬇️ Deposit ' + money(x.amount) + ' (' + esc(x.method) + ')', st x.status }); }); r[1].forEach(function (d) { var x = d.data(); rows.push({ at x.at, h '⬆️ Withdraw ' + money(x.amount) + ' (' + esc(x.method) + ')', st x.status }); }); r[2].forEach(function (d) { var x = d.data(); rows.push({ at x.at, h '🎬 ' + esc(x.title 'Video') + ' — ' + money(x.price), st 'bought' }); }); rows.sort(function (a, b) { return (b.at b.at.seconds 0) - (a.at a.at.seconds 0); }); w.innerHTML = rows.length rows.slice(0, 40).map(function (x) { return 'div class=lidiv class=tspan' + x.h + 'spanspan class=st ' + x.st + '' + x.st.toUpperCase() + 'spandivdiv class=mut sm' + fdate(x.at) + 'divdiv'; }).join('') 'p class=mut style=margin-top8pxNo transactions yetp'; }); } } m.addEventListener('click', function (e) { var t = e.target.closest('.tabs button'); if (t) show(t.getAttribute('data-t')); var c = e.target.closest('[data-c]'); if (c) copy(c.getAttribute('data-c')); }); $('#wout', m).onclick = function () { auth.signOut(); m.remove(); }; show(tab 'dep'); } $('#bwal').onclick = function () { walletModal('dep'); }; ---------- Routing & Content Viewers ---------- var gateDone = {}, curRoute = ''; function closeOverlay() { var o = D.getElementById('pgv'); if (o) o.remove(); curRoute = ''; D.body.style.overflow = ''; } function goBack() { if (history.length 1 && ^#(vin)=.test(location.hash)) { history.back(); setTimeout(function () { if (^#(vin)=.test(location.hash)) location.hash = ''; }, 150); } else { location.hash = ''; } } function route(force) { var m = location.hash.match(^#(vin)=([w-]+)); if (!m) { closeOverlay(); return; } var key = m[1] + '' + m[2]; if (!force && curRoute === key && D.getElementById('pgv')) return; curRoute = key; if (m[1] === 'v') openVideo(m[2]); else if (m[1] === 'i') openImage(m[2]); else if (m[1] === 'n') openNews(m[2]); } window.addEventListener('hashchange', function () { route(); }); Photo Lightbox function openImage(id) { var old = D.getElementById('pgv'); if (old) old.remove(); D.body.style.overflow = 'hidden'; var pg = D.createElement('div'); pg.className = 'pg'; pg.id = 'pgv'; pg.innerHTML = 'div class=topbutton class=ib id=pback type=button← Backbuttonb id=pttPhotobdivdiv class=pw id=ibodydiv class=spin style=margin60px autodivdiv'; $('#root').appendChild(pg); $('#pback', pg).onclick = goBack; var p = S.iById[id] Promise.resolve(S.iById[id]) db.doc('images' + id).get().then(function (s) { return s.exists Object.assign({ id s.id }, s.data()) null; }); p.then(function (img) { if (!img img.hidden) { $('#ibody', pg).innerHTML = 'p class=emptyPhoto not foundp'; return; } $('#ptt', pg).textContent = img.title; $('#ibody', pg).innerHTML = 'img class=lb-img referrerpolicy=no-referrer src=' + esc(img.url) + ' alt=' + esc(img.title) + '' + 'h1 class=ptitle' + esc(img.title) + 'h1' + 'div class=metaspan🖼️ ' + esc(img.category 'Gallery') + 'spanspan📅 ' + fdate(img.createdAt) + 'spandiv' + (img.desc 'p class=mut style=margin-top10px;white-spacepre-line' + esc(img.desc) + 'p' '') + 'div class=shra class=btn sm2 target=_blank rel=noopener href=' + esc(img.url) + '⬇️ Open Full Imageabutton class=btn gh sm2 id=icp type=buttonCopy Linkbuttondiv'; $('#icp', pg).onclick = function () { copy(location.origin + location.pathname + '#i=' + img.id); }; }); } News Reader function openNews(id) { var old = D.getElementById('pgv'); if (old) old.remove(); D.body.style.overflow = 'hidden'; var pg = D.createElement('div'); pg.className = 'pg'; pg.id = 'pgv'; pg.innerHTML = 'div class=topbutton class=ib id=pback type=button← Backbuttonb id=pttNewsbdivdiv class=pw id=nbodydiv class=spin style=margin60px autodivdiv'; $('#root').appendChild(pg); $('#pback', pg).onclick = goBack; var p = S.nById[id] Promise.resolve(S.nById[id]) db.doc('news' + id).get().then(function (s) { return s.exists Object.assign({ id s.id }, s.data()) null; }); p.then(function (n) { if (!n n.hidden) { $('#nbody', pg).innerHTML = 'p class=emptyArticle not foundp'; return; } $('#ptt', pg).textContent = n.title; var u = encodeURIComponent(location.origin + location.pathname + '#n=' + n.id); var t = encodeURIComponent(n.title); $('#nbody', pg).innerHTML = (n.image 'img style=width100%;max-height440px;object-fitcover;border-radius18px;border1px solid var(--ln) referrerpolicy=no-referrer src=' + esc(n.image) + ' alt=' '') + 'h1 class=ptitle' + esc(n.title) + 'h1' + 'div class=metaspan📰 ' + esc(n.category 'News') + 'spanspan📅 ' + fdate(n.createdAt) + 'spandiv' + 'div class=art-body' + esc(n.body) + 'div' + 'div class=shrbShareba style=background#1877f2 target=_blank rel=noopener href=httpswww.facebook.comsharersharer.phpu=' + u + 'Facebookaa style=background#25d366 target=_blank rel=noopener href=httpswa.metext=' + t + '%20' + u + 'WhatsAppabutton style=background#2a2a36 id=ncp type=buttonCopy Linkbuttondiv'; $('#ncp', pg).onclick = function () { copy(location.origin + location.pathname + '#n=' + n.id); }; }); } Video Player function openVideo(id) { var old = D.getElementById('pgv'); if (old) old.remove(); D.body.style.overflow = 'hidden'; var pg = D.createElement('div'); pg.className = 'pg'; pg.id = 'pgv'; pg.innerHTML = 'div class=topbutton class=ib id=pback type=button← Backbuttonb id=pttbdivdiv class=pwdiv class=stage id=stgdiv class=ovdiv class=spindivdivdivdiv id=pinfodivdiv'; $('#root').appendChild(pg); $('#pback', pg).onclick = goBack; var vp = S.vById[id] Promise.resolve(S.vById[id]) db.doc('videos' + id).get().then(function (s) { return s.exists Object.assign({ id s.id }, s.data()) null; }); vp.then(function (v) { if (!v v.hidden) { $('#stg', pg).innerHTML = 'div class=ovdiv class=ic😕divpVideo not foundpdiv'; return; } renderPlayer(pg, v); }); } function renderPlayer(pg, v) { var stg = $('#stg', pg); if (v.ratio === '916') stg.className = 'stage pt'; $('#ptt', pg).textContent = v.title; var u = encodeURIComponent(location.origin + location.pathname + '#v=' + v.id); var t = encodeURIComponent(v.title); $('#pinfo', pg).innerHTML = 'h1 class=ptitle' + esc(v.title) + 'h1' + 'div class=metaspan' + (v.paid '🔒 Paid ' + money(v.price) '🆓 Free') + 'spanspan' + (PICON[v.platform] '') + ' ' + esc(v.platform '') + 'span' + (v.views 'span👁 ' + v.views + ' viewsspan' '') + 'div' + (v.desc 'p class=mut style=margin-top10px;white-spacepre-line' + esc(v.desc) + 'p' '') + 'div class=shrbShareba style=background#1877f2 target=_blank rel=noopener href=httpswww.facebook.comsharersharer.phpu=' + u + 'Facebookaa style=background#25d366 target=_blank rel=noopener href=httpswa.metext=' + t + '%20' + u + 'WhatsAppabutton style=background#2a2a36 id=pcp type=buttonCopy Linkbuttondiv'; $('#pcp', pg).onclick = function () { copy(location.origin + location.pathname + '#v=' + v.id); }; var bg = v.thumb v.thumbAuto; function lockedView() { stg.innerHTML = (bg 'img referrerpolicy=no-referrer src=' + esc(bg) + ' alt= style=filterblur(6px) brightness(.5)' '') + 'div class=ovdiv class=ic🔒divb class=serif style=colorvar(--ac);letter-spacing2pxPremium Videobdiv class=cnt' + money(v.price) + 'div' + (S.user 'p class=mut smYour balance ' + money(S.prof && S.prof.balance) + 'pbutton class=btn id=buy type=button🔓 Unlock for ' + money(v.price) + 'buttonbutton class=btn gh id=addm type=button💰 Add Fundsbutton' 'p class=mut smLog in to unlock this videopbutton class=btn id=lg type=buttonLog In Create Accountbutton') + 'div'; var b = $('#buy', stg), l = $('#lg', stg), a = $('#addm', stg); if (l) l.onclick = authModal; if (a) a.onclick = function () { walletModal('dep'); }; if (b) b.onclick = function () { var bal = (S.prof && S.prof.balance) 0; if (bal v.price) { toast('Insufficient balance'); walletModal('dep'); return; } if (!confirm(money(v.price) + ' will be deducted. Continue')) return; b.disabled = true; var bt = db.batch(); bt.update(db.doc('users' + S.user.uid), { balance FV.increment(-v.price) }); bt.set(db.doc('purchases' + S.user.uid + '_' + v.id), { uid S.user.uid, vid v.id, title v.title, price v.price, at FV.serverTimestamp() }); bt.commit().then(function () { toast('Unlocked ✓'); gateView(); }).catch(function () { b.disabled = false; toast('Purchase failed'); }); }; } function gateView() { var V = S.set.verify {}; if (!V.enabled !V.url gateDone[v.id]) { play(); return; } var secs = +V.seconds 5; stg.innerHTML = (bg 'img referrerpolicy=no-referrer src=' + esc(bg) + ' alt= style=filterbrightness(.45)' '') + 'div class=ovdiv class=ic🛡️divb class=serif style=font-size1.15remVerify to Play Videob' + 'p class=mut smClick below to open sponsor link. Video unlocks in ' + secs + ' seconds.pbutton class=btn id=vf type=button✅ Verify Nowbuttondiv'; $('#vf', stg).onclick = function () { try { window.open(V.url, '_blank', 'noopener'); } catch (e) {} var left = secs; stg.innerHTML = (bg 'img referrerpolicy=no-referrer src=' + esc(bg) + ' alt= style=filterbrightness(.4)' '') + 'div class=ovdiv class=cnt id=cd' + left + 'divp class=mutPlease wait...pdiv'; var iv = setInterval(function () { if (!stg.isConnected) { clearInterval(iv); return; } left--; if (left 0) { var c = $('#cd', stg); if (c) c.textContent = left; return; } clearInterval(iv); gateDone[v.id] = 1; stg.innerHTML = (bg 'img referrerpolicy=no-referrer src=' + esc(bg) + ' alt= style=filterbrightness(.5)' '') + 'div class=ovdiv class=ic✅divpVerification completepbutton class=btn id=go type=button▶ Play Videobuttondiv'; $('#go', stg).onclick = play; }, 1000); }; } function play() { stg.innerHTML = 'div class=ovdiv class=spindivdiv'; var up = v.paid db.doc('videos' + v.id + 'privatesrc').get().then(function (s) { return s.exists s.data().url ''; }) Promise.resolve(v.url); up.then(function (url) { if (!url) { stg.innerHTML = 'div class=ovdiv class=ic⚠️divpVideo link not foundpdiv'; return; } var i = parseVideo(url); stg.innerHTML = i.p === 'direct' 'video src=' + esc(i.embed) + ' controls autoplay playsinline controlsList=nodownloadvideo' 'iframe src=' + esc(i.embed) + ' allow=autoplay; fullscreen; picture-in-picture; encrypted-media allowfullscreeniframe'; if (!stg.dataset.v) { stg.dataset.v = '1'; db.doc('videos' + v.id).update({ views FV.increment(1) }).catch(function () {}); } }).catch(function () { lockedView(); }); } if (!v.paid) { gateView(); return; } if (!S.user) { lockedView(); return; } db.doc('purchases' + S.user.uid + '_' + v.id).get().then(function (s) { if (s.exists) gateView(); else lockedView(); }).catch(function () { lockedView(); }); } ---------- Live Chat ---------- var chatUnsub = null, chatBox = null; function watchChat() { if (!S.user) return; unsubs.push(db.doc('chats' + S.user.uid).onSnapshot(function (s) { $('#fdot').style.display = (s.exists && s.data().unreadUser && !S.chatOpen) '' 'none'; }, function () {})); } function openChat() { if (!S.user) { authModal(); return; } if (chatBox) { closeChat(); return; } S.chatOpen = true; $('#fdot').style.display = 'none'; var c = D.createElement('div'); c.className = 'chat'; c.innerHTML = 'div class=hspan💬 Live Supportspanbutton type=button id=cx✕buttondiv' + 'div class=ms id=cmsdiv class=m aHello! How can we help youdivdiv' + 'form id=cfinput id=ci placeholder=Type a message... autocomplete=offbutton type=submitSendbuttonform'; D.body.appendChild(c); chatBox = c; $('#cx', c).onclick = closeChat; var uid = S.user.uid, ref = db.doc('chats' + uid); ref.set({ unreadUser false }, { merge true }).catch(function () {}); chatUnsub = ref.collection('msgs').orderBy('at').onSnapshot(function (qs) { var h = 'div class=m aHello! How can we help youdiv'; qs.forEach(function (d) { var x = d.data(); h += 'div class=m ' + (x.from === 'user' 'u' 'a') + '' + esc(x.text) + 'div'; }); var ms = $('#cms', c); if (!ms) return; ms.innerHTML = h; ms.scrollTop = ms.scrollHeight; }); $('#cf', c).onsubmit = function (e) { e.preventDefault(); var i = $('#ci', c), t = i.value.trim(); if (!t) return; i.value = ''; ref.set({ name S.user.displayName '', email S.user.email '', last t, lastAt FV.serverTimestamp(), unreadAdmin true }, { merge true }) .then(function () { return ref.collection('msgs').add({ from 'user', text t, at FV.serverTimestamp() }); }); }; } function closeChat() { S.chatOpen = false; if (chatUnsub) { chatUnsub(); chatUnsub = null; } if (chatBox) { chatBox.remove(); chatBox = null; } } $('#fab').onclick = openChat; loadAll(); })(); script body html