feat: 更新随机图片选择逻辑,支持随机选择2或3
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 2m52s
/ surge (push) Successful in 2m54s
/ playwright (push) Successful in 1m24s
/ lint-build-and-check (push) Successful in 5m27s

This commit is contained in:
严浩
2025-04-20 22:11:51 +08:00
parent 5f9eeddc77
commit aacca31384
2 changed files with 3 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@ -8,12 +8,12 @@ function getImageUrl(name: string) {
const img_modules = import.meta.glob<{ default: string }>('./imgs/*.png', { eager: true });
function getRandom1or2() {
return Math.random() < 0.5 ? '1' : '2';
function getRandom2or3() {
return Math.random() < 0.5 ? '2' : '3';
}
function getRandomImage() {
return getImageUrl(getRandom1or2());
return getImageUrl(getRandom2or3());
}
</script>