Skip to content

Commit 602ee0d

Browse files
committed
fix: tweaks download graph
1 parent aee6c5a commit 602ee0d

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

app/components/OgImage/ShareCard.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,13 @@ const sparklinePoints = computed(() => {
153153
const max = Math.max(...sparklineValues)
154154
const min = Math.min(...sparklineValues)
155155
const range = max - min || 1
156+
// Add 25% buffer below min so the lowest point never touches the bottom
157+
const floor = Math.max(0, min - range * 0.25)
158+
const adjustedRange = max - floor || 1
156159
return sparklineValues
157160
.map((v, i) => {
158161
const x = P + (i / (sparklineValues.length - 1)) * (SPARK_W - P * 2)
159-
const y = SPARK_H - P - ((v - min) / range) * (SPARK_H - P * 2)
162+
const y = SPARK_H - P - ((v - floor) / adjustedRange) * (SPARK_H - P * 2)
160163
return `${x.toFixed(1)},${y.toFixed(1)}`
161164
})
162165
.join(' ')

app/components/Package/ShareModal.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ function handleCopyLink() {
8282
</script>
8383

8484
<template>
85-
<Modal :modal-title="`share ${packageName}`" id="share-modal" class="sm:max-w-3xl" @close="showAlt = false">
85+
<Modal
86+
:modal-title="`share ${packageName}`"
87+
id="share-modal"
88+
class="sm:max-w-3xl"
89+
@close="showAlt = false"
90+
>
8691
<!--
8792
aspect-ratio matches card output (1280×520 = 2.46:1).
8893
The PNG is rendered at full 1280px, displayed inside a ~700px container —
@@ -144,7 +149,7 @@ function handleCopyLink() {
144149
strategy="fixed"
145150
>
146151
<ButtonBase
147-
:classicon="altCopied ? 'i-lucide:check text-green-500' : 'i-lucide:accessibility'"
152+
:classicon="altCopied ? 'i-lucide:check text-green-500' : 'i-lucide:copy'"
148153
:class="altCopied ? 'text-green-500' : ''"
149154
@click="copyAlt(altText)"
150155
>

0 commit comments

Comments
 (0)