opencrush 0.3.22 → 0.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +15 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -245663,11 +245663,11 @@ function buildTextOverlay(data, overlayW) {
|
|
|
245663
245663
|
const blockH = lines * 44 * S2;
|
|
245664
245664
|
let y2 = Math.max(70 * S2, Math.round((H2 - blockH) / 2));
|
|
245665
245665
|
const nameY = y2;
|
|
245666
|
-
y2 +=
|
|
245666
|
+
y2 += 84 * S2;
|
|
245667
245667
|
const metaY = y2;
|
|
245668
|
-
if (meta) y2 +=
|
|
245668
|
+
if (meta) y2 += 48 * S2;
|
|
245669
245669
|
const jobY = y2;
|
|
245670
|
-
if (data.job) y2 +=
|
|
245670
|
+
if (data.job) y2 += 44 * S2;
|
|
245671
245671
|
y2 += 20 * S2;
|
|
245672
245672
|
const tagStartY = y2;
|
|
245673
245673
|
let inlineTags = "";
|
|
@@ -245676,7 +245676,7 @@ function buildTextOverlay(data, overlayW) {
|
|
|
245676
245676
|
const rowH = 38 * S2;
|
|
245677
245677
|
let currentRow = 1;
|
|
245678
245678
|
const maxRows = 2;
|
|
245679
|
-
const charW =
|
|
245679
|
+
const charW = 9.5 * S2;
|
|
245680
245680
|
const padW = 24 * S2;
|
|
245681
245681
|
for (const tag of data.tags) {
|
|
245682
245682
|
const maxChars = Math.floor((availW - padW) / charW);
|
|
@@ -245689,8 +245689,8 @@ function buildTextOverlay(data, overlayW) {
|
|
|
245689
245689
|
rowY += rowH;
|
|
245690
245690
|
}
|
|
245691
245691
|
inlineTags += `
|
|
245692
|
-
<rect x="${offsetX}" y="${rowY -
|
|
245693
|
-
<text x="${offsetX + 12 * S2}" y="${rowY + 4 * S2}" font-family="system-ui, -apple-system, sans-serif" font-size="${
|
|
245692
|
+
<rect x="${offsetX}" y="${rowY - 20 * S2}" width="${w2}" height="${36 * S2}" rx="${18 * S2}" fill="rgba(255,255,255,0.10)" />
|
|
245693
|
+
<text x="${offsetX + 12 * S2}" y="${rowY + 4 * S2}" font-family="system-ui, -apple-system, sans-serif" font-size="${19 * S2}" fill="rgba(255,255,255,0.8)">${esc(label)}</text>
|
|
245694
245694
|
`;
|
|
245695
245695
|
offsetX += w2 + 10 * S2;
|
|
245696
245696
|
}
|
|
@@ -245704,23 +245704,23 @@ function buildTextOverlay(data, overlayW) {
|
|
|
245704
245704
|
<rect width="${overlayW}" height="${H2}" fill="rgba(0,0,0,0.55)" />
|
|
245705
245705
|
|
|
245706
245706
|
<!-- Name -->
|
|
245707
|
-
<text x="${px}" y="${nameY}" font-family="system-ui, -apple-system, sans-serif" font-size="${
|
|
245707
|
+
<text x="${px}" y="${nameY}" font-family="system-ui, -apple-system, sans-serif" font-size="${72 * S2}" font-weight="bold" fill="white">${esc(data.name)}</text>
|
|
245708
245708
|
|
|
245709
245709
|
<!-- Meta -->
|
|
245710
|
-
${meta ? `<text x="${px}" y="${metaY}" font-family="system-ui, -apple-system, sans-serif" font-size="${
|
|
245710
|
+
${meta ? `<text x="${px}" y="${metaY}" font-family="system-ui, -apple-system, sans-serif" font-size="${26 * S2}" fill="rgba(255,255,255,0.65)">${esc(meta)}</text>` : ""}
|
|
245711
245711
|
|
|
245712
245712
|
<!-- Job -->
|
|
245713
|
-
${data.job ? `<text x="${px}" y="${jobY}" font-family="system-ui, -apple-system, sans-serif" font-size="${
|
|
245713
|
+
${data.job ? `<text x="${px}" y="${jobY}" font-family="system-ui, -apple-system, sans-serif" font-size="${22 * S2}" fill="rgba(255,255,255,0.45)">${esc(jobText)}</text>` : ""}
|
|
245714
245714
|
|
|
245715
245715
|
<!-- Tags -->
|
|
245716
245716
|
${inlineTags}
|
|
245717
245717
|
|
|
245718
245718
|
<!-- Vibe -->
|
|
245719
|
-
${data.vibe ? `<text x="${px}" y="${vibeY}" font-family="system-ui, -apple-system, sans-serif" font-size="${
|
|
245719
|
+
${data.vibe ? `<text x="${px}" y="${vibeY}" font-family="system-ui, -apple-system, sans-serif" font-size="${22 * S2}" fill="rgba(255,255,255,0.50)" font-style="italic">${esc(vibeText)}</text>` : ""}
|
|
245720
245720
|
|
|
245721
245721
|
<!-- Branding -->
|
|
245722
|
-
<text x="${px}" y="${H2 - 44 * S2}" font-family="system-ui, -apple-system, sans-serif" font-size="${
|
|
245723
|
-
<text x="${overlayW - 60 * S2}" y="${H2 - 44 * S2}" font-family="system-ui, -apple-system, sans-serif" font-size="${
|
|
245722
|
+
<text x="${px}" y="${H2 - 44 * S2}" font-family="system-ui, -apple-system, sans-serif" font-size="${20 * S2}" font-weight="bold" fill="#ff69b4">Opencrush</text>
|
|
245723
|
+
<text x="${overlayW - 60 * S2}" y="${H2 - 44 * S2}" font-family="system-ui, -apple-system, sans-serif" font-size="${14 * S2}" fill="rgba(255,255,255,0.4)" text-anchor="end">github.com/heloraai/Opencrush</text>
|
|
245724
245724
|
</svg>`;
|
|
245725
245725
|
}
|
|
245726
245726
|
async function generateCard(characterName) {
|
|
@@ -245741,8 +245741,8 @@ async function generateCard(characterName) {
|
|
|
245741
245741
|
}
|
|
245742
245742
|
}
|
|
245743
245743
|
if (!refImagePath) return generateFallbackCard(charDir, characterName, data);
|
|
245744
|
-
const portraitW = Math.round(H2 * 4 / 5);
|
|
245745
|
-
const overlayW = W2 - portraitW + Math.round(
|
|
245744
|
+
const portraitW = Math.round(H2 * 4 / 5 * 0.9);
|
|
245745
|
+
const overlayW = W2 - portraitW + Math.round(20 * SCALE);
|
|
245746
245746
|
const bgBlur = await sharp(refImagePath).resize(W2, H2, { fit: "cover", position: "center" }).blur(50).modulate({ brightness: 0.3, saturation: 0.5 }).png().toBuffer();
|
|
245747
245747
|
const portrait = await sharp(refImagePath).resize(portraitW, H2, { fit: "cover", position: "top" }).png().toBuffer();
|
|
245748
245748
|
const fadeMask = Buffer.from(
|
|
@@ -245750,7 +245750,7 @@ async function generateCard(characterName) {
|
|
|
245750
245750
|
<defs>
|
|
245751
245751
|
<linearGradient id="fade" x1="0" y1="0" x2="1" y2="0">
|
|
245752
245752
|
<stop offset="0%" stop-color="white" />
|
|
245753
|
-
<stop offset="
|
|
245753
|
+
<stop offset="55%" stop-color="white" />
|
|
245754
245754
|
<stop offset="100%" stop-color="black" />
|
|
245755
245755
|
</linearGradient>
|
|
245756
245756
|
</defs>
|