Skip to content

Commit 7dd3fbe

Browse files
authored
Merge pull request #21 from plotflow/claude/artwork-sales-website-01JWP9tY4m4hfX8WyoEQZ1kU
Claude/artwork sales website 01 jwp9t y4m4hf x8 wyo eqz1k u
2 parents e6394b6 + df2bb47 commit 7dd3fbe

5 files changed

Lines changed: 65 additions & 27 deletions

File tree

data/editions.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

product.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ <h5>Pen<sup>2</sup></h5>
8888
<span class="pd-ed" id="pdEd"></span>
8989
</div>
9090
<div class="pd-stock" id="pdStock" hidden></div>
91-
<button class="pd-acquire" id="pdAcquire">Acquire · <span id="pdAcquirePrice"></span></button>
91+
<button class="pd-acquire" id="pdAcquire">Acquire — plotted to order<span id="pdAcquirePrice" hidden></span></button>
9292
<p class="pd-note tiny">Plotted to order in the chosen ink. Shipping and any taxes calculated at checkout.</p>
9393
<button class="pd-wallpaper tiny" id="pdWallpaper">↓ Download phone wallpaper</button>
9494
<div class="pd-nudge" id="pdNudge" hidden>

styles/console.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,18 @@
275275
.pfr-stagewrap{height:62vh;min-height:380px}
276276
.pfr-panel{border-left:none;border-top:1px solid var(--line)}
277277
}
278+
279+
/* pen swatches as plain color squares (specimen-record style):
280+
square chip, label beneath, outline ring when selected —
281+
overrides the pill treatment from styles.css on the record page */
282+
.pfr-panel .pd-swatches{gap:16px}
283+
.pfr-panel .pd-swatch{flex-direction:column;align-items:center;gap:7px;
284+
padding:0;border:none;background:none}
285+
.pfr-panel .pd-swatch .pd-dot{width:34px;height:34px;border-radius:0;
286+
box-shadow:0 0 0 1px var(--line)}
287+
.pfr-panel .pd-swatch:hover .pd-dot{box-shadow:0 0 0 1px var(--mute)}
288+
.pfr-panel .pd-swatch.on .pd-dot{outline:2px solid var(--white);outline-offset:2px;
289+
box-shadow:0 0 0 1px rgba(0,0,0,.4)}
290+
.pfr-panel .pd-swatch-name{font-size:8.5px;font-weight:700;letter-spacing:.12em;
291+
text-transform:uppercase;color:var(--dim)}
292+
.pfr-panel .pd-swatch.on .pd-swatch-name{color:var(--white)}

tools/build_data.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414

1515
# key -> metadata. `file` is the svg basename in assets/plots (without .svg).
1616
META = {
17-
"zaku": {"file":"zaku-ii", "name":"Zaku II", "code":"MS-06", "jp":"ザク", "edition":"ED. 09/25 · 11×14″", "price":"$45"},
18-
"guncannon":{"file":"guncannon","name":"Guncannon","code":"RX-77", "jp":"ガンキャノン", "edition":"ED. 18/25 · 11×14″", "price":"$45"},
19-
"bigzam": {"file":"big-zam", "name":"Big Zam", "code":"MA-08", "jp":"ビグ・ザム", "edition":"ED. 05/25 · 11×14″", "price":"$45"},
20-
"dom": {"file":"dom", "name":"Dom", "code":"MS-09", "jp":"ドム", "edition":"ED. 12/25 · 11×14″", "price":"$45"},
21-
"zgok": {"file":"zgok", "name":"Z'Gok", "code":"MSM-07", "jp":"ズゴック", "edition":"ED. 22/25 · 11×14″", "price":"$45"},
22-
"gp02": {"file":"gp-02", "name":"GP-02A", "code":"RX-78GP02", "jp":"ガンダム試作2号機", "edition":"ED. 15/25 · 11×14″", "price":"$45"},
17+
"zaku": {"file":"zaku-ii", "name":"Zaku II", "code":"MS-06", "jp":"ザク", "edition":"ED. OF 25 · 11×14″", "price":"$45"},
18+
"guncannon":{"file":"guncannon","name":"Guncannon","code":"RX-77", "jp":"ガンキャノン", "edition":"ED. OF 25 · 11×14″", "price":"$45"},
19+
"bigzam": {"file":"big-zam", "name":"Big Zam", "code":"MA-08", "jp":"ビグ・ザム", "edition":"ED. OF 25 · 11×14″", "price":"$45"},
20+
"dom": {"file":"dom", "name":"Dom", "code":"MS-09", "jp":"ドム", "edition":"ED. OF 25 · 11×14″", "price":"$45"},
21+
"zgok": {"file":"zgok", "name":"Z'Gok", "code":"MSM-07", "jp":"ズゴック", "edition":"ED. OF 25 · 11×14″", "price":"$45"},
22+
"gp02": {"file":"gp-02", "name":"GP-02A", "code":"RX-78GP02", "jp":"ガンダム試作2号機", "edition":"ED. OF 25 · 11×14″", "price":"$45"},
2323
}
2424

2525
# Short editorial blurb shown on each edition's product page + lore card.

worker/src/index.js

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ export default {
6262
return handleWebhook(request, env);
6363
}
6464

65+
// ---- health endpoint: which pieces are configured (booleans only) ----
66+
// curl .../health → instantly shows whether the webhook/email path can
67+
// work at all. A false here explains "orders but no emails" silently.
68+
if (url.pathname === "/health" && request.method === "GET") {
69+
return json({
70+
stripe_key: !!env.STRIPE_SECRET_KEY,
71+
webhook_secret: !!env.STRIPE_WEBHOOK_SECRET,
72+
resend_key: !!env.RESEND_API_KEY,
73+
stock_kv: !!env.STOCK
74+
}, 200, corsHeaders(request.headers.get("Origin") || "", "GET, OPTIONS"));
75+
}
76+
6577
// ---- stock endpoint (remaining count per edition) ----
6678
if (url.pathname === "/stock") {
6779
const sOrigin = request.headers.get("Origin") || "";
@@ -224,20 +236,31 @@ async function handleWebhook(request, env) {
224236
</div>`;
225237

226238
if (env.RESEND_API_KEY) {
227-
await fetch("https://api.resend.com/emails", {
228-
method: "POST",
229-
headers: {
230-
"Authorization": "Bearer " + env.RESEND_API_KEY,
231-
"Content-Type": "application/json"
232-
},
233-
body: JSON.stringify({
234-
from: `PlotFlow Orders <${FROM_EMAIL}>`,
235-
to: [NOTIFY_EMAIL],
236-
subject: `New order: ${meta.editions || "PlotFlow edition"}`,
237-
html: html,
238-
text: text
239-
})
240-
});
239+
// Surface email failures in the Cloudflare logs (`wrangler tail` /
240+
// dashboard) instead of letting a rejected send vanish silently.
241+
try {
242+
const mailResp = await fetch("https://api.resend.com/emails", {
243+
method: "POST",
244+
headers: {
245+
"Authorization": "Bearer " + env.RESEND_API_KEY,
246+
"Content-Type": "application/json"
247+
},
248+
body: JSON.stringify({
249+
from: `PlotFlow Orders <${FROM_EMAIL}>`,
250+
to: [NOTIFY_EMAIL],
251+
subject: `New order: ${meta.editions || "PlotFlow edition"}`,
252+
html: html,
253+
text: text
254+
})
255+
});
256+
if (!mailResp.ok) {
257+
console.error("Order email FAILED", mailResp.status, await mailResp.text(), "session:", session.id);
258+
}
259+
} catch (e) {
260+
console.error("Order email FAILED (network)", String(e), "session:", session.id);
261+
}
262+
} else {
263+
console.error("Order email SKIPPED — RESEND_API_KEY not set. session:", session.id);
241264
}
242265

243266
// Decrement remaining stock per purchased edition. metadata.skus looks

0 commit comments

Comments
 (0)