diff --git a/chatbot.js b/chatbot.js index 41a6e1e..2869fd3 100644 --- a/chatbot.js +++ b/chatbot.js @@ -22,6 +22,8 @@ function enabled() { return !!key(); } // ---- canned answers: instant, free, always in voice ---- const KNOWLEDGE_DATE = '2026-10-02'; // bump whenever the canned answers / prompt are brought up to date const CANNED = [ + { re: /(spooky ?doors?|trick.or.treat|hallowe.?en|costume|candy ladder|\bcandy\b|\bknock)/i, + a: 'Spooky Doors (https://spookydoors.com) is the network\u2019s Halloween game. It opens on Oct 17 and closes at midnight Central at the end of Halloween night (Oct 31), and it shows in Members > Games only during the season; one tap signs you in with your InstantAdPay account. Walk the street, grab loose candy, hop the black cats and bats, and knock on doors. Every door is a short verified visit to a member\u2019s page or ad (a member video once you have visited them all), up to 15 doors a day, separate from your Earn visits and Drip Runner refuels. Most doors give a treat of 10 candy; about one door in five plays a trick, and beating it with quick taps adds a small bonus. Candy climbs a ladder that pays POL once per rung (100 candy 0.1 POL, 250 candy 0.25, 500 candy 0.5, 1,000 candy 1, 2,000 candy 2), from a season pool funded by a share of door ad spend and costume sales, so rungs pay only while the pool covers them. POL goes to the wallet on your InstantAdPay account once your game balance reaches 0.25 POL. The witch costume is free; the vampire (300 credits), bedsheet ghost (300) and Lucky caramel apple (500) are bought with your ad credits in the game\u2019s costume shop. Nothing here is a promise of income.' }, { re: /(drip ?runner|games? (tab|page|hub)|play (a |the )?game|games? (that )?pay|refuel)/i, a: 'Members > Games lists the network\u2019s games; one tap signs you in. Drip Runner is a runner game: tap to hop, collect gold drips, dodge the bots, clear chapters. The first clear of each chapter drips a little POL into your game balance, which is sent to your wallet once it reaches the payout line shown in the game. When a run ends you can refuel instead of restarting: a short verified visit to a member\u2019s page (or a member video when you have visited them all), up to 20 refuels a day, separate from your regular Earn visits. Refuels are paid for by advertisers, and a share of that funds the POL pool every drip is paid from, so drips depend on the pool and are small. Share your link from the game lobby: when people on your team refuel, a share of what their refuels add to the pool goes to your game balance. Nothing here is a promise of income. PolHunter and Gem Kingdom are on the same Games page; Gem Kingdom is a match-3 that pays POL for first clears of stages and bosses (its Crowns are bought with ad credits).' }, { re: /(gem ?kingdom|crowns?\b|match.?3|goblin king|ice queen|bog witch|ember dragon|stronghold)/i, @@ -169,6 +171,7 @@ FACTS: - Onsite SOLO ADS are live: a solo ad is a full message (subject + up to 2000 characters of formatted text + your link) delivered into members' on-site Inbox (Members > Inbox). The composer in Campaigns > Solo ad has a rich-text editor (bold, headings, lists, links), lets you ATTACH one image (PNG/JPG/WebP/GIF, up to 3MB) or one video (MP4/WebM, up to 25MB), and adds a call-to-action button with a custom label that opens the target URL. Cost 5 credits per guaranteed delivery, minimum 10 deliveries (50 credits). Each member receives a given solo at most once, and never the sender's own. Readers earn 2 credits per real read (10-second dwell on the open message, up to 5 rewarded reads/day) — claimed right from the message. Compose one in Campaigns > Solo ad. - Campaign target URLs are checked the moment they are submitted: the page must be reachable and must ALLOW framing (no X-Frame-Options deny/sameorigin, no blocking CSP frame-ancestors), because surf views show the real site full screen. Frame-blocking or dead URLs are rejected with the exact reason; the fix is a landing page that allows framing. Login-ad targets skip the frame check (they are click-through only). - SPONSOR CHAT (Members): a two-way, one-to-one chat. A member can start a conversation with their DIRECT sponsor; a sponsor can message anyone in their downline. Presence-aware — when both are online it is live, otherwise a message waits in the recipient's on-site inbox and sends an email. Each member has an availability toggle in Profile (default on; turning it off stops live chats but people can still leave a note) and can mute a specific person. This is separate from the once-a-day sponsor BROADCAST to the whole downline. +- SPOOKY DOORS (Halloween season game, 2026-10-02): https://spookydoors.com, open 2026-10-17 through Halloween night (closes at midnight Central at the end of Oct 31); its Games tab card shows only during the season, with a "Limited time, ends Oct 31" ribbon. Members sign in with one tap from Members > Games. Walk the street, collect candy, avoid black cats and bats, knock on doors. Each door is a verified visit to a member's page or ad (a member video once every page has been visited), the advertiser is charged as for any visit, the player gets candy not credits; 15 doors per Central day, separate from the 20 Earn-tab visits and the 20 Drip Runner refuels. A treat is 10 candy; about 1 door in 5 is a trick (a ghost or skeleton you tap 5 times quickly; beat it for a 3 candy bonus, miss it for half the treat). If no ad is available the house is dark ("Nobody's home"): no candy and the door does not count. CANDY LADDER pays POL once per rung: 100 candy 0.1 POL, 250 0.25, 500 0.5, 1,000 1, 2,000 2 (Halloween 2026 badge at 500), paid from a season pool funded by a share of door ad spend and costume sales, only while the pool covers it; the game balance is sent to the member's InstantAdPay wallet on Polygon at 0.25 POL. COSTUMES bought with ad credits like Gem Kingdom Crowns: witch free, vampire 300 credits (longer trick timer), bedsheet ghost 300 (black cats ignore you), Lucky caramel apple 500 (+2 candy per treat); no cash value. Top 20 by candy on the season leaderboard. Never promise earnings or call it income. - GEM KINGDOM (LIVE in the Games tab since 2026-10-02): Gem Kingdom (https://gemkingdom.app) is a free fantasy match-3: match gems so three heroes battle monsters across six chapters (Goblin Woods, the Frozen Pass, the Haunted Swamp, Dragon's Peak, the Sunken Reef, the Shadow Citadel), earn stars, and rebuild your Stronghold and forge weapons. It pays POL for FIRST clears only (stages 0.02 to 0.15 POL rising by chapter; bosses 0.25, 0.5, 2, 5, 7.5 and 10 POL for the Goblin King, Ice Queen, Bog Witch, Ember Dragon, Kraken and Shadow King); replays pay nothing. The game balance is sent to the member's InstantAdPay wallet on Polygon at 0.25 POL. Rewards come from a pool funded by a share of Crown purchases and pay only while the pool has funds; never promise earnings or call it income. No referral bonus on game clears. Crowns, its upgrade currency, are bought with your InstantAdPay ad credits: tap Buy in the game's Crown Shop, confirm on InstantAdPay (top up with a pack if you are short), and you land back in the game with the Crowns added. Crowns buy buildings, weapons, battle boosts and a revive after a defeat. Sign in with your InstantAdPay account to save progress, earn badges and appear in the Game Achievements posts in the Crypto Team Build group. Never promise an amount beyond the posted rewards. - GAMES TAB (2026-10-01): Members > Games (/my#games) shows one card per network game (PolHunter, Drip Runner and Gem Kingdom pay POL to the member's InstantAdPay wallet), with their own progress and a Play button that signs them in with one tap; new games appear there as they launch (PolHunter is one card). DRIP RUNNER (https://driprunner.app, LIVE for every member since 2026-10-01): tap-to-hop runner; gold drips, magenta bots, orange firewalls from chapter 2; each chapter has a drip goal for one run; the FIRST clear of a chapter pays a small POL drip (amount set by the admin, shown in the game) into the game balance, replays pay nothing; the balance is sent on Polygon to the member's InstantAdPay wallet once it reaches the payout line shown in the game. REFUELS: a run that ends can be refuelled with a verified visit to a member's page (a member video once every page has been visited), up to 20 a day, separate from the 20 Earn-tab visits; the advertiser is charged as for any visit, the player gets fuel not credits. The POL pool is funded ONLY by a share of refuel ad spend plus POL spent in the hangar, so drips depend on refuels and can be zero when the pool is empty; say so honestly. HANGAR: Drip Magnet and Courier Mk II cost drips (game currency); Shield Core and Slow Field cost POL from the game balance, which returns to the pool. GUESTS can try a run without signing in; their clears pay once they sign in. REFERRALS: each player's share link /r/; when members whose InstantAdPay sponsor is that player refuel, a share (10 percent by default) of each refuel's pool income goes to the sponsor's game balance. Telegram posts achievement badges (chapters, unlocks, refuel milestones, payouts). Never promise amounts or income. - Every purchase is split by an immutable smart contract in the same transaction: 50% direct sponsor, 20% level 2, 10% level 3, 20% platform. No withdrawals exist; money lands in members' own wallets instantly. diff --git a/public/assets/door-open.jpg b/public/assets/door-open.jpg new file mode 100644 index 0000000..3b70a24 Binary files /dev/null and b/public/assets/door-open.jpg differ diff --git a/public/assets/door.js b/public/assets/door.js new file mode 100644 index 0000000..4eae853 --- /dev/null +++ b/public/assets/door.js @@ -0,0 +1,73 @@ +/* Spooky Doors door: one verified visit (a member's page or ad), then back to the street with a signed receipt. */ +(function () { + 'use strict'; + var $ = function (id) { return document.getElementById(id); }; + var q = new URLSearchParams(location.search); var tok = q.get('t') || ''; + var nonce = '', tokRet = ''; try { var claims = JSON.parse(atob(tok.split('.')[0].replace(/-/g, '+').replace(/_/g, '/'))); nonce = claims.nonce || ''; tokRet = claims.ret || ''; } catch (e) {} + // every dead end on this page keeps a way back to the street + var gameHome = tokRet ? tokRet.split('?')[0] : 'https://spookydoors.com/play'; + var dwell = 8, left = 8, timer = null; + function esc(s) { return String(s == null ? '' : s).replace(/[&<>"']/g, function (c) { return { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]; }); } + function msg(title, text, backUrl, auto) { + $('sdFrame').innerHTML = '

' + esc(title) + '

' + esc(text) + '

'; + $('sdDone').hidden = true; $('sdCheck').hidden = true; $('sdRow').hidden = true; + var b = $('sdBack'); b.hidden = false; var to = backUrl || gameHome; b.textContent = 'Back to the street'; b.onclick = function () { location.href = to; }; + if (auto && backUrl) setTimeout(function () { location.href = backUrl; }, 2500); + } + function api(p, body) { return fetch(p, body ? { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) } : {}).then(function (r) { return r.json(); }); } + function ring() { $('sdN').textContent = left; $('sdRing').style.setProperty('--p', ((dwell - left) / dwell * 100) + '%'); } + function tick() { + if (document.hidden) return; // the timer only runs while the page is in front + var vid = document.getElementById('sdVideo'); if (vid && (vid.paused || vid.ended && left > 1)) return; // a video must actually be playing + left--; if (left > 0) return ring(); + clearInterval(timer); ring(); $('sdHint').textContent = 'One quick check to count the visit:'; + challenge(); + } + function challenge() { + api('/api/door/challenge?n=' + encodeURIComponent(nonce)).then(function (c) { + if (c.early) { setTimeout(challenge, (c.wait || 1) * 1000 + 300); return; } + if (c.error) { $('sdHint').textContent = c.error; return; } + $('sdPrompt').textContent = 'Tap the ' + c.prompt + ':'; var w = $('sdOpts'); w.innerHTML = ''; + c.options.forEach(function (em, i) { var b = document.createElement('button'); b.type = 'button'; b.textContent = em; b.setAttribute('aria-label', 'Option ' + (i + 1)); b.addEventListener('click', function () { answer(i); }); w.appendChild(b); }); + $('sdCheck').hidden = false; + }); + } + function answer(i) { + api('/api/door/done', { n: nonce, answer: i }).then(function (r) { + if (r.error) { + if (r.retry) return challenge(); + if (r.cap && r.ret) return msg('That is tonight’s doors', 'You have knocked on every door for today. Your candy is safe, and the doors open again at midnight Central.', r.ret, true); + $('sdHint').textContent = r.error; $('sdCheck').hidden = true; var bb = $('sdBack'); bb.hidden = false; bb.onclick = function () { location.href = gameHome; }; return; + } + $('sdCheck').hidden = true; $('sdHint').textContent = r.host ? 'Visit counted. @' + r.host + ' has a treat for you.' : 'Visit counted. Someone has a treat for you.'; + var b = $('sdDone'); b.disabled = false; b.textContent = 'Back to the street'; b.onclick = function () { location.href = r.ret; }; + setTimeout(function () { location.href = r.ret; }, 1200); + }); + } + if (!tok) return msg('No door here', 'Open this page by knocking on a door in Spooky Doors.'); + api('/api/door/open?t=' + encodeURIComponent(tok)).then(function (r) { + if (r.error) return msg('Door link problem', r.error); + if (r.done) { location.href = r.ret; return; } + if (r.none) return r.why === 'cap' + ? msg('That is tonight’s doors', 'You have knocked on every door for today. Your candy is safe, and the doors open again at midnight Central. Your regular InstantAdPay visits are not affected.', r.ret, true) + : msg('Nobody’s home', 'The lights are out at this house: there are no member pages or videos left for you right now. No candy here, and this door does not count. Head back and try the next house.', r.ret, true); + dwell = r.dwell || 8; left = Math.max(1, dwell - (r.elapsed || 0)); + if (r.doors && r.doors.cap) { var ch = $('sdDoors'); ch.textContent = 'Door ' + Math.min(r.doors.cap, (r.doors.used || 0) + 1) + ' of ' + r.doors.cap; ch.hidden = false; } + var who = r.host ? '@' + r.host + '’s door' : 'A member’s door'; + if (r.mode === 'video') { // no member pages left: a member video ad instead + $('sdTitle').textContent = who + ': ' + (r.title || 'member video'); $('sdUrl').textContent = 'video ad'; + $('sdHint').textContent = 'You have visited every member page running right now, so this door is a short member video. Keep it playing.'; + var v = document.createElement('video'); v.id = 'sdVideo'; v.src = r.video.url; v.autoplay = true; v.muted = true; v.playsInline = true; v.setAttribute('playsinline', ''); v.loop = true; v.controls = false; + v.style.cssText = 'position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#000'; + $('sdFrame').innerHTML = ''; $('sdFrame').appendChild(v); + var un = document.createElement('button'); un.type = 'button'; un.textContent = 'Tap for sound'; un.style.cssText = 'position:absolute;right:10px;bottom:10px;z-index:2;padding:8px 12px;border-radius:8px;border:0;background:rgba(0,0,0,.6);color:#fff;font:600 12px system-ui'; + un.onclick = function () { v.muted = false; v.play().catch(function () {}); un.remove(); }; $('sdFrame').appendChild(un); + v.play().catch(function () { $('sdHint').textContent = 'Tap the video to start it. The timer runs while it plays.'; v.onclick = function () { v.play(); }; }); + ring(); timer = setInterval(tick, 1000); return; + } + $('sdTitle').textContent = who + ': ' + (r.title || 'member site'); try { $('sdUrl').textContent = new URL(r.target).hostname; } catch (e) {} + var f = document.createElement('iframe'); f.src = r.target; f.setAttribute('referrerpolicy', 'no-referrer'); f.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-forms allow-popups'); $('sdFrame').innerHTML = ''; $('sdFrame').appendChild(f); + var o = $('sdOpen'); o.href = r.target; o.hidden = false; + ring(); timer = setInterval(tick, 1000); + }).catch(function () { msg('Could not open the door', 'Check your connection and go back to the street.'); }); +})(); diff --git a/public/assets/my.js b/public/assets/my.js index 9d6aff7..aa29cb4 100644 --- a/public/assets/my.js +++ b/public/assets/my.js @@ -825,6 +825,9 @@ if (me.returnTo === 'driprunner' && !render.toGame) { render.toGame = true; location.href = '/api/my/driprunner'; return; } if (me.returnTo === 'gemkingdom' && !render.toGame) { render.toGame = true; location.href = '/api/my/gemkingdom'; return; } // Gem Kingdom sent them here to sign in (2026-10-01) if (me.returnTo === 'gkshop' && !render.toGame) { render.toGame = true; location.href = '/gk/shop/resume'; return; } + if (me.returnTo === 'spookydoors' && !render.toGame) { render.toGame = true; location.href = '/api/my/spookydoors'; return; } // Spooky Doors sent them here to sign in (2026-10-02) + if (me.returnTo === 'sdshop' && !render.toGame) { render.toGame = true; location.href = '/sd/shop/resume'; return; } + if (me.sdShop && !document.getElementById('sdBack')) { const d = document.createElement('a'); d.id = 'sdBack'; d.href = '/sd/shop/resume'; d.textContent = 'Finish your Spooky Doors costume order \u2192'; d.setAttribute('style', 'position:fixed;left:12px;right:12px;bottom:' + (me.gkShop ? '74px' : '14px') + ';z-index:9999;display:block;padding:14px 16px;border-radius:14px;background:#FF8A1F;color:#2a1200;font-weight:800;text-align:center;text-decoration:none;box-shadow:0 5px 0 #C25A06,0 10px 30px rgba(0,0,0,.45)'); document.body.appendChild(d); } if (me.gkShop && !document.getElementById('gkBack')) { const d = document.createElement('a'); d.id = 'gkBack'; d.href = '/gk/shop/resume'; d.textContent = 'Finish your Gem Kingdom Crowns order \u2192'; d.setAttribute('style', 'position:fixed;left:12px;right:12px;bottom:14px;z-index:9999;display:block;padding:14px 16px;border-radius:14px;background:linear-gradient(180deg,#E8455A,#A8172B);color:#fff;font-weight:800;text-align:center;text-decoration:none;box-shadow:0 10px 30px rgba(0,0,0,.45)'); document.body.appendChild(d); } if (me.returnTo === 'passivedrip' && !render.toGame) { render.toGame = true; location.href = '/api/my/passivedrip'; return; } // PassiveDrip sent them here to sign in (2026-10-01) // arrived from an invite page: run the welcome tour and login ad once @@ -1654,7 +1657,8 @@ let g = null; try { g = await (await fetch('/api/my/games')).json(); } catch (e) {} const list = (g && g.games) || []; if (!list.length) { el.innerHTML = '

No games are open yet. Check back soon.

'; return; } - el.innerHTML = list.map(x => '
' + esc(x.tag || '') + '

' + esc(x.name) + (x.preview ? 'preview, not live' : '') + '

' + esc(x.blurb) + '

' + (x.progress && x.progress.line ? '
' + esc(x.progress.line) + '
' : '') + '

Pays: ' + esc(x.pays || 'POL') + '

' + esc(x.cta || 'Play') + '
').join(''); + // a seasonal card (x.season, 2026-10-02) wears the pink limited-time ribbon from the Spooky Doors UI kit + el.innerHTML = list.map(x => '
' + (x.season && x.season.ends ? 'Limited time \u00b7 ends ' + esc(x.season.ends) + '' : '') + '
' + esc(x.tag || '') + '

' + esc(x.name) + (x.preview ? '' + esc(x.previewNote || 'preview, not live') + '' : '') + '

' + esc(x.blurb) + '

' + (x.progress && x.progress.line ? '
' + esc(x.progress.line) + '
' : '') + '

Pays: ' + esc(x.pays || 'POL') + '

' + esc(x.cta || 'Play') + '
').join(''); } async function loadReturnCard() { const card = $('phReturn'); if (!card) return; diff --git a/public/door.html b/public/door.html new file mode 100644 index 0000000..08cefe9 --- /dev/null +++ b/public/door.html @@ -0,0 +1,49 @@ + + + + + + +Knock knock · Spooky Doors verified visit + + + + +
InstantAdPay · verified visit · Spooky Doors
+

Knock knock

Opening the door...

+
+
…

Someone is coming to the door…

Stay on this page. The timer only runs while it is in front.

+ + + +
+ + + diff --git a/public/my.html b/public/my.html index e6dec60..f99ce55 100644 --- a/public/my.html +++ b/public/my.html @@ -1029,7 +1029,12 @@ .game-card .gc-prog{font-size:12px;padding:6px 8px;border-radius:8px;background:var(--mint-soft);color:var(--mint-hi)} .game-card h4{color:var(--ink);font-family:var(--disp)}.game-card .gc-tag{color:var(--mint)} .game-card .gc-pre{display:inline-block;font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;padding:2px 6px;border-radius:5px;background:#fde68a;color:#7c2d12;margin-left:6px} -.game-card .btn{margin-top:auto;text-align:center} +.game-card .btn{margin-top:auto;text-align:center} +.game-card{position:relative} +.game-card .gc-ribbon{position:absolute;top:10px;left:10px;display:inline-flex;align-items:center;gap:6px;background:#FF5FA2;color:#2b0418;font-weight:700;font-size:11px;letter-spacing:.1em;text-transform:uppercase;padding:5px 10px;border-radius:6px;box-shadow:0 3px 0 #9c2a5d} +.game-card .gc-ribbon i{width:7px;height:7px;border-radius:50%;background:#2b0418;display:inline-block;animation:gcPulse 1.4s ease-in-out infinite} +@keyframes gcPulse{50%{opacity:.25}} +@media (prefers-reduced-motion:reduce){.game-card .gc-ribbon i{animation:none}}