|
1 | 1 | <script> |
2 | | - import { asset } from '$app/paths'; |
3 | 2 | import BottomNavigationBar from '$lib/components/BottomNavigationBar.svelte'; |
4 | 3 | import Navbar from '$lib/components/Navbar.svelte'; |
5 | 4 | import config from '$lib/data/config'; |
|
9 | 8 | import { compareVersions } from '$lib/scripts/stringUtils'; |
10 | 9 |
|
11 | 10 | const imageFolder = |
12 | | - compareVersions(config.programVersion, '12.0') < 0 ? 'illustrations' : 'plans'; |
| 11 | + compareVersions(config.programVersion, '12.0') < 0 |
| 12 | + ? import.meta.glob('./*', { |
| 13 | + eager: true, |
| 14 | + import: 'default', |
| 15 | + base: '/src/gen-assets/illustrations' |
| 16 | + }) |
| 17 | + : import.meta.glob(['./*', '!./*.json'], { |
| 18 | + eager: true, |
| 19 | + import: 'default', |
| 20 | + base: '/src/gen-assets/plans' |
| 21 | + }); |
13 | 22 |
|
14 | 23 | let selectedTab = $state('available'); |
15 | 24 | let availablePlans = $state([]); |
|
116 | 125 | <div class="plan-image-block"> |
117 | 126 | <img |
118 | 127 | class="plan-image" |
119 | | - src={asset(`/${imageFolder}/${plan.image.file}`)} |
| 128 | + src={imageFolder[`./${plan.image.file}`]} |
120 | 129 | alt={plan.image.file} |
121 | 130 | width={plan.image.width} |
122 | 131 | height={plan.image.height} |
|
148 | 157 | <div class="plan-image-block"> |
149 | 158 | <img |
150 | 159 | class="plan-image" |
151 | | - src={asset(`/${imageFolder}/${plan.image.file}`)} |
| 160 | + src={imageFolder[`./${plan.image.file}`]} |
152 | 161 | alt={plan.image.file} |
153 | 162 | width={plan.image.width} |
154 | 163 | height={plan.image.height} |
|
180 | 189 | <div class="plan-image-block"> |
181 | 190 | <img |
182 | 191 | class="plan-image" |
183 | | - src={asset(`/${imageFolder}/${plan.image.file}`)} |
| 192 | + src={imageFolder[`./${plan.image.file}`]} |
184 | 193 | alt={plan.image.file} |
185 | 194 | width={plan.image.width} |
186 | 195 | height={plan.image.height} |
|
0 commit comments