Skip to content

Commit 4d2d56e

Browse files
committed
update
1 parent fdda980 commit 4d2d56e

2 files changed

Lines changed: 39 additions & 19 deletions

File tree

packages/app/app/components/BadgeGenerator.vue

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,20 @@ function copyBadgeCode() {
2121
</script>
2222

2323
<template>
24-
<div class="flex flex-col gap-3 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg">
25-
<h3 class="font-semibold">Add a badge to your README</h3>
24+
<div
25+
class="flex items-center gap-3 p-3 bg-gray-50 dark:bg-gray-800 rounded-lg"
26+
>
27+
<span class="text-xs font-medium">Add a badge to your README</span>
2628

27-
<div class="flex items-center gap-2">
28-
<img :src="badgeUrl" :alt="`${repo} badge`" height="20" class="h-5" />
29-
<UButton
30-
@click="copyBadgeCode"
31-
size="sm"
32-
color="primary"
33-
:icon="copied ? 'i-ph-check-bold' : 'i-ph-copy'"
34-
>
35-
{{ copied ? "Copied!" : "Copy Markdown" }}
36-
</UButton>
37-
</div>
29+
<img :src="badgeUrl" :alt="`${repo} badge`" height="16" class="h-4" />
3830

39-
<div class="text-xs text-gray-500">
40-
Add this badge to your README to help promote pkg.pr.new
41-
</div>
31+
<UButton
32+
@click="copyBadgeCode"
33+
size="xs"
34+
color="primary"
35+
:icon="copied ? 'i-ph-check-bold' : 'i-ph-copy'"
36+
variant="ghost"
37+
class="ml-auto"
38+
/>
4239
</div>
4340
</template>

packages/app/server/routes/badge/[owner]/[repo].get.ts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,32 @@ export default defineEventHandler(async (event) => {
4141
});
4242

4343
function getPkgPrNewLogoBase64(): string {
44-
const logo = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 216 216">
45-
<path fill="#0ea5e9" d="M193.76 49.65l-88-48.18a12 12 0 0 0-11.52 0l-88 48.18a12 12 0 0 0-6.24 10.52v95.64a12 12 0 0 0 6.24 10.52l88 48.18a11.95 11.95 0 0 0 11.52 0l88-48.18a12 12 0 0 0 6.24-10.52V60.17a12 12 0 0 0-6.24-10.52"/>
46-
</svg>`;
44+
const logo = `<svg xmlns="http://www.w3.org/2000/svg" width="71" height="73" viewBox="0 0 71 73" fill="none">
45+
<g filter="url(#filter0_di_18_22)">
46+
<path d="M29.6539 2.52761C26.8827 3.91317 24.6248 5.06781 24.6248 5.10629C24.6248 5.14478 31.2447 8.57019 39.3399 12.7269C47.448 16.8707 54.1706 20.3731 54.2988 20.4886C54.5169 20.681 54.5298 21.1942 54.5298 28.9046C54.5298 36.6149 54.5169 37.1281 54.2988 37.3847C54.1706 37.5386 52.7208 38.3597 51.0915 39.2193C49.4494 40.0788 47.9612 40.7716 47.7816 40.7716C47.5891 40.7716 47.3839 40.6562 47.2684 40.4894C47.1016 40.2328 47.076 39.1166 47.076 32.2402L47.0632 24.286L16.9914 8.80112C5.66316 14.446 4.62399 15.0105 4.35458 15.3825L4.03385 15.8187C3.98253 41.7723 3.99536 49.4314 4.03385 49.5981C4.07233 49.7521 4.25194 50.06 4.45721 50.2781C4.7138 50.586 8.54974 52.5617 19.7882 58.1681C31.0266 63.7873 34.8754 65.6604 35.2089 65.6604C35.5425 65.6604 38.1725 64.4159 45.3184 60.8879C50.6169 58.2579 57.5062 54.8453 60.6108 53.2801C65.9863 50.586 66.2685 50.432 66.538 49.9445L66.833 49.4314C66.833 17.1273 66.8202 16.0496 66.6021 15.6263C66.3968 15.2029 65.4988 14.7282 51.1813 7.58234C36.928 0.474933 35.9402 -0.0125789 35.3372 0.000250395C34.7727 0.0130796 34.0928 0.320982 29.6539 2.52761Z" fill="url(#paint0_linear_18_22)"/>
47+
</g>
48+
<defs>
49+
<filter id="filter0_di_18_22" x="0.460111" y="1.52588e-05" width="69.9128" height="72.7401" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
50+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
51+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
52+
<feOffset dy="3.53989"/>
53+
<feGaussianBlur stdDeviation="1.76994"/>
54+
<feComposite in2="hardAlpha" operator="out"/>
55+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
56+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_18_22"/>
57+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_18_22" result="shape"/>
58+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
59+
<feOffset dy="1.76994"/>
60+
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
61+
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.95 0"/>
62+
<feBlend mode="normal" in2="shape" result="effect2_innerShadow_18_22"/>
63+
</filter>
64+
<linearGradient id="paint0_linear_18_22" x1="35.4165" y1="1.52588e-05" x2="35.4165" y2="66.8238" gradientUnits="userSpaceOnUse">
65+
<stop stop-color="white"/>
66+
<stop offset="1" stop-color="#999999"/>
67+
</linearGradient>
68+
</defs>
69+
</svg>`;
4770

4871
return Buffer.from(logo).toString("base64");
4972
}

0 commit comments

Comments
 (0)