Skip to content

Commit db9dd66

Browse files
committed
Fix sitemap, remove orphaned assets, add wallpaper download
- sitemap.xml: add all 6 product pages + about.html, remove stale manifesto.html - Remove dropped GM and Guntank SVGs from assets/plots/ - Add phone wallpaper download button on product pages (renders current suit + ink color to 1170x2532 PNG on Bristol background) https://claude.ai/code/session_01VhWRYXbuqapZ9YkvksroaS
1 parent 8e44b68 commit db9dd66

6 files changed

Lines changed: 71 additions & 6 deletions

File tree

assets/plots/gm.svg

Lines changed: 0 additions & 2 deletions
This file was deleted.

assets/plots/guntank.svg

Lines changed: 0 additions & 2 deletions
This file was deleted.

product.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
<button class="pd-replay" id="pdReplay" hidden>▶&#xFE0E; Watch it plot</button>
5757
</div>
5858
<div class="pd-stage-meta tiny"><span id="pdInk">マシンドロー</span><span id="pdSize"></span></div>
59+
<button class="pd-wallpaper tiny" id="pdWallpaper">↓ Download phone wallpaper</button>
5960
</div>
6061

6162
<!-- RIGHT: details + acquire -->

scripts/product.js

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,66 @@
170170

171171
return {
172172
restart: restart,
173-
setInk: function (hex) { ink = hex; }
173+
setInk: function (hex) { ink = hex; },
174+
wallpaper: function (inkHex) {
175+
var W = 1170, H = 2532;
176+
var off = document.createElement("canvas");
177+
off.width = W; off.height = H;
178+
var oc = off.getContext("2d");
179+
180+
oc.fillStyle = "#f6f3ec";
181+
oc.fillRect(0, 0, W, H);
182+
183+
var sc = Math.min(W / vb.w, H / vb.h) * 0.8;
184+
var offX = (W - vb.w * sc) / 2;
185+
var offY = (H - vb.h * sc) / 2;
186+
187+
oc.strokeStyle = inkHex;
188+
oc.lineWidth = Math.max(1.5, 2);
189+
oc.lineJoin = "round";
190+
oc.lineCap = "round";
191+
192+
var step = Math.max(0.5, 2 / sc);
193+
var liftSq = (step * 3) * (step * 3);
194+
var prev = null;
195+
oc.beginPath();
196+
for (var L = 0; L < len; L += step) {
197+
var p = path.getPointAtLength(L);
198+
var mx = offX + (p.x - vb.x) * sc;
199+
var my = offY + (p.y - vb.y) * sc;
200+
if (!prev) { oc.moveTo(mx, my); }
201+
else {
202+
var dx = p.x - prev.x, dy = p.y - prev.y;
203+
if (dx * dx + dy * dy > liftSq) oc.moveTo(mx, my);
204+
else oc.lineTo(mx, my);
205+
}
206+
prev = p;
207+
}
208+
oc.stroke();
209+
210+
oc.font = "bold 28px 'Archivo', sans-serif";
211+
oc.fillStyle = "rgba(21,22,15,0.25)";
212+
oc.textAlign = "center";
213+
oc.fillText("PLOTFLOW*", W / 2, H - 60);
214+
215+
return off.toDataURL("image/png");
216+
}
174217
};
175218
}
219+
220+
// ---- wallpaper download ----
221+
var dlBtn = $("pdWallpaper");
222+
if (dlBtn) {
223+
dlBtn.addEventListener("click", function () {
224+
dlBtn.textContent = "Rendering…";
225+
setTimeout(function () {
226+
var dataUrl = plot.wallpaper(INKS[color].hex);
227+
var a = document.createElement("a");
228+
a.href = dataUrl;
229+
a.download = key + "-" + color + "-wallpaper.png";
230+
a.click();
231+
dlBtn.textContent = "↓ Download phone wallpaper";
232+
}, 50);
233+
});
234+
}
176235
})();

sitemap.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
33
<url><loc>https://plotflow.io/</loc><priority>1.0</priority></url>
4+
<url><loc>https://plotflow.io/product.html?id=zaku</loc><priority>0.9</priority></url>
5+
<url><loc>https://plotflow.io/product.html?id=guncannon</loc><priority>0.9</priority></url>
6+
<url><loc>https://plotflow.io/product.html?id=bigzam</loc><priority>0.9</priority></url>
7+
<url><loc>https://plotflow.io/product.html?id=dom</loc><priority>0.9</priority></url>
8+
<url><loc>https://plotflow.io/product.html?id=zgok</loc><priority>0.9</priority></url>
9+
<url><loc>https://plotflow.io/product.html?id=gp02</loc><priority>0.9</priority></url>
410
<url><loc>https://plotflow.io/commissions.html</loc><priority>0.8</priority></url>
5-
<url><loc>https://plotflow.io/manifesto.html</loc><priority>0.6</priority></url>
11+
<url><loc>https://plotflow.io/about.html</loc><priority>0.6</priority></url>
612
<url><loc>https://plotflow.io/contact.html</loc><priority>0.6</priority></url>
713
<url><loc>https://plotflow.io/faq.html</loc><priority>0.6</priority></url>
814
<url><loc>https://plotflow.io/shipping.html</loc><priority>0.5</priority></url>

styles/styles.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,9 @@ footer .grain{opacity:.3}
232232
color:var(--ink);background:var(--bristol);border:1px solid var(--ink);padding:9px 16px}
233233
.pd-replay:hover{background:var(--ink);color:var(--bristol)}
234234
.pd-stage-meta{display:flex;justify-content:space-between;margin-top:10px;color:var(--dim)}
235+
.pd-wallpaper{display:block;width:100%;margin-top:8px;padding:10px;color:var(--dim);border:1px solid var(--line);
236+
background:transparent;font-weight:700;font-size:8.5px;letter-spacing:.14em;text-transform:uppercase;text-align:center;transition:border-color .2s,color .2s}
237+
.pd-wallpaper:hover{border-color:var(--mute);color:var(--white)}
235238

236239
.pd-head{border-bottom:1px solid var(--line);padding-bottom:18px;margin-bottom:18px}
237240
.pd-code{color:var(--red);letter-spacing:.18em;margin-bottom:8px}

0 commit comments

Comments
 (0)