various updates and changes

This commit is contained in:
2026-06-04 22:42:19 +01:00
parent 0a3bf7779c
commit 15027c5231
11 changed files with 137 additions and 8 deletions
+22
View File
@@ -0,0 +1,22 @@
<script lang="ts" module>
const imgs = import.meta.glob(
"./imgs/*.{avif,AVIF,heif,HEIF,jpeg,JPEG,jpg,JPG,png,PNG,tiff,TIFF,webp,WEBP,svg,SVG,gif,GIF}",
{
eager: true,
import: "default",
query: {
enhanced: true,
},
},
);
let trimmedImgs: Record<string, unknown> = {};
Object.entries(imgs).forEach(([key, value]) => {
let trimmedString = key.replace("./imgs/", "");
let trimmedString2 = trimmedString.replace(/(.*)\.[^.]+$/, "$1");
trimmedImgs[trimmedString2] = value;
});
export function snackImage(img: string) {
return trimmedImgs[img];
}
</script>