feat(images): default frontend assets to image service
This commit is contained in:
@@ -713,17 +713,17 @@ onBeforeUnmount(() => {
|
||||
|
||||
.legacy-bg0 {
|
||||
background-color: #302016;
|
||||
background-image: url('/image/game/back_walnut.jpg');
|
||||
background-image: var(--sammo-texture-walnut, url('https://sam-image.hided.net/game/back_walnut.jpg'));
|
||||
}
|
||||
|
||||
.legacy-bg1 {
|
||||
background-color: #14241b;
|
||||
background-image: url('/image/game/back_green.jpg');
|
||||
background-image: var(--sammo-texture-green, url('https://sam-image.hided.net/game/back_green.jpg'));
|
||||
}
|
||||
|
||||
.legacy-bg2 {
|
||||
background-color: #172a52;
|
||||
background-image: url('/image/game/back_blue.jpg');
|
||||
background-image: var(--sammo-texture-blue, url('https://sam-image.hided.net/game/back_blue.jpg'));
|
||||
}
|
||||
|
||||
#account-table caption {
|
||||
|
||||
@@ -9,6 +9,7 @@ import { trpc } from '../utils/trpc';
|
||||
import { createGameTrpc } from '../utils/gameTrpc';
|
||||
import type { GameRouter } from '../utils/gameTrpc';
|
||||
import { resolveServerSeasonStatus } from '../utils/serverSeasonStatus';
|
||||
import { configuredSharedIconPublicUrl, configuredUserIconPublicUrl } from '../utils/imageAssets';
|
||||
|
||||
type GatewayRouterOutput = inferRouterOutputs<AppRouter>;
|
||||
type GameRouterOutput = inferRouterOutputs<GameRouter>;
|
||||
@@ -40,7 +41,8 @@ const canAccessAdmin = computed(
|
||||
) ?? false
|
||||
);
|
||||
const needsKakaoVerification = computed(() => me.value !== null && !me.value.kakaoVerified);
|
||||
const userIconBaseUrl = import.meta.env.VITE_GATEWAY_USER_ICON_BASE_URL ?? '/gateway/api/user-icons';
|
||||
const userIconBaseUrl = configuredUserIconPublicUrl();
|
||||
const sharedIconBaseUrl = configuredSharedIconPublicUrl();
|
||||
|
||||
const formatGraceEndsAt = (value: string | null | undefined): string =>
|
||||
value ? new Date(value).toLocaleString('ko-KR') : '';
|
||||
@@ -57,8 +59,8 @@ const encodeLegacyIconPath = (value: string): string =>
|
||||
const resolveGeneralPicture = (general: LobbyGeneral): string => {
|
||||
const picture = general.picture?.trim() || 'default.jpg';
|
||||
return general.imageServer
|
||||
? `${userIconBaseUrl.replace(/\/$/, '')}/${encodeURIComponent(picture)}`
|
||||
: `/image/icons/${encodeLegacyIconPath(picture)}`;
|
||||
? `${userIconBaseUrl.replace(/\/$/, '')}/${encodeLegacyIconPath(picture)}`
|
||||
: `${sharedIconBaseUrl}/${encodeLegacyIconPath(picture)}`;
|
||||
};
|
||||
const handleGeneralPictureError = (event: Event): void => {
|
||||
const image = event.currentTarget as HTMLImageElement;
|
||||
@@ -66,7 +68,7 @@ const handleGeneralPictureError = (event: Event): void => {
|
||||
return;
|
||||
}
|
||||
image.dataset.generalIconFallbackSource = image.currentSrc;
|
||||
image.src = '/image/icons/default.jpg';
|
||||
image.src = `${sharedIconBaseUrl}/default.jpg`;
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
|
||||
Reference in New Issue
Block a user