Use imported images and URL helper

Replace hardcoded asset paths with bundler-friendly imports and a URL helper. Added getFlagUrl in LanguageSelector.vue to resolve flag assets via import.meta.url and replaced string-based src attributes. In Home.vue, import landingLq and landingHq and use them for initial and high-quality hero image loading to avoid direct '/src/...' paths and ensure proper asset resolution.
This commit is contained in:
Starystars67 committed 2026-04-02 01:34:31 +01:00
1 parent c2e460b408
commit 44268d076d
2 files changed
+11 -5

No files matched your search

+5 -3
View File
@@ -14,6 +14,8 @@ import {
Rocket,
} from 'lucide-vue-next'
import { useI18n } from 'vue-i18n'
import landingLq from '@/assets/landing-lq.jpg'
import landingHq from '@/assets/landing_hq.png'
const { t } = useI18n()
const onlinePlayers = ref('...')
@@ -21,7 +23,7 @@ const onlineServers = ref('...')
const totalServers = ref('...')
const isLoading = ref(true)
const heroImageLoaded = ref(false)
const heroImageSrc = ref('/landing-lq.jpg')
const heroImageSrc = ref(landingLq)
onMounted(async () => {
try {
@@ -44,9 +46,9 @@ onMounted(async () => {
// Load high-quality hero image
const img = new Image()
img.src = '/src/assets/landing_hq.png'
img.src = landingHq
img.onload = () => {
heroImageSrc.value = '/src/assets/landing_hq.png'
heroImageSrc.value = landingHq
heroImageLoaded.value = true
}
})