Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Repo → Coin Launcher · three.ws</title>
<style>
:root {
--bg: #07070c;
--bg-1: #0c0c15;
--bg-2: #12121e;
--panel: rgba(255, 255, 255, 0.03);
--panel-2: rgba(255, 255, 255, 0.05);
--stroke: rgba(255, 255, 255, 0.08);
--stroke-2: rgba(255, 255, 255, 0.14);
--text: #edeef5;
--muted: #9aa0b4;
--faint: #656b80;
--violet: #7c5cff;
--green: #14f195;
--cyan: #22d3ee;
--pink: #ff5c8a;
--warn: #ffcf6b;
--radius: 16px;
--radius-sm: 11px;
--grad: linear-gradient(120deg, var(--violet), var(--cyan) 55%, var(--green));
--shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.75);
font-synthesis: none;
}
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
background: var(--bg);
color: var(--text);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
-webkit-font-smoothing: antialiased;
}
body {
min-height: 100vh;
background:
radial-gradient(900px 500px at 12% -10%, rgba(124, 92, 255, 0.16), transparent 60%),
radial-gradient(800px 520px at 100% 0%, rgba(20, 241, 149, 0.1), transparent 55%),
var(--bg);
}
a {
color: var(--cyan);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
button {
font: inherit;
cursor: pointer;
}
::selection {
background: rgba(124, 92, 255, 0.4);
}
.wrap {
max-width: 1180px;
margin: 0 auto;
padding: 28px 24px 160px;
}
/* ── Header ─────────────────────────────────────── */
header.top {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
margin-bottom: 26px;
}
.brand {
display: flex;
align-items: center;
gap: 12px;
}
.brand .glyph {
width: 40px;
height: 40px;
border-radius: 12px;
background: var(--grad);
display: grid;
place-items: center;
font-weight: 800;
color: #06060a;
box-shadow: 0 8px 30px -8px rgba(124, 92, 255, 0.7);
}
.brand h1 {
font-size: 16px;
margin: 0;
letter-spacing: 0.2px;
}
.brand p {
margin: 2px 0 0;
font-size: 12.5px;
color: var(--muted);
}
.net {
display: flex;
gap: 4px;
padding: 4px;
background: var(--panel);
border: 1px solid var(--stroke);
border-radius: 999px;
}
.net button {
border: 0;
background: transparent;
color: var(--muted);
padding: 7px 14px;
border-radius: 999px;
font-size: 12.5px;
font-weight: 600;
transition: 0.18s;
}
.net button.on {
background: var(--panel-2);
color: var(--text);
box-shadow: inset 0 0 0 1px var(--stroke-2);
}
.net button.on.main {
color: var(--green);
}
/* ── Hero ───────────────────────────────────────── */
.hero {
display: grid;
grid-template-columns: 1.35fr 1fr;
gap: 18px;
margin-bottom: 22px;
}
.card {
background: linear-gradient(180deg, var(--panel-2), var(--panel));
border: 1px solid var(--stroke);
border-radius: var(--radius);
padding: 20px;
box-shadow: var(--shadow);
}
.hero h2 {
margin: 0 0 6px;
font-size: 26px;
letter-spacing: -0.5px;
}
.hero h2 .g {
background: var(--grad);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.hero .sub {
color: var(--muted);
font-size: 14px;
line-height: 1.55;
margin: 0 0 18px;
}
.userbar {
display: flex;
gap: 10px;
align-items: center;
}
.userbar .at {
position: relative;
flex: 1;
display: flex;
align-items: center;
}
.userbar .at span {
position: absolute;
left: 14px;
color: var(--faint);
font-weight: 600;
}
.userbar input {
width: 100%;
background: var(--bg-1);
border: 1px solid var(--stroke-2);
color: var(--text);
border-radius: 12px;
padding: 13px 14px 13px 30px;
font-size: 15px;
outline: none;
transition: 0.18s;
}
.userbar input:focus {
border-color: var(--violet);
box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}
.btn {
border: 1px solid var(--stroke-2);
background: var(--panel-2);
color: var(--text);
border-radius: 12px;
padding: 12px 18px;
font-weight: 650;
font-size: 14px;
transition: 0.18s;
white-space: nowrap;
display: inline-flex;
align-items: center;
gap: 8px;
}
.btn:hover {
border-color: var(--stroke-2);
background: rgba(255, 255, 255, 0.08);
transform: translateY(-1px);
}
.btn:active {
transform: translateY(0);
}
.btn:disabled {
opacity: 0.45;
cursor: not-allowed;
transform: none;
}
.btn.primary {
background: var(--grad);
color: #06060a;
border: 0;
box-shadow: 0 10px 34px -12px rgba(20, 241, 149, 0.6);
}
.btn.primary:hover {
filter: brightness(1.06);
}
.btn.ghost {
background: transparent;
}
/* profile chip */
.profile {
display: flex;
gap: 12px;
align-items: center;
margin-top: 16px;
padding: 12px;
border: 1px solid var(--stroke);
border-radius: 12px;
background: var(--bg-1);
min-height: 66px;
}
.profile img {
width: 42px;
height: 42px;
border-radius: 10px;
border: 1px solid var(--stroke-2);
}
.profile .n {
font-weight: 700;
font-size: 14.5px;
}
.profile .m {
color: var(--muted);
font-size: 12.5px;
}
.profile .stat {
margin-left: auto;
text-align: right;
}
.profile .stat b {
font-size: 18px;
}
.profile .stat span {
display: block;
font-size: 11px;
color: var(--faint);
text-transform: uppercase;
letter-spacing: 0.6px;
}
/* reward card */
.reward h3 {
margin: 0 0 12px;
font-size: 13px;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--muted);
display: flex;
align-items: center;
gap: 8px;
}
.flow {
display: flex;
align-items: center;
gap: 8px;
font-size: 13px;
}
.flow .node {
flex: 1;
text-align: center;
padding: 12px 6px;
border-radius: 12px;
background: var(--bg-1);
border: 1px solid var(--stroke);
}
.flow .node b {
display: block;
font-size: 12.5px;
}
.flow .node small {
color: var(--faint);
font-size: 10.5px;
}
.flow .arrow {
color: var(--green);
font-size: 18px;
}
.pda {
margin-top: 12px;
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 11.5px;
color: var(--green);
word-break: break-all;
background: rgba(20, 241, 149, 0.06);
border: 1px solid rgba(20, 241, 149, 0.2);
padding: 9px 11px;
border-radius: 9px;
}
/* ── Toolbar ────────────────────────────────────── */
.toolbar {
display: flex;
gap: 10px;
align-items: center;
flex-wrap: wrap;
margin: 20px 0 14px;
}
.search {
position: relative;
flex: 1;
min-width: 200px;
}
.search input {
width: 100%;
background: var(--panel);
border: 1px solid var(--stroke);
color: var(--text);
border-radius: 11px;
padding: 10px 12px 10px 34px;
outline: none;
}
.search input:focus {
border-color: var(--stroke-2);
}
.search svg {
position: absolute;
left: 11px;
top: 11px;
opacity: 0.5;
}
.chip {
border: 1px solid var(--stroke);
background: var(--panel);
color: var(--muted);
border-radius: 999px;
padding: 8px 13px;
font-size: 12.5px;
font-weight: 600;
transition: 0.16s;
}
.chip.on {
color: var(--text);
border-color: var(--violet);
background: rgba(124, 92, 255, 0.16);
}
.chip:hover {
border-color: var(--stroke-2);
}
select.sort {
background: var(--panel);
border: 1px solid var(--stroke);
color: var(--muted);
border-radius: 11px;
padding: 9px 11px;
outline: none;
}
.selcount {
margin-left: auto;
font-size: 13px;
color: var(--muted);
}
.selcount b {
color: var(--text);
}
.linkbtn {
background: none;
border: 0;
color: var(--cyan);
font-size: 12.5px;
font-weight: 600;
padding: 4px;
}
/* ── Repo grid ──────────────────────────────────── */
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
gap: 12px;
}
.repo {
position: relative;
border: 1px solid var(--stroke);
border-radius: var(--radius-sm);
overflow: hidden;
background: var(--bg-1);
cursor: pointer;
transition:
transform 0.16s,
border-color 0.16s,
box-shadow 0.16s;
}
.repo:hover {
transform: translateY(-3px);
border-color: var(--stroke-2);
box-shadow: 0 16px 40px -22px rgba(0, 0, 0, 0.9);
}
.repo.sel {
border-color: var(--green);
box-shadow: 0 0 0 1px var(--green), 0 16px 40px -24px rgba(20, 241, 149, 0.5);
}
.repo .cover {
aspect-ratio: 2 / 1;
background: linear-gradient(135deg, #1a1a2b, #101019);
position: relative;
overflow: hidden;
}
.repo .cover .cimg {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
opacity: 0;
transition: opacity 0.4s ease;
}
.repo .check {
position: absolute;
top: 10px;
right: 10px;
width: 24px;
height: 24px;
border-radius: 50%;
border: 2px solid rgba(255, 255, 255, 0.6);
background: rgba(0, 0, 0, 0.4);
backdrop-filter: blur(4px);
display: grid;
place-items: center;
transition: 0.16s;
}
.repo.sel .check {
background: var(--green);
border-color: var(--green);
}
.repo .check svg {
opacity: 0;
transition: 0.16s;
}
.repo.sel .check svg {
opacity: 1;
}
.repo .body {
padding: 11px 13px 13px;
}
.repo .name {
font-weight: 700;
font-size: 13.5px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.repo .desc {
color: var(--muted);
font-size: 12px;
line-height: 1.4;
margin: 4px 0 9px;
height: 33px;
overflow: hidden;
}
.repo .meta {
display: flex;
align-items: center;
gap: 12px;
font-size: 11.5px;
color: var(--faint);
}
.repo .tick {
margin-left: auto;
font-family: ui-monospace, monospace;
color: var(--violet);
font-weight: 700;
}
.dot {
width: 9px;
height: 9px;
border-radius: 50%;
display: inline-block;
background: var(--faint);
}
.tag {
position: absolute;
top: 10px;
left: 10px;
font-size: 10px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
padding: 3px 7px;
border-radius: 6px;
background: rgba(0, 0, 0, 0.55);
backdrop-filter: blur(4px);
color: var(--warn);
}
/* skeleton */
.sk {
border-radius: var(--radius-sm);
overflow: hidden;
border: 1px solid var(--stroke);
}
.sk .cover,
.sk .line {
background: linear-gradient(90deg, #12121c 25%, #1b1b28 37%, #12121c 63%);
background-size: 400% 100%;
animation: sh 1.3s ease infinite;
}
.sk .cover {
aspect-ratio: 2/1;
}
.sk .line {
height: 11px;
margin: 11px 13px;
border-radius: 6px;
}
@keyframes sh {
0% {
background-position: 100% 0;
}
100% {
background-position: -100% 0;
}
}
.empty {
text-align: center;
padding: 70px 20px;
color: var(--muted);
}
.empty .big {
font-size: 40px;
margin-bottom: 10px;
}
/* ── Summary bar ────────────────────────────────── */
.bar {
position: fixed;
left: 50%;
bottom: 18px;
transform: translateX(-50%) translateY(140%);
width: min(1140px, calc(100vw - 32px));
background: rgba(14, 14, 22, 0.86);
backdrop-filter: blur(18px) saturate(1.4);
border: 1px solid var(--stroke-2);
border-radius: 18px;
box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.85);
padding: 14px 16px;
display: flex;
align-items: center;
gap: 18px;
transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.25, 1);
z-index: 40;
}
.bar.show {
transform: translateX(-50%) translateY(0);
}
.bar .metric {
display: flex;
flex-direction: column;
gap: 1px;
}
.bar .metric b {
font-size: 17px;
}
.bar .metric span {
font-size: 10.5px;
color: var(--faint);
text-transform: uppercase;
letter-spacing: 0.7px;
}
.bar .sep {
width: 1px;
height: 34px;
background: var(--stroke);
}
.bar .cfg {
display: flex;
align-items: center;
gap: 8px;
font-size: 12.5px;
color: var(--muted);
}
.bar .cfg input {
width: 78px;
background: var(--bg-1);
border: 1px solid var(--stroke);
color: var(--text);
border-radius: 8px;
padding: 6px 8px;
outline: none;
}
.bar .actions {
margin-left: auto;
display: flex;
gap: 10px;
}
/* ── Modal / drawer ─────────────────────────────── */
.scrim {
position: fixed;
inset: 0;
background: rgba(4, 4, 8, 0.66);
backdrop-filter: blur(6px);
opacity: 0;
pointer-events: none;
transition: 0.24s;
z-index: 50;
}
.scrim.show {
opacity: 1;
pointer-events: auto;
}
.modal {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -46%) scale(0.98);
width: min(560px, calc(100vw - 32px));
max-height: 86vh;
overflow: auto;
background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
border: 1px solid var(--stroke-2);
border-radius: 20px;
box-shadow: var(--shadow);
padding: 24px;
opacity: 0;
pointer-events: none;
transition: 0.26s cubic-bezier(0.2, 0.9, 0.25, 1);
z-index: 51;
}
.modal.show {
opacity: 1;
pointer-events: auto;
transform: translate(-50%, -50%) scale(1);
}
.modal h3 {
margin: 0 0 4px;
font-size: 19px;
}
.modal .lead {
color: var(--muted);
font-size: 13.5px;
margin: 0 0 18px;
line-height: 1.5;
}
.fund {
display: flex;
gap: 16px;
align-items: center;
background: var(--bg);
border: 1px solid var(--stroke);
border-radius: 14px;
padding: 16px;
}
.fund img.qr {
width: 118px;
height: 118px;
border-radius: 10px;
background: #fff;
}
.addr {
font-family: ui-monospace, monospace;
font-size: 12px;
background: var(--bg-1);
border: 1px solid var(--stroke);
border-radius: 9px;
padding: 9px 10px;
word-break: break-all;
display: flex;
gap: 8px;
align-items: center;
}
.addr button {
margin-left: auto;
background: var(--panel-2);
border: 1px solid var(--stroke);
border-radius: 7px;
color: var(--text);
padding: 4px 9px;
font-size: 11px;
}
.balrow {
display: flex;
align-items: center;
gap: 8px;
margin-top: 12px;
font-size: 13px;
}
.balrow .pill {
padding: 3px 9px;
border-radius: 999px;
font-weight: 700;
font-size: 12px;
}
.pill.ok {
background: rgba(20, 241, 149, 0.16);
color: var(--green);
}
.pill.wait {
background: rgba(255, 207, 107, 0.16);
color: var(--warn);
}
/* progress rows */
.prog {
margin-top: 6px;
}
.progbar {
height: 7px;
border-radius: 999px;
background: var(--bg);
overflow: hidden;
border: 1px solid var(--stroke);
margin-bottom: 14px;
}
.progbar i {
display: block;
height: 100%;
width: 0%;
background: var(--grad);
transition: width 0.3s;
}
.rows {
max-height: 340px;
overflow: auto;
display: flex;
flex-direction: column;
gap: 6px;
}
.rrow {
display: flex;
align-items: center;
gap: 10px;
padding: 9px 11px;
border: 1px solid var(--stroke);
border-radius: 10px;
background: var(--bg-1);
font-size: 13px;
}
.rrow .rn {
font-weight: 650;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 40%;
}
.rrow .ph {
margin-left: auto;
font-size: 11px;
color: var(--muted);
text-transform: capitalize;
}
.rrow.ok {
border-color: rgba(20, 241, 149, 0.3);
}
.rrow.err {
border-color: rgba(255, 92, 138, 0.4);
}
.spin {
width: 14px;
height: 14px;
border-radius: 50%;
border: 2px solid var(--stroke-2);
border-top-color: var(--cyan);
animation: rot 0.8s linear infinite;
}
@keyframes rot {
to {
transform: rotate(360deg);
}
}
.tickok {
color: var(--green);
}
.tickerr {
color: var(--pink);
}
/* toast */
.toasts {
position: fixed;
top: 74px;
right: 18px;
display: flex;
flex-direction: column;
gap: 8px;
z-index: 60;
}
.toast {
background: rgba(18, 18, 28, 0.95);
border: 1px solid var(--stroke-2);
border-left: 3px solid var(--violet);
border-radius: 11px;
padding: 11px 14px;
font-size: 13px;
box-shadow: var(--shadow);
animation: slideIn 0.24s ease;
max-width: 320px;
}
.toast.err {
border-left-color: var(--pink);
}
.toast.ok {
border-left-color: var(--green);
}
@keyframes slideIn {
from {
transform: translateX(20px);
opacity: 0;
}
}
kbd {
background: var(--panel-2);
border: 1px solid var(--stroke-2);
border-bottom-width: 2px;
border-radius: 6px;
padding: 1px 6px;
font-size: 11px;
font-family: ui-monospace, monospace;
}
.foot {
margin-top: 22px;
color: var(--faint);
font-size: 12px;
text-align: center;
}
@media (max-width: 820px) {
.hero {
grid-template-columns: 1fr;
}
.bar {
flex-wrap: wrap;
}
.bar .actions {
width: 100%;
}
}
</style>
</head>
<body>
<div class="wrap">
<header class="top">
<div class="brand">
<div class="glyph">◎</div>
<div>
<h1>Repo → Coin Launcher</h1>
<p>Launch a pump.fun coin per GitHub repo · rewards routed to the owner</p>
</div>
</div>
<div class="net" id="net">
<button data-net="mainnet" class="on main">◎ Mainnet</button>
<button data-net="devnet">Devnet</button>
</div>
</header>
<section class="hero">
<div class="card">
<h2>Turn every repo into a <span class="g">coin</span>.</h2>
<p class="sub">
One pump.fun coin per public repository. <b>100% of creator rewards</b> route to the
GitHub owner via pump.fun's social-fee escrow — you keep the launch wallets, they claim
the fees. Pick repos, generate wallets, fund one master, launch.
</p>
<div class="userbar">
<label class="at">
<span>@</span>
<input id="user" value="nirholas" spellcheck="false" autocomplete="off" />
</label>
<button class="btn primary" id="load">Discover repos</button>
</div>
<div class="profile" id="profile" style="display: none"></div>
</div>
<div class="card reward">
<h3><span class="dot" style="background: var(--green)"></span> Reward routing</h3>
<div class="flow">
<div class="node">
<b>Launch wallet</b><small>you own the key</small>
</div>
<div class="arrow">→</div>
<div class="node" style="border-color: rgba(20, 241, 149, 0.3)">
<b style="color: var(--green)">GitHub owner</b><small>100% of fees</small>
</div>
</div>
<div class="pda" id="pda">resolve a user to see the escrow address…</div>
</div>
</section>
<div class="toolbar" id="toolbar" style="display: none">
<div class="search">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="7" /><path d="m21 21-4.3-4.3" />
</svg>
<input id="q" placeholder="Search repos… ( / )" />
</div>
<button class="chip on" data-f="forks">Forks</button>
<button class="chip on" data-f="archived">Archived</button>
<button class="chip" data-f="starred">★ Starred only</button>
<select class="sort" id="sort">
<option value="stars">Sort: Stars</option>
<option value="name">Sort: Name</option>
<option value="updated">Sort: Updated</option>
</select>
<button class="linkbtn" id="selAll">Select all</button>
<button class="linkbtn" id="selNone">Clear</button>
<div class="selcount"><b id="selN">0</b> selected</div>
</div>
<div class="grid" id="grid"></div>
<div class="foot" id="foot"></div>
</div>
<!-- summary bar -->
<div class="bar" id="bar">
<div class="metric"><b id="mCount">0</b><span>coins</span></div>
<div class="sep"></div>
<div class="metric"><b id="mCost">0 ◎</b><span>to fund</span></div>
<div class="sep"></div>
<div class="cfg">
dev buy <input id="devBuy" type="number" step="0.0001" min="0" value="0" /> ◎
</div>
<div class="cfg">
fund/wallet <input id="fpw" type="number" step="0.001" min="0.02" /> ◎
</div>
<div class="actions">
<button class="btn" id="genBtn">Generate wallets</button>
<button class="btn primary" id="launchBtn" disabled>Launch →</button>
</div>
</div>
<!-- modal -->
<div class="scrim" id="scrim"></div>
<div class="modal" id="modal">
<div id="modalBody"></div>
</div>
<div class="toasts" id="toasts"></div>
<canvas id="confetti" style="position: fixed; inset: 0; pointer-events: none; z-index: 70; display: none"></canvas>
<script type="module">
const $ = (s, r = document) => r.querySelector(s);
const api = (p, o) => fetch(p, o).then((r) => r.json());
const solFmt = (n) => `${(+n).toFixed(n < 1 ? 4 : 3)} ◎`;
const state = {
user: 'nirholas',
profile: null,
network: 'mainnet',
repos: [],
sel: new Set(),
filters: { forks: true, archived: true, starred: false },
sort: 'stars',
q: '',
manifest: null,
devBuy: 0,
fpw: null,
launching: false,
};
// ── toasts ──────────────────────────────────────
function toast(msg, kind = '') {
const t = document.createElement('div');
t.className = `toast ${kind}`;
t.textContent = msg;
$('#toasts').append(t);
setTimeout(() => {
t.style.opacity = '0';
t.style.transition = '0.3s';
setTimeout(() => t.remove(), 300);
}, 3600);
}
// ── network toggle ──────────────────────────────
$('#net').addEventListener('click', (e) => {
const b = e.target.closest('button');
if (!b) return;
state.network = b.dataset.net;
[...$('#net').children].forEach((x) => x.classList.remove('on', 'main'));
b.classList.add('on');
if (state.network === 'mainnet') b.classList.add('main');
refreshState();
});
// ── discover ────────────────────────────────────
$('#load').addEventListener('click', loadRepos);
$('#user').addEventListener('keydown', (e) => e.key === 'Enter' && loadRepos());
async function loadRepos() {
state.user = $('#user').value.trim().replace(/^@/, '') || 'nirholas';
$('#toolbar').style.display = 'flex';
renderSkeleton();
try {
const prof = await api(`/api/resolve?user=${state.user}`);
if (prof.error) throw new Error(prof.error);
state.profile = prof;
renderProfile(prof);
$('#pda').textContent = prof.socialFeePda;
const data = await api(
`/api/repos?user=${state.user}&forks=${state.filters.forks}&archived=${state.filters.archived}`,
);
if (data.error) throw new Error(data.error);
state.repos = data.repos;
// preselect all by default
state.sel = new Set(state.repos.map((r) => r.name));
render();
await refreshState();
toast(`Loaded ${data.count} repos for @${state.user}`, 'ok');
} catch (e) {
$('#grid').innerHTML = `<div class="empty"><div class="big">⚠︎</div>${e.message}</div>`;
}
}
function renderProfile(p) {
$('#profile').style.display = 'flex';
$('#profile').innerHTML = `
<img src="${p.avatarUrl}" alt="" />
<div>
<div class="n">${p.name || p.login} <span class="m">@${p.login}</span></div>
<div class="m">${(p.bio || '').slice(0, 64) || 'GitHub developer'}</div>
</div>
<div class="stat"><b>${p.publicRepos}</b><span>public repos</span></div>`;
}
// ── filters / sort / search ─────────────────────
$('#toolbar').addEventListener('click', (e) => {
const c = e.target.closest('.chip');
if (!c) return;
const f = c.dataset.f;
state.filters[f] = !state.filters[f];
// chip highlighted == filter active (forks/archived included, or starred-only on)
c.classList.toggle('on', state.filters[f]);
// forks/archived change the fetched set; starred is a client-side view filter
if (f === 'forks' || f === 'archived') loadRepos();
else render();
});
$('#q').addEventListener('input', (e) => {
state.q = e.target.value.toLowerCase();
render();
});
$('#sort').addEventListener('change', (e) => {
state.sort = e.target.value;
render();
});
$('#selAll').addEventListener('click', () => {
visibleRepos().forEach((r) => state.sel.add(r.name));
render();
});
$('#selNone').addEventListener('click', () => {
state.sel.clear();
render();
});
function visibleRepos() {
let list = state.repos.slice();
if (state.filters.starred) list = list.filter((r) => r.stars > 0);
if (state.q) list = list.filter((r) => (r.name + ' ' + (r.description || '')).toLowerCase().includes(state.q));
if (state.sort === 'name') list.sort((a, b) => a.name.localeCompare(b.name));
else if (state.sort === 'updated') list.sort((a, b) => (b.updated_at || '').localeCompare(a.updated_at || ''));
else list.sort((a, b) => (b.stars || 0) - (a.stars || 0));
return list;
}
// ── render grid ─────────────────────────────────
function renderSkeleton() {
$('#grid').innerHTML = Array.from({ length: 8 })
.map(() => `<div class="sk"><div class="cover"></div><div class="line" style="width:70%"></div><div class="line" style="width:90%"></div></div>`)
.join('');
}
function tickerOf(name) {
let s = name.replace(/[^a-zA-Z0-9]/g, '').toUpperCase().slice(0, 10);
return s || 'COIN';
}
function render() {
const list = visibleRepos();
if (!list.length) {
$('#grid').innerHTML = `<div class="empty"><div class="big">🔍</div>No repos match your filters.</div>`;
} else {
$('#grid').innerHTML = list
.map((r) => {
const sel = state.sel.has(r.name);
const tag = r.fork ? 'fork' : r.archived ? 'archived' : '';
return `<div class="repo ${sel ? 'sel' : ''}" data-n="${r.name}">
<div class="cover">
<img class="cimg" loading="lazy" decoding="async" data-src="/api/cover?user=${encodeURIComponent(state.user)}&repo=${encodeURIComponent(r.name)}" alt="" />
${tag ? `<span class="tag">${tag}</span>` : ''}
<span class="check"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="#06060a" stroke-width="3.5"><path d="M20 6 9 17l-5-5"/></svg></span>
</div>
<div class="body">
<div class="name">${r.name}</div>
<div class="desc">${r.description ? escapeHtml(r.description) : '<span style="color:var(--faint)">No description</span>'}</div>
<div class="meta">
${r.language ? `<span><span class="dot" style="background:${langColor(r.language)}"></span> ${r.language}</span>` : ''}
<span>★ ${r.stars || 0}</span>
<span class="tick">$${tickerOf(r.name)}</span>
</div>
</div>
</div>`;
})
.join('');
}
$('#selN').textContent = state.sel.size;
$('#foot').textContent = `${list.length} shown · ${state.repos.length} total`;
lazyCovers();
updateBar();
}
// Lazy-load covers: only fetch images as cards scroll into view, so we
// never fire 146 requests at once (the server proxies + caches them).
let coverIO;
function lazyCovers() {
coverIO?.disconnect();
coverIO = new IntersectionObserver(
(entries) => {
for (const en of entries) {
if (!en.isIntersecting) continue;
const img = en.target;
img.src = img.dataset.src;
img.addEventListener('load', () => (img.style.opacity = '1'), { once: true });
coverIO.unobserve(img);
}
},
{ rootMargin: '300px' },
);
document.querySelectorAll('.cimg[data-src]').forEach((img) => coverIO.observe(img));
}
$('#grid').addEventListener('click', (e) => {
const card = e.target.closest('.repo');
if (!card) return;
const n = card.dataset.n;
state.sel.has(n) ? state.sel.delete(n) : state.sel.add(n);
card.classList.toggle('sel', state.sel.has(n));
$('#selN').textContent = state.sel.size;
updateBar();
});
function escapeHtml(s) {
return s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
}
function langColor(l) {
const m = { JavaScript: '#f1e05a', TypeScript: '#3178c6', Python: '#3572A5', Rust: '#dea584', Go: '#00ADD8', Solidity: '#AA6746', HTML: '#e34c26', CSS: '#563d7c', Shell: '#89e051' };
return m[l] || '#8b8b9a';
}
// ── cost + summary bar ──────────────────────────
let costPerCoin = 0.023;
function updateBar() {
const n = state.sel.size;
$('#mCount').textContent = n;
const fpw = state.fpw ?? costPerCoin + 0.004;
$('#mCost').textContent = solFmt(fpw * n);
$('#bar').classList.toggle('show', n > 0 && !state.launching);
$('#launchBtn').disabled = !state.manifest || n === 0;
}
$('#devBuy').addEventListener('input', (e) => {
state.devBuy = Math.max(0, +e.target.value || 0);
costPerCoin = 0.0228 + state.devBuy;
if (state.fpw == null) $('#fpw').value = (costPerCoin + 0.004).toFixed(4);
updateBar();
});
$('#fpw').addEventListener('input', (e) => {
state.fpw = +e.target.value || null;
updateBar();
});
async function refreshState() {
const s = await api(
`/api/state?user=${state.user}&network=${state.network}&devBuy=${state.devBuy}&count=${state.sel.size}`,
);
if (s.error) return;
state.manifest = s.manifest;
costPerCoin = s.cost.perCoinSol;
if (state.fpw == null) $('#fpw').value = s.cost.fundPerWalletSol.toFixed(4);
updateBar();
}
// ── generate ────────────────────────────────────
$('#genBtn').addEventListener('click', async () => {
if (!state.sel.size) return toast('Select at least one repo', 'err');
const selected = state.repos.filter((r) => state.sel.has(r.name));
$('#genBtn').textContent = 'Generating…';
$('#genBtn').disabled = true;
try {
const res = await api('/api/generate', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({
user: state.user,
network: state.network,
devBuy: state.devBuy,
fundPerWallet: state.fpw ?? undefined,
repos: selected,
}),
});
if (res.error) throw new Error(res.error);
await refreshState();
toast(`Generated ${res.count} wallets · master ready`, 'ok');
openFundModal(res);
} catch (e) {
toast(e.message, 'err');
} finally {
$('#genBtn').textContent = 'Generate wallets';
$('#genBtn').disabled = false;
}
});
// ── fund modal ──────────────────────────────────
let balPoll = null;
function openFundModal(gen) {
const master = gen.master;
const need = (state.fpw ?? costPerCoin + 0.004) * gen.count;
$('#modalBody').innerHTML = `
<h3>Fund the master wallet</h3>
<p class="lead">Send <b>~${solFmt(need)}</b> to this wallet. It funds all ${gen.count} launch wallets. Keys are in <b>pump-launch-wallets.zip</b> — download and keep it private.</p>
<div class="fund">
<img class="qr" src="/api/qr?text=${master}" alt="QR" />
<div style="flex:1">
<div class="addr"><span id="maddr">${master}</span><button id="copyAddr">Copy</button></div>
<div class="balrow">Balance: <span class="pill wait" id="balPill">— checking…</span></div>
<a class="btn ghost" href="/api/download?user=${state.user}" style="margin-top:12px;display:inline-flex">⬇ Download keys .zip</a>
</div>
</div>
<div style="display:flex;gap:10px;margin-top:20px;justify-content:flex-end">
<button class="btn ghost" id="mClose">Close</button>
<button class="btn primary" id="mLaunch" disabled>Launch ${gen.count} coins →</button>
</div>`;
showModal(true);
$('#copyAddr').onclick = () => {
navigator.clipboard.writeText(master);
toast('Address copied', 'ok');
};
$('#mClose').onclick = () => showModal(false);
$('#mLaunch').onclick = () => {
showModal(false);
startLaunch();
};
const need_l = need;
clearInterval(balPoll);
const poll = async () => {
const s = await api(`/api/state?user=${state.user}&network=${state.network}`);
const bal = s.masterBalanceSol || 0;
const ok = bal >= need_l * 0.999;
const pill = $('#balPill');
if (pill) {
pill.className = `pill ${ok ? 'ok' : 'wait'}`;
pill.textContent = `${solFmt(bal)}${ok ? ' ✓ ready' : ` / ${solFmt(need_l)}`}`;
}
const lb = $('#mLaunch');
if (lb) lb.disabled = !ok;
};
poll();
balPoll = setInterval(poll, 4000);
}
$('#launchBtn').addEventListener('click', () => {
if (!state.manifest) return toast('Generate wallets first', 'err');
openFundModal({ master: state.manifest.master_pubkey, count: state.sel.size });
});
function showModal(on) {
$('#scrim').classList.toggle('show', on);
$('#modal').classList.toggle('show', on);
if (!on) clearInterval(balPoll);
}
$('#scrim').addEventListener('click', () => showModal(false));
// ── launch (SSE over fetch) ─────────────────────
async function startLaunch() {
state.launching = true;
$('#bar').classList.remove('show');
const repoNames = [...state.sel];
const total = repoNames.length;
const done = {};
$('#modalBody').innerHTML = `
<h3>Launching ${total} coins</h3>
<p class="lead">Creating each coin, then delegating 100% of rewards to @${state.user}. Resumable — safe to close and reopen.</p>
<div class="prog">
<div class="progbar"><i id="pbar"></i></div>
<div class="rows" id="rows">${repoNames.map((n) => rrow(n, 'queued')).join('')}</div>
</div>
<div style="display:flex;justify-content:space-between;align-items:center;margin-top:16px">
<span class="m" id="pstat" style="color:var(--muted);font-size:13px">Starting…</span>
<button class="btn ghost" id="mDone">Run in background</button>
</div>`;
showModal(true);
$('#mDone').onclick = () => showModal(false);
const res = await fetch('/api/launch', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ user: state.user, network: state.network, devBuy: state.devBuy, fundPerWallet: state.fpw ?? undefined, repoNames }),
});
const reader = res.body.getReader();
const dec = new TextDecoder();
let buf = '';
let completed = 0,
errors = 0;
while (true) {
const { value, done: rdone } = await reader.read();
if (rdone) break;
buf += dec.decode(value, { stream: true });
const parts = buf.split('\n\n');
buf = parts.pop();
for (const part of parts) {
const line = part.split('\n').find((l) => l.startsWith('data: '));
if (!line) continue;
const e = JSON.parse(line.slice(6));
handleEvent(e);
}
}
function handleEvent(e) {
if (e.type === 'repo') setRow(e.repo, e.phase);
else if (e.type === 'done') {
completed++;
done[e.repo] = e;
setRow(e.repo, 'done', e);
} else if (e.type === 'error') {
errors++;
setRow(e.repo, 'error', e);
} else if (e.type === 'info') $('#pstat') && ($('#pstat').textContent = e.message);
else if (e.type === 'fatal') {
toast(e.message, 'err');
$('#pstat') && ($('#pstat').textContent = '⚠︎ ' + e.message);
} else if (e.type === 'complete') finish();
const pct = Math.round(((completed + errors) / total) * 100);
$('#pbar') && ($('#pbar').style.width = pct + '%');
$('#pstat') && ($('#pstat').textContent = `${completed} launched · ${errors} failed · ${total} total`);
}
function finish() {
state.launching = false;
if (completed > 0) confetti();
toast(`Done — ${completed}/${total} coins live, rewards → @${state.user}`, completed === total ? 'ok' : '');
}
}
function rrow(name, phase, e) {
const cls = phase === 'done' ? 'ok' : phase === 'error' ? 'err' : '';
let right = '';
if (phase === 'done')
right = `<a class="ph tickok" target="_blank" href="https://solscan.io/tx/${e?.launchSig || ''}">view ↗</a>`;
else if (phase === 'error') right = `<span class="ph tickerr">failed</span>`;
else if (phase === 'queued') right = `<span class="ph">queued</span>`;
else right = `<span class="spin"></span><span class="ph">${phase}</span>`;
return `<div class="rrow ${cls}" data-r="${name}"><span class="rn">${name}</span>${right}</div>`;
}
function setRow(name, phase, e) {
const el = document.querySelector(`.rrow[data-r="${CSS.escape(name)}"]`);
if (el) el.outerHTML = rrow(name, phase, e);
}
// ── confetti (tiny) ─────────────────────────────
function confetti() {
const cv = $('#confetti');
cv.style.display = 'block';
cv.width = innerWidth;
cv.height = innerHeight;
const ctx = cv.getContext('2d');
const cols = ['#7c5cff', '#14f195', '#22d3ee', '#ff5c8a', '#ffcf6b'];
const P = Array.from({ length: 140 }, () => ({
x: innerWidth / 2,
y: innerHeight / 3,
vx: (Math.random() - 0.5) * 14,
vy: Math.random() * -14 - 4,
c: cols[(Math.random() * cols.length) | 0],
s: Math.random() * 6 + 3,
r: Math.random() * 6,
}));
let t = 0;
(function loop() {
ctx.clearRect(0, 0, cv.width, cv.height);
P.forEach((p) => {
p.vy += 0.5;
p.x += p.vx;
p.y += p.vy;
p.r += 0.2;
ctx.save();
ctx.translate(p.x, p.y);
ctx.rotate(p.r);
ctx.fillStyle = p.c;
ctx.fillRect(-p.s / 2, -p.s / 2, p.s, p.s * 0.6);
ctx.restore();
});
if (++t < 120) requestAnimationFrame(loop);
else cv.style.display = 'none';
})();
}
// ── keyboard ────────────────────────────────────
addEventListener('keydown', (e) => {
if (e.key === '/' && document.activeElement.tagName !== 'INPUT') {
e.preventDefault();
$('#q').focus();
}
if ((e.metaKey || e.ctrlKey) && e.key === 'a' && state.repos.length && document.activeElement.tagName !== 'INPUT') {
e.preventDefault();
visibleRepos().forEach((r) => state.sel.add(r.name));
render();
}
if (e.key === 'Escape') showModal(false);
});
// boot
$('#fpw').value = '0.0268';
loadRepos();
</script>
</body>
</html>