Skip to content

Commit 33e9814

Browse files
authored
fix: run sparkline pulse animation only once (#1818)
1 parent 8df2667 commit 33e9814

37 files changed

+2
-98
lines changed

app/components/Package/WeeklyDownloadStats.vue

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,6 @@ const { colors } = useCssVariables(
9797
},
9898
)
9999
100-
function toggleSparklineAnimation() {
101-
settings.value.sidebar.animateSparkline = !settings.value.sidebar.animateSparkline
102-
}
103-
104-
const hasSparklineAnimation = computed(() => settings.value.sidebar.animateSparkline)
105-
106100
const isDarkMode = computed(() => resolvedMode.value === 'dark')
107101
108102
const accentColorValueById = computed<Record<string, string>>(() => {
@@ -254,8 +248,8 @@ const config = computed<VueUiSparklineConfig>(() => {
254248
line: {
255249
color: colors.value.borderHover,
256250
pulse: {
257-
show: hasSparklineAnimation.value, // the pulse will not show if prefers-reduced-motion (enforced by vue-data-ui)
258-
loop: true, // runs only once if false
251+
show: true, // the pulse will not show if prefers-reduced-motion (enforced by vue-data-ui)
252+
loop: false,
259253
radius: 1.5,
260254
color: pulseColor.value!,
261255
easing: 'ease-in-out',
@@ -333,23 +327,9 @@ const config = computed<VueUiSparklineConfig>(() => {
333327
<SkeletonInline class="h-px w-full" />
334328
</div>
335329
</div>
336-
<!-- Animation toggle placeholder -->
337-
<div class="w-full hidden motion-safe:flex flex-1 items-end justify-end">
338-
<SkeletonInline class="h-[20px] w-30" />
339-
</div>
340330
</div>
341331
</template>
342332
</ClientOnly>
343-
344-
<div v-if="hasWeeklyDownloads" class="hidden motion-safe:flex justify-end p-1">
345-
<ButtonBase size="small" @click="toggleSparklineAnimation">
346-
{{
347-
hasSparklineAnimation
348-
? $t('package.trends.pause_animation')
349-
: $t('package.trends.play_animation')
350-
}}
351-
</ButtonBase>
352-
</div>
353333
</template>
354334
<p v-else class="py-2 text-sm font-mono text-fg-subtle">
355335
{{ $t('package.trends.no_data') }}

app/composables/useSettings.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export interface AppSettings {
3838
}
3939
sidebar: {
4040
collapsed: string[]
41-
animateSparkline: boolean
4241
}
4342
chartFilter: {
4443
averageWindow: number
@@ -61,7 +60,6 @@ const DEFAULT_SETTINGS: AppSettings = {
6160
},
6261
sidebar: {
6362
collapsed: [],
64-
animateSparkline: true,
6563
},
6664
chartFilter: {
6765
averageWindow: 0,

i18n/locales/az-AZ.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,6 @@
384384
"likes": "Bəyənmələr",
385385
"contributors": "Əməkdaşlar"
386386
},
387-
"play_animation": "Animasiyanı başlat",
388-
"pause_animation": "Animasiyanı dayandır",
389387
"copy_alt": {
390388
"trend_none": "əsasən sabit",
391389
"trend_strong": "güclü",

i18n/locales/bg-BG.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,6 @@
410410
"likes": "Харесвания",
411411
"contributors": "Сътрудници"
412412
},
413-
"play_animation": "Пускане на анимация",
414-
"pause_animation": "Пауза на анимация",
415413
"data_correction": "Корекция на данни",
416414
"average_window": "Прозорец за средна стойност",
417415
"smoothing": "Изглаждане",

i18n/locales/cs-CZ.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,6 @@
389389
"likes": "Lajky",
390390
"contributors": "Přispěvatelé"
391391
},
392-
"play_animation": "Přehrát animaci",
393-
"pause_animation": "Pozastavit animaci",
394392
"data_correction": "Oprava dat",
395393
"average_window": "Okno průměru",
396394
"smoothing": "Vyhlazování",

i18n/locales/de-DE.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,6 @@
389389
"likes": "Likes",
390390
"contributors": "Mitwirkende"
391391
},
392-
"play_animation": "Animation abspielen",
393-
"pause_animation": "Animation pausieren",
394392
"data_correction": "Datenkorrektur",
395393
"average_window": "Durchschnittsfenster",
396394
"smoothing": "Glättung",

i18n/locales/en.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,6 @@
443443
"likes": "Likes",
444444
"contributors": "Contributors"
445445
},
446-
"play_animation": "Play animation",
447-
"pause_animation": "Pause animation",
448446
"data_correction": "Data correction",
449447
"average_window": "Average window",
450448
"smoothing": "Smoothing",

i18n/locales/es.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,6 @@
410410
"likes": "Me gusta",
411411
"contributors": "Colaboradores"
412412
},
413-
"play_animation": "Reproducir animación",
414-
"pause_animation": "Pausar animación",
415413
"data_correction": "Corrección de datos",
416414
"average_window": "Ventana de promedio",
417415
"smoothing": "Suavizado",

i18n/locales/fr-FR.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,6 @@
413413
"likes": "J'aime",
414414
"contributors": "Contributeurs"
415415
},
416-
"play_animation": "Lancer l'animation",
417-
"pause_animation": "Mettre l'animation en pause",
418416
"data_correction": "Correction des données",
419417
"average_window": "Plage de moyenne",
420418
"smoothing": "Lissage",

i18n/locales/hu-HU.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,6 @@
410410
"likes": "Kedvelések",
411411
"contributors": "Közreműködők"
412412
},
413-
"play_animation": "Animáció lejátszása",
414-
"pause_animation": "Animáció szüneteltetése",
415413
"data_correction": "Adatkorrekció",
416414
"average_window": "Átlagos ablak",
417415
"smoothing": "Simítás",

0 commit comments

Comments
 (0)