Move theme previews to flat preview/ directory

main
Warinyourself 3 weeks ago
parent b4eb9f4a62
commit c3b95bfe11

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

@ -1,10 +1,10 @@
import { defineComponent, computed } from 'vue'
import { useThemeStore } from '@/store/theme'
const themeImages = import.meta.glob('@/assets/images/themes/*/index.png', { eager: true, import: 'default' }) as Record<string, string>
const themeImages = import.meta.glob('@/assets/images/themes/preview/*.png', { eager: true, import: 'default' }) as Record<string, string>
function getThemeImage(name: string): string {
const key = Object.keys(themeImages).find((k) => k.includes(`/${name.toLowerCase()}/`))
const key = Object.keys(themeImages).find((k) => k.endsWith(`/${name.toLowerCase()}.png`))
return key ? (themeImages[key] ?? 'notFound') : 'notFound'
}

Loading…
Cancel
Save