@@ -16,10 +16,10 @@ function getCustomSvgString(): string {
1616 const el = customLogoRef .value ?.$el as SVGElement | undefined
1717 if (! el ) return ' '
1818 const clone = el .cloneNode (true ) as SVGElement
19- clone .querySelectorAll (' [fill="currentColor"]' ).forEach (( path ) => {
19+ clone .querySelectorAll (' [fill="currentColor"]' ).forEach (path => {
2020 ;(path as SVGElement ).setAttribute (' fill' , customBgDark .value ? ' #fafafa' : ' #0a0a0a' )
2121 })
22- clone .querySelectorAll (' [fill="var(--accent)"]' ).forEach (( path ) => {
22+ clone .querySelectorAll (' [fill="var(--accent)"]' ).forEach (path => {
2323 const style = getComputedStyle (path as SVGElement )
2424 ;(path as SVGElement ).setAttribute (' fill' , style .fill || activeAccentColor .value )
2525 })
@@ -69,12 +69,11 @@ async function downloadCustomPng() {
6969 ctx .scale (scale , scale )
7070 ctx .drawImage (img , 0 , 0 , 602 , 170 )
7171
72- canvas .toBlob (( pngBlob ) => {
72+ canvas .toBlob (pngBlob => {
7373 if (pngBlob ) downloadBlob (pngBlob , ` npmx-logo-${activeAccentId .value }.png ` )
7474 URL .revokeObjectURL (url )
7575 }, ' image/png' )
76- }
77- finally {
76+ } finally {
7877 pngLoading .value = false
7978 }
8079}
@@ -104,11 +103,15 @@ async function downloadCustomPng() {
104103 </div >
105104
106105 <!-- Controls -->
107- <div class =" border-t border-border p-4 sm:p-6 flex flex-col sm:flex-row sm:items-center gap-4" >
106+ <div
107+ class =" border-t border-border p-4 sm:p-6 flex flex-col sm:flex-row sm:items-center gap-4"
108+ >
108109 <!-- Accent color picker -->
109110 <fieldset class =" flex items-center gap-3 flex-1 border-none p-0 m-0" >
110111 <legend class =" sr-only" >{{ $t('brand.customize.accent_label') }}</legend >
111- <span class =" text-xs font-mono text-fg-muted shrink-0" >{{ $t('brand.customize.accent_label') }}</span >
112+ <span class =" text-xs font-mono text-fg-muted shrink-0" >{{
113+ $t('brand.customize.accent_label')
114+ }}</span >
112115 <div class =" flex items-center gap-1.5" role =" radiogroup" >
113116 <button
114117 v-for =" color in accentColors"
@@ -118,7 +121,11 @@ async function downloadCustomPng() {
118121 :aria-checked =" activeAccentId === color.id"
119122 :aria-label =" color.label"
120123 class =" w-6 h-6 rounded-full border-2 cursor-pointer transition-all duration-150 focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-bg motion-reduce:transition-none"
121- :class =" activeAccentId === color.id ? 'border-fg scale-110' : 'border-transparent hover:border-border-hover'"
124+ :class ="
125+ activeAccentId === color.id
126+ ? 'border-fg scale-110'
127+ : 'border-transparent hover:border-border-hover'
128+ "
122129 :style =" { backgroundColor: color.value }"
123130 @click =" customAccent = color.id"
124131 />
@@ -128,14 +135,19 @@ async function downloadCustomPng() {
128135 <!-- Background toggle -->
129136 <div class =" flex items-center gap-3" >
130137 <span class =" text-xs font-mono text-fg-muted" >{{ $t('brand.customize.bg_label') }}</span >
131- <div class =" flex items-center border border-border rounded-md overflow-hidden" role =" radiogroup" >
138+ <div
139+ class =" flex items-center border border-border rounded-md overflow-hidden"
140+ role =" radiogroup"
141+ >
132142 <button
133143 type =" button"
134144 role =" radio"
135145 :aria-checked =" customBgDark"
136146 :aria-label =" $t('brand.logos.on_dark')"
137147 class =" px-2.5 py-1 text-xs font-mono cursor-pointer border-none transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent motion-reduce:transition-none"
138- :class =" customBgDark ? 'bg-bg-muted text-fg' : 'bg-transparent text-fg-muted hover:text-fg'"
148+ :class ="
149+ customBgDark ? 'bg-bg-muted text-fg' : 'bg-transparent text-fg-muted hover:text-fg'
150+ "
139151 @click =" customBgDark = true"
140152 >
141153 {{ $t('brand.logos.on_dark') }}
@@ -146,7 +158,9 @@ async function downloadCustomPng() {
146158 :aria-checked =" !customBgDark"
147159 :aria-label =" $t('brand.logos.on_light')"
148160 class =" px-2.5 py-1 text-xs font-mono cursor-pointer border-none border-is border-is-border transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent motion-reduce:transition-none"
149- :class =" !customBgDark ? 'bg-bg-muted text-fg' : 'bg-transparent text-fg-muted hover:text-fg'"
161+ :class ="
162+ !customBgDark ? 'bg-bg-muted text-fg' : 'bg-transparent text-fg-muted hover:text-fg'
163+ "
150164 @click =" customBgDark = false"
151165 >
152166 {{ $t('brand.logos.on_light') }}
0 commit comments