Weekly member email as sectioned HTML (plain-text twin kept); PassiveDrip one-tap hand-off (inert until PD_SSO_SECRET)

- coach.js: weeklyDigest() builds one card per topic (credits, streak, contest, tank, team) with the key number up front and one button; mailer.send takes optional html
- server.js: /api/my/passivedrip mints a signed hand-off (memberId, email, username, verified wallet, sponsor email); Games card for PassiveDrip (admin preview until gamesLive includes passivedrip) with the member's own coins line via the bridge 'member' lookup; sign-in return path
- my.js: card button label, return redirect; v=20261001b

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-01 08:43:22 -05:00
parent dd53d132d6
commit 5a522f0ede
7 changed files with 160 additions and 51 deletions
+2 -1
View File
@@ -823,6 +823,7 @@
}
// came from a Drip Runner share link: once they have a username, straight back into the game (2026-09-30)
if (me.returnTo === 'driprunner' && !render.toGame) { render.toGame = true; location.href = '/api/my/driprunner'; return; }
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
if (/[?&]welcome=1/.test(location.search) && !render.welcomed) {
render.welcomed = true;
@@ -1643,7 +1644,7 @@
let g = null; try { g = await (await fetch('/api/my/games')).json(); } catch (e) {}
const list = (g && g.games) || [];
if (!list.length) { el.innerHTML = '<p class="muted small">No games are open yet. Check back soon.</p>'; return; }
el.innerHTML = list.map(x => '<div class="game-card"><img src="' + esc(x.art) + '" alt="" loading="lazy"><div class="gc-body"><span class="gc-tag">' + esc(x.tag || '') + '</span><h4>' + esc(x.name) + (x.preview ? '<span class="gc-pre">preview, not live</span>' : '') + '</h4><p class="muted small" style="margin:0">' + esc(x.blurb) + '</p>' + (x.progress && x.progress.line ? '<div class="gc-prog">' + esc(x.progress.line) + '</div>' : '') + '<p class="muted small" style="margin:0">Pays: ' + esc(x.pays || 'POL') + '</p><a class="btn" href="' + esc(x.play) + '">Play</a></div></div>').join('');
el.innerHTML = list.map(x => '<div class="game-card"><img src="' + esc(x.art) + '" alt="" loading="lazy"><div class="gc-body"><span class="gc-tag">' + esc(x.tag || '') + '</span><h4>' + esc(x.name) + (x.preview ? '<span class="gc-pre">preview, not live</span>' : '') + '</h4><p class="muted small" style="margin:0">' + esc(x.blurb) + '</p>' + (x.progress && x.progress.line ? '<div class="gc-prog">' + esc(x.progress.line) + '</div>' : '') + '<p class="muted small" style="margin:0">Pays: ' + esc(x.pays || 'POL') + '</p><a class="btn" href="' + esc(x.play) + '">' + esc(x.cta || 'Play') + '</a></div></div>').join('');
}
async function loadReturnCard() {
const card = $('phReturn'); if (!card) return;
+17
View File
@@ -0,0 +1,17 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 420" role="img" aria-label="PassiveDrip">
<defs>
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#1b1446"/><stop offset="1" stop-color="#4c1d95"/></linearGradient>
<radialGradient id="coin" cx=".35" cy=".3" r=".8"><stop offset="0" stop-color="#c4a6ff"/><stop offset=".6" stop-color="#8247e5"/><stop offset="1" stop-color="#4b1fa8"/></radialGradient>
<linearGradient id="drop" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#9fd8ff"/><stop offset="1" stop-color="#3b82f6"/></linearGradient>
</defs>
<rect width="800" height="420" fill="url(#bg)"/>
<g opacity=".18" fill="#ffffff"><circle cx="90" cy="70" r="3"/><circle cx="700" cy="60" r="4"/><circle cx="640" cy="350" r="3"/><circle cx="160" cy="360" r="4"/><circle cx="420" cy="40" r="2"/></g>
<path d="M400 60 C400 60 340 140 340 180 a60 60 0 0 0 120 0 C460 140 400 60 400 60 Z" fill="url(#drop)"/>
<g transform="translate(400 300)">
<ellipse cx="0" cy="34" rx="92" ry="16" fill="#000" opacity=".25"/>
<circle r="78" fill="url(#coin)" stroke="#d8c7ff" stroke-width="5"/>
<path d="M-28 -24 l28 -16 l28 16 v32 l-28 16 l-28 -16 Z" fill="none" stroke="#ffffff" stroke-width="8" stroke-linejoin="round"/>
</g>
<text x="40" y="220" font-family="Arial, Helvetica, sans-serif" font-size="44" font-weight="800" fill="#ffffff">PassiveDrip</text>
<text x="42" y="256" font-family="Arial, Helvetica, sans-serif" font-size="20" fill="#d8c7ff">Faucet + games, paid in POL</text>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB