Commit Graph

18 Commits

Author SHA1 Message Date
martbost 1aec9caf6c Theme switch: auto | light | dark, stored in localStorage iap.theme and on the account, applied before first paint on every page
themehead.js is the one source of the tiny inline head script (and of AUTO_DEFAULT, the one constant Marty decides later: 0 = nothing stored keeps the page's current look, dark everywhere on InstantAdPay; 1 = follow the device). It mirrors LinkSpin's themehead.js with only the storage key (iap.theme), the global (window.IAPTheme) and the event name (iap-theme) changed. The script sets data-theme on <html> from iap.theme (auto follows prefers-color-scheme and tracks changes live). tools/stamp-theme-head.cjs writes it into all 28 static site.css pages before the first stylesheet with data-theme-base="dark" on <html>; the blog, the leaderboard, what's-new, the badge page, the unsubscribe page and the wall 404 read the module directly. The site CSP allows inline scripts by hash only, so themehead.CSP_HASH joins script-src (without it the script is silently blocked).

Account side: accounts.theme (JSON store and MySQL, alterSafe theme VARCHAR(8)), in the public account JSON and /api/me; POST /api/my/profile {theme} rides the existing profile save path, never touches the username, and does not tap changed() (appearance is not mirrored to LinkSpin, same as LinkSpin's side). common.js owns the client side for every page: paints every .theme-seg, saves a click to the account, and IAP.themeSync lets the account value win over the local one at sign-in (a local choice is pushed up when the account has none yet); my.js calls it from render(). The Light / Dark / Auto segmented control sits in the member-area header (#boTheme) and in a Profile pane "Appearance" card, and in the admin header for the same session. shorts.html pins the dark ink set on its black video stage; view.html stops reading an undefined --bg. ?v= tags bumped on every changed stylesheet and script (20261101th): site.css on all 28 pages, common.js on 25, welcome.js on 17, support.js, my.js, engine-room.js, admin.js, admin-kits.js, blog-page.js.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-01 11:55:06 -06:00
martbost ebdab6c545 Restore each file's original line endings (the override commit rewrote CRLF/LF)
No content change: server.js back to CRLF, my.js/admin.js/html back to LF, so the override
commit's real diff is ~800 lines, not 13,000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 15:16:08 -05:00
martbost 43e841721a Level 4 override payer, shipped OFF (Marty approved 2026-10-23)
override.js: the weekly payer for the 3% level-4 override. It pays only when overrideMode is 'live' AND
overrideGoLive is set AND OVERRIDE_PAYER_KEY (or _FILE) is present; otherwise the Monday dry-run report
runs as before. Default stays 'dryrun'. Nothing in this commit moves money.

- Week = Monday 00:00 to Monday 00:00 Central; settled from 9 AM CT the Monday after, weeks in order.
- Plan frozen once per week (claim plan:<week>), one row per recipient (POL wei summed), on the volume.
- Claims fail closed: exclusive file create on the shared volume plus event_marks when MySQL is on.
- Row marked 'sending' before the tx, tx hash stored on acceptance; lost answers become 'review' and are
  never re-sent (settled from the chain index or by the admin). Pre-flight revert = carried, no gas.
- Dust under overrideDustPol (0.01) carried to next week; overridePayCapPol (100) holds the whole week;
  wallet must cover total + gas or nothing is sent; Telegram alerts once each.
- Telegram summary to Marty's private chat says PAID with tx links.
- Members: AwardPaid from the payer emails + on-site notice "Your Level 4 override is paid" and shows in
  Earnings as "Level 4 override" (common.js / my.js tags bumped to 20261023ov).
- Admin: /api/admin/override adds week status + payer state; POST /api/admin/override/pay (only when live)
  and /api/admin/override/resolve; P&L pane card with "Pay this week now" shown only when live.
- Comp plan (earning.html) + Platform Facts card hidden behind data-when="override-live" (shown only when
  overrideMode is live). Chatbot copy drafted in D:/tmp/override-copy, TODO in chatbot.js.
- qa/override.test.cjs (bash qa/run.sh override): 30 checks on a fake chain/signer/DB, throwaway data.

Reconciliation 2026-10-23: the dry run reads every Purchase in chain-index (229 events, full history);
per Central week it matches the index exactly. The ~$1,775 figure was the rolling 7 days 09-10..09-17.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 15:14:58 -05:00
martbost e2d15aa751 Support in the top nav of every public page, and the chat bubble's greeting points to support; cache tags bumped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 17:20:31 -05:00
martbost 9be58bd5ef Help desk: support tickets for members (Help pane), the public /support page with private ticket links, chatbot hand-off, and an admin Support pane
- tickets.js: one shared desk (platform iap now, linkspin later), dual-mode store (MySQL tables tickets + ticket_messages, else support.json); refs IAP-<1000+id> / LS-; private no-login link /support/t/<ref>.<HMAC> signed with DATA_DIR/support.key (or SUPPORT_SECRET); ingestEmail() ready for the support@ intake step (threads by Message-ID, then [ref] in the subject from the same sender)
- Member Help pane (/my#help): list with status + unread badge, new ticket (category, subject, message, up to 2 screenshots via /api/my/upload), thread + reply (a reply reopens a closed ticket)
- Public /support: name, email, category, subject, message behind the sign-up walls (honeypot, form age, per-IP limits with the icon check, global cap) plus a per-email cap; confirmation email with the ref and the private link
- Chatbot: CANNED + systemPrompt know the help desk; answers that cannot help (or "talk to a human") offer "Send this to support", which files the last turns as a ticket (members: Help pane; signed out: email + the same guard)
- Admin Support pane: open / waiting / closed / all, platform, category, search; open-count badge; ticket view with requester account info, internal notes, status/priority/category, saved replies (site setting supportTemplates); deep link /admin#support?t=<ref>
- Notifications: new ticket / member reply -> Telegram to Marty's private chat only (supportTelegramChat, default 1289244227, site bot then Hermes fallback, never a group or the Discord relay) + email to ADMIN_EMAIL, max one per ticket per 10 min; Marty's reply -> email "[IAP-1042] subject" + a 'notice' inbox message for members, bursts batched
- support* settings are kept out of /api/config; Support link in the site footer, home footer, member page foot, terms and privacy; "Contact support" errors point at /support
- QA walk: member Help ticket flow, admin Support pane + deep link, internal-note leak check, public /support + private link + tampered token + form-age refusal
- Cache tags: common.js 20261016a, chat.js 20261016a, my.js 20261016r, admin.js 20261016sp, support.js 20261016a

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 16:51:30 -05:00
martbost 7aec7d5169 Presentation page + Build Wide 'wide' join angle
- /presentation: the narrated InstantAdPay presentation (video on Spaces
  training/iap-presentation.mp4, poster .jpg), caption pills for
  en/it/fr/es/de/pt (VTTs served from /captions, text/vtt MIME added),
  sponsor card from /api/sponsor ("Shared with you by @name" + Join to
  /join/<ref>?v=wide, or the plain join link). Works framed: join and
  sign-in open a new tab, internal links carry ?ref.
- Site menu + footer: Presentation. Sitemap, Traffic pages and the viral
  page list include it. Promo tools: "Share the presentation" strip copies
  instantadpay.com/presentation?ref=<username>.
- 'wide' join angle (Width unlocks depth.): server JOIN_ANGLES with the
  buildwide poster as og:image, join.js angle (portrait video on phones,
  16:9 otherwise, files promo/buildwide*), link stats row, promo VIDEOS
  first entry with a per-entry file override, front-door list entry.
- Chatbot: presentation canned answer + facts, ?v=wide in the angle lists,
  KNOWLEDGE_DATE 2026-10-15.
- common.js/my.js/promo.js/join.js cache tags bumped; qa/walk.mjs PUBLIC
  gains /presentation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:51:04 -05:00
martbost 5c31f4540c Sign-in guard: measure form age on the visitor's own clock (fage) so a device with a fast clock is not refused forever
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 04:26:58 -05:00
martbost 98c24c2e6b Platform facts page (/facts) and /llms.txt: verified contract split, credits, refunds, anti-fraud and games; footer link on every page; sitemap entry
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 15:25:26 -05:00
martbost 8251c0e693 Broadcasts: a pop-up when sent (how many members) and when not sent (why); an expired sign-in keeps the draft and offers Sign in again (Brian 2026-10-05)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 11:57:06 -05:00
martbost ba5cdfdf4b Network labeling: InstantAdPay is the Polygon hub of the Crypto Team Build Network (footers, dashboard footer, Games tab)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 09:48:25 -05:00
martbost 3f758cdd38 Framed pages: the new tab's sign-in link carries the page's sponsor (?ref, /join/<tok>, /wall/<tok>)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 19:39:18 -05:00
martbost 563ece9896 Traffic exchanges: inside another site's frame, sign-in/join and off-site links open in a new tab (sign-in cookies are refused in frames)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 19:23:04 -05:00
martbost a7a15615ec Sponsor survives a lost cookie: join page sends its own token with the code request, server remembers it per email for 30 days, framed visitors offered a full window
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-29 09:48:06 -05:00
martbost 37a78de339 Wired Wednesday: page, kit, chatbot and banners say $20 and up
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-29 08:10:48 -05:00
martbost 43463366ec Wired Wednesday floor is $20 (Activation pack and up): there is no $10 package
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-29 08:07:21 -05:00
martbost a765b97421 Bridge pages: banner keeps its aspect ratio on phones (height:auto)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-29 05:46:58 -05:00
martbost 8a6029cd90 Wired Wednesday: bonus is wired into the balance (purchased-grade, any format), no forced visits campaign; all copy corrected
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-29 05:42:08 -05:00
martbost 04fd4db9ca Wired Wednesday: +25% on $10+ packs wired into a verified-visits campaign; /wednesday bridge page, banners, kit, cards, chatbot (notice + kickoff off until approved)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-29 04:49:34 -05:00