Skip to content

Commit 3319dfc

Browse files
committed
feat: opt-in repeated pulse animation on download graph
1 parent 3fc9ebd commit 3319dfc

5 files changed

Lines changed: 22 additions & 1 deletion

File tree

app/components/Package/WeeklyDownloadStats.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ const dataset = computed<VueUiSparklineDatasetItem[]>(() =>
208208
209209
const lastDatapoint = computed(() => dataset.value.at(-1)?.period ?? '')
210210
211-
const isLoop = shallowRef(false)
211+
const isLoop = shallowRef(settings.value.enableGraphPulseLooping)
212212
const showPulse = shallowRef(true)
213213
const keyboardShortcuts = useKeyboardShortcuts()
214214

app/composables/useSettings.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export interface AppSettings {
2323
preferredBackgroundTheme: BackgroundThemeId | null
2424
/** Hide platform-specific packages (e.g., @scope/pkg-linux-x64) from search results */
2525
hidePlatformPackages: boolean
26+
/** Enable weekly download graph pulse looping animation */
27+
enableGraphPulseLooping: boolean
2628
/** User-selected locale */
2729
selectedLocale: LocaleObject['code'] | null
2830
/** Search provider for package search */
@@ -52,6 +54,7 @@ const DEFAULT_SETTINGS: AppSettings = {
5254
includeTypesInInstall: true,
5355
accentColorId: null,
5456
hidePlatformPackages: true,
57+
enableGraphPulseLooping: false,
5558
selectedLocale: null,
5659
preferredBackgroundTheme: null,
5760
searchProvider: import.meta.test ? 'npm' : 'algolia',

app/pages/settings.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,16 @@ const setLocale: typeof setNuxti18nLocale = newLocale => {
142142
:description="$t('settings.hide_platform_packages_description')"
143143
v-model="settings.hidePlatformPackages"
144144
/>
145+
146+
<!-- Divider -->
147+
<div class="border-t border-border my-4" />
148+
149+
<!-- Enable weekly download graph pulse looping animation -->
150+
<SettingsToggle
151+
:label="$t('settings.enable_graph_pulse_loop')"
152+
:description="$t('settings.enable_graph_pulse_loop_description')"
153+
v-model="settings.enableGraphPulseLooping"
154+
/>
145155
</div>
146156
</section>
147157

i18n/locales/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@
138138
"include_types_description": "Add {'@'}types package to install commands for untyped packages",
139139
"hide_platform_packages": "Hide platform-specific packages in search",
140140
"hide_platform_packages_description": "Hide native binary packages like {'@'}esbuild/linux-x64 from results",
141+
"enable_graph_pulse_loop": "Enable looping of pulse effect on mini graph",
142+
"enable_graph_pulse_loop_description": "Activate the reapeated animation of the pulse effect on the weekly download graph",
141143
"theme": "Theme",
142144
"theme_light": "Light",
143145
"theme_dark": "Dark",

i18n/schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,12 @@
418418
"hide_platform_packages_description": {
419419
"type": "string"
420420
},
421+
"enable_graph_pulse_loop": {
422+
"type": "string"
423+
},
424+
"enable_graph_pulse_loop_description": {
425+
"type": "string"
426+
},
421427
"theme": {
422428
"type": "string"
423429
},

0 commit comments

Comments
 (0)