Merge remote-tracking branch 'origin/main' into feat/ref-nation-card-20260813
This commit is contained in:
@@ -423,14 +423,16 @@ watch(
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
@media (max-width: 939px) {
|
||||
.recruitment-command-form {
|
||||
width: 500px;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
overflow-x: clip;
|
||||
}
|
||||
.recruitment-list-front {
|
||||
position: sticky;
|
||||
z-index: 5;
|
||||
top: 0;
|
||||
top: 44px;
|
||||
background: #1d1d1d;
|
||||
}
|
||||
.recruitment-status {
|
||||
@@ -438,7 +440,7 @@ watch(
|
||||
}
|
||||
.mobile-selected-panel {
|
||||
display: grid;
|
||||
grid-template-columns: 64px 76px 270px 90px;
|
||||
grid-template-columns: 64px minmax(58px, 76px) minmax(0, 1fr) minmax(64px, 90px);
|
||||
min-height: 64px;
|
||||
align-items: stretch;
|
||||
}
|
||||
@@ -458,10 +460,11 @@ watch(
|
||||
text-align: right;
|
||||
}
|
||||
.crew-grid {
|
||||
grid-template:
|
||||
'image name attack defence speed info' 32px
|
||||
'image name avoid cost rice info' 32px /
|
||||
64px 76px 30px 30px 30px 270px;
|
||||
grid-template-areas:
|
||||
'image name attack defence speed info'
|
||||
'image name avoid cost rice info';
|
||||
grid-template-columns: 64px minmax(58px, 76px) repeat(3, minmax(26px, 30px)) minmax(0, 1fr);
|
||||
grid-template-rows: 32px 32px;
|
||||
}
|
||||
.crew-grid .crew-image {
|
||||
grid-area: image;
|
||||
@@ -518,7 +521,27 @@ watch(
|
||||
}
|
||||
.crew-info {
|
||||
overflow: hidden;
|
||||
overflow-wrap: anywhere;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 440px) {
|
||||
.mobile-selected-panel {
|
||||
grid-template-columns: 64px minmax(58px, 76px) minmax(0, 1fr) 72px;
|
||||
min-height: 86px;
|
||||
}
|
||||
.mobile-selected-panel .amount-panel label {
|
||||
grid-template-columns: auto minmax(34px, 1fr) auto;
|
||||
}
|
||||
.mobile-selected-panel output {
|
||||
grid-column: 1 / -1;
|
||||
min-height: 22px;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
.mobile-selected-panel .quick-buttons button,
|
||||
.mobile-selected-panel .submit-recruit {
|
||||
min-height: 32px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, shallowRef, watch } from 'vue';
|
||||
import { computed, nextTick, onBeforeUnmount, onMounted, ref, shallowRef, watch } from 'vue';
|
||||
import CommandArgumentForm from '../main/CommandArgumentForm.vue';
|
||||
import CommandSelectForm from '../main/CommandSelectForm.vue';
|
||||
import { commandArgumentPresentation } from './commandArgumentPresentation';
|
||||
@@ -70,6 +70,7 @@ const commandArgsValid = ref(false);
|
||||
const expanded = ref(false);
|
||||
const menuRevision = ref(0);
|
||||
const pendingReservation = ref<CommandPatternEntry | null>(null);
|
||||
const pickerElement = ref<HTMLElement | null>(null);
|
||||
const collapsedRowCount = 15;
|
||||
|
||||
const loadStorage = (key: string) => {
|
||||
@@ -136,6 +137,7 @@ const quickPickerTop = computed(() => `${70 + (quickTarget.value ?? 0) * 34.4}px
|
||||
const isRecruitmentCommand = computed(
|
||||
() => selectedCommand.value?.key === 'che_징병' || selectedCommand.value?.key === 'che_모병'
|
||||
);
|
||||
const isRecruitmentOverlayOpen = computed(() => pickerOpen.value && isRecruitmentCommand.value);
|
||||
const rowLabel = (row: ReservedCommandRow): string => row.label ?? labelMap.value.get(row.action) ?? row.action;
|
||||
const selectedIndices = () => normalizedSelection(selected.value, previousSelected.value, props.rows.length);
|
||||
const pattern = () => extractPattern(props.rows, selectedIndices());
|
||||
@@ -172,6 +174,46 @@ const closePicker = () => {
|
||||
quickTarget.value = null;
|
||||
selectedCommand.value = null;
|
||||
};
|
||||
|
||||
let previousBodyOverflow: string | null = null;
|
||||
const restoreBodyScroll = () => {
|
||||
if (previousBodyOverflow === null) return;
|
||||
document.body.style.overflow = previousBodyOverflow;
|
||||
previousBodyOverflow = null;
|
||||
};
|
||||
|
||||
watch(isRecruitmentOverlayOpen, async (open) => {
|
||||
if (!open) {
|
||||
restoreBodyScroll();
|
||||
return;
|
||||
}
|
||||
if (previousBodyOverflow === null) previousBodyOverflow = document.body.style.overflow;
|
||||
document.body.style.overflow = 'hidden';
|
||||
await nextTick();
|
||||
pickerElement.value?.querySelector<HTMLElement>('[data-picker-close]')?.focus();
|
||||
});
|
||||
|
||||
onBeforeUnmount(restoreBodyScroll);
|
||||
|
||||
const trapRecruitmentFocus = (event: KeyboardEvent) => {
|
||||
if (!isRecruitmentOverlayOpen.value || event.key !== 'Tab' || !pickerElement.value) return;
|
||||
const focusable = [
|
||||
...pickerElement.value.querySelectorAll<HTMLElement>(
|
||||
'button:not(:disabled), input:not(:disabled), select:not(:disabled), [tabindex="0"]'
|
||||
),
|
||||
].filter((element) => element.offsetParent !== null);
|
||||
if (!focusable.length) return;
|
||||
const first = focusable[0];
|
||||
const last = focusable.at(-1);
|
||||
if (!first || !last) return;
|
||||
if (event.shiftKey && document.activeElement === first) {
|
||||
event.preventDefault();
|
||||
last.focus();
|
||||
} else if (!event.shiftKey && document.activeElement === last) {
|
||||
event.preventDefault();
|
||||
first.focus();
|
||||
}
|
||||
};
|
||||
const togglePicker = (turnIndex?: number) => {
|
||||
const target = turnIndex ?? null;
|
||||
if (pickerOpen.value && quickTarget.value === target) {
|
||||
@@ -600,65 +642,79 @@ const clickOutsideMenu = (event: Event) => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="pickerOpen"
|
||||
class="command-picker"
|
||||
:class="{ 'recruitment-picker': isRecruitmentCommand }"
|
||||
data-testid="command-picker"
|
||||
:style="quickTarget === null || props.compact ? undefined : { top: quickPickerTop }"
|
||||
>
|
||||
<header>
|
||||
<strong>{{ quickTarget === null ? '선택한 턴' : `${quickTarget + 1}턴` }} 명령 입력</strong
|
||||
><button type="button" aria-label="명령 입력 닫기" @click="closePicker">×</button>
|
||||
</header>
|
||||
<CommandSelectForm
|
||||
v-if="!selectedCommand"
|
||||
:command-table="scopedTable"
|
||||
:loading="props.loading"
|
||||
:scope="props.scope"
|
||||
:active-category="activeCategory"
|
||||
:allow-blocked="true"
|
||||
@update:active-category="activeCategory = $event"
|
||||
@select="selectCommand"
|
||||
/>
|
||||
<template v-else>
|
||||
<div class="selected-command">
|
||||
<strong>{{ selectedCommand.name }}</strong>
|
||||
<small v-if="selectedCommand.reason"
|
||||
>현재 상태: {{ selectedCommand.reason }} · 예약 입력은 가능합니다.</small
|
||||
>
|
||||
</div>
|
||||
<RecruitmentCommandForm
|
||||
v-if="
|
||||
isRecruitmentCommand &&
|
||||
props.commandTable?.inputOptions.recruitment &&
|
||||
(selectedCommand.key === 'che_징병' || selectedCommand.key === 'che_모병')
|
||||
"
|
||||
:command-key="selectedCommand.key"
|
||||
:info="props.commandTable.inputOptions.recruitment"
|
||||
@update:args="commandArgs = $event"
|
||||
@update:valid="commandArgsValid = $event"
|
||||
@submit="submitCommand"
|
||||
<Teleport to="body" :disabled="!isRecruitmentCommand">
|
||||
<div
|
||||
v-if="pickerOpen"
|
||||
ref="pickerElement"
|
||||
class="command-picker"
|
||||
:class="{ 'recruitment-picker': isRecruitmentCommand }"
|
||||
data-testid="command-picker"
|
||||
:style="isRecruitmentCommand || quickTarget === null || props.compact ? undefined : { top: quickPickerTop }"
|
||||
:role="isRecruitmentCommand ? 'dialog' : undefined"
|
||||
:aria-modal="isRecruitmentCommand ? 'true' : undefined"
|
||||
:aria-label="
|
||||
isRecruitmentCommand
|
||||
? `${selectedCommand?.name ?? ''} ${quickTarget === null ? '선택한 턴' : `${quickTarget + 1}턴`} 명령 입력`
|
||||
: undefined
|
||||
"
|
||||
@keydown.esc.stop.prevent="closePicker"
|
||||
@keydown="trapRecruitmentFocus"
|
||||
>
|
||||
<header>
|
||||
<strong
|
||||
><template v-if="isRecruitmentCommand">{{ selectedCommand?.name }} · </template
|
||||
>{{ quickTarget === null ? '선택한 턴' : `${quickTarget + 1}턴` }} 명령 입력</strong
|
||||
><button data-picker-close type="button" aria-label="명령 입력 닫기" @click="closePicker">×</button>
|
||||
</header>
|
||||
<CommandSelectForm
|
||||
v-if="!selectedCommand"
|
||||
:command-table="scopedTable"
|
||||
:loading="props.loading"
|
||||
:scope="props.scope"
|
||||
:active-category="activeCategory"
|
||||
:allow-blocked="true"
|
||||
@update:active-category="activeCategory = $event"
|
||||
@select="selectCommand"
|
||||
/>
|
||||
<CommandArgumentForm
|
||||
v-else-if="selectedCommand.reqArg && props.commandTable"
|
||||
:command-key="selectedCommand.key"
|
||||
:fields="selectedCommand.inputFields"
|
||||
:options="props.commandTable.inputOptions"
|
||||
:map-data="props.mapData"
|
||||
:map-layout="props.mapLayout"
|
||||
@update:args="commandArgs = $event"
|
||||
@update:valid="commandArgsValid = $event"
|
||||
/>
|
||||
<div class="picker-actions">
|
||||
<button :disabled="Boolean(pendingReservation)" @click="selectedCommand = null">
|
||||
명령 다시 선택</button
|
||||
><button :disabled="!commandArgsValid || Boolean(pendingReservation)" @click="submitCommand">
|
||||
{{ pendingReservation ? '저장 중' : '입력' }}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<template v-else>
|
||||
<div class="selected-command">
|
||||
<strong>{{ selectedCommand.name }}</strong>
|
||||
<small v-if="selectedCommand.reason"
|
||||
>현재 상태: {{ selectedCommand.reason }} · 예약 입력은 가능합니다.</small
|
||||
>
|
||||
</div>
|
||||
<RecruitmentCommandForm
|
||||
v-if="
|
||||
isRecruitmentCommand &&
|
||||
props.commandTable?.inputOptions.recruitment &&
|
||||
(selectedCommand.key === 'che_징병' || selectedCommand.key === 'che_모병')
|
||||
"
|
||||
:command-key="selectedCommand.key"
|
||||
:info="props.commandTable.inputOptions.recruitment"
|
||||
@update:args="commandArgs = $event"
|
||||
@update:valid="commandArgsValid = $event"
|
||||
@submit="submitCommand"
|
||||
/>
|
||||
<CommandArgumentForm
|
||||
v-else-if="selectedCommand.reqArg && props.commandTable"
|
||||
:command-key="selectedCommand.key"
|
||||
:fields="selectedCommand.inputFields"
|
||||
:options="props.commandTable.inputOptions"
|
||||
:map-data="props.mapData"
|
||||
:map-layout="props.mapLayout"
|
||||
@update:args="commandArgs = $event"
|
||||
@update:valid="commandArgsValid = $event"
|
||||
/>
|
||||
<div class="picker-actions">
|
||||
<button :disabled="Boolean(pendingReservation)" @click="selectedCommand = null">
|
||||
명령 다시 선택</button
|
||||
><button :disabled="!commandArgsValid || Boolean(pendingReservation)" @click="submitCommand">
|
||||
{{ pendingReservation ? '저장 중' : '입력' }}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</Teleport>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
@@ -967,18 +1023,59 @@ const clickOutsideMenu = (event: Event) => {
|
||||
max-height: 344px;
|
||||
}
|
||||
|
||||
.reserved-command-editor .command-picker.recruitment-picker {
|
||||
.command-picker.recruitment-picker {
|
||||
position: fixed;
|
||||
z-index: 1100;
|
||||
top: 76px;
|
||||
right: auto;
|
||||
bottom: auto;
|
||||
left: 50%;
|
||||
width: 1000px;
|
||||
height: auto;
|
||||
max-height: calc(100vh - 82px);
|
||||
overflow: auto;
|
||||
transform: translateX(-50%);
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
height: 100dvh;
|
||||
max-height: none;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
background: #1d1d1d;
|
||||
box-shadow: none;
|
||||
transform: none;
|
||||
}
|
||||
.command-picker.recruitment-picker > header {
|
||||
position: sticky;
|
||||
z-index: 30;
|
||||
top: 0;
|
||||
box-sizing: border-box;
|
||||
min-height: 44px;
|
||||
padding: 6px 8px;
|
||||
border-bottom: 1px solid #777;
|
||||
background: #302016 var(--sammo-texture-walnut);
|
||||
}
|
||||
.command-picker.recruitment-picker > header button {
|
||||
min-width: 36px;
|
||||
min-height: 32px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.command-picker.recruitment-picker .selected-command,
|
||||
.command-picker.recruitment-picker :deep(.recruitment-command-form),
|
||||
.command-picker.recruitment-picker .picker-actions {
|
||||
width: min(100%, 1000px);
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
.command-picker.recruitment-picker :deep(.recruitment-command-form) {
|
||||
flex: 1 0 auto;
|
||||
}
|
||||
.command-picker.recruitment-picker .picker-actions {
|
||||
position: sticky;
|
||||
z-index: 30;
|
||||
bottom: 0;
|
||||
box-sizing: border-box;
|
||||
margin-top: 0;
|
||||
padding: 6px;
|
||||
border-top: 1px solid #777;
|
||||
background: #302016 var(--sammo-texture-walnut);
|
||||
}
|
||||
|
||||
@media (min-width: 1025px) {
|
||||
@@ -1002,14 +1099,6 @@ const clickOutsideMenu = (event: Event) => {
|
||||
max-height: calc(100vh - 104px);
|
||||
overflow: auto;
|
||||
}
|
||||
.compact:not(.mobile) .command-picker.recruitment-picker {
|
||||
top: 76px;
|
||||
left: 50%;
|
||||
width: 1000px;
|
||||
max-height: calc(100vh - 82px);
|
||||
overflow: auto;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
.mobile.compact .editor-layout {
|
||||
@@ -1055,36 +1144,10 @@ const clickOutsideMenu = (event: Event) => {
|
||||
margin-top: -330px;
|
||||
overflow: visible;
|
||||
}
|
||||
.mobile.compact .command-picker.recruitment-picker {
|
||||
position: fixed;
|
||||
top: 76px;
|
||||
left: 0;
|
||||
width: 500px;
|
||||
height: auto;
|
||||
max-height: calc(100vh - 82px);
|
||||
margin-top: 0;
|
||||
overflow: auto;
|
||||
transform: none;
|
||||
}
|
||||
.mobile.compact .advanced-actions {
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 109px;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.reserved-command-editor .command-picker.recruitment-picker,
|
||||
.reserved-command-editor.compact .command-picker.recruitment-picker {
|
||||
top: 76px;
|
||||
left: 0;
|
||||
width: 500px;
|
||||
height: auto;
|
||||
max-height: calc(100vh - 82px);
|
||||
overflow: auto;
|
||||
padding: 0;
|
||||
border-right: 0;
|
||||
border-left: 0;
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -109,6 +109,26 @@ const mapSelectedCityId = computed<number | null>(() => {
|
||||
return null;
|
||||
});
|
||||
|
||||
const currentCityName = computed(() => {
|
||||
const cityId = props.mapData?.myCity;
|
||||
if (!cityId) return '-';
|
||||
return props.mapLayout?.cityList.find((city) => city.id === cityId)?.name ?? '-';
|
||||
});
|
||||
|
||||
const selectedMapTargetName = computed(() => {
|
||||
if (presentation.value.mapTarget === 'city') {
|
||||
const cityId = mapSelectedCityId.value;
|
||||
if (!cityId) return '-';
|
||||
return props.mapLayout?.cityList.find((city) => city.id === cityId)?.name ?? '-';
|
||||
}
|
||||
if (presentation.value.mapTarget === 'nation' && nationTargetField.value) {
|
||||
const nationId = values[nationTargetField.value.key];
|
||||
if (typeof nationId !== 'number') return '-';
|
||||
return props.mapData?.nationList.find((nation) => nation[0] === nationId)?.[1] ?? '-';
|
||||
}
|
||||
return '-';
|
||||
});
|
||||
|
||||
const distanceFromMyCity = (destination: number): number | null => {
|
||||
const start = props.mapData?.myCity;
|
||||
if (!start || !props.mapLayout) return null;
|
||||
@@ -260,9 +280,23 @@ watch(
|
||||
:selected-city-id="mapSelectedCityId"
|
||||
:detail-mode="true"
|
||||
:fit-container="true"
|
||||
:show-current-city-marker="true"
|
||||
@select-city="selectMapCity"
|
||||
/>
|
||||
<small>지도에서 도시를 클릭하거나 아래 목록에서 대상을 선택하세요.</small>
|
||||
<div class="map-selection-status" aria-live="polite" data-testid="command-map-selection-status">
|
||||
<span class="current-city-status">
|
||||
<span class="status-key">현재 도시</span>
|
||||
<strong>{{ currentCityName }}</strong>
|
||||
</span>
|
||||
<span aria-hidden="true">→</span>
|
||||
<span class="selected-target-status">
|
||||
<span class="status-key">{{
|
||||
presentation.mapTarget === 'nation' ? '선택 국가' : '선택 도시'
|
||||
}}</span>
|
||||
<strong>{{ selectedMapTargetName }}</strong>
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="mapTargetSummary" class="map-target-summary" data-testid="command-map-target-summary">
|
||||
{{ mapTargetSummary }}
|
||||
</div>
|
||||
@@ -376,6 +410,41 @@ watch(
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.map-selection-status {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 4px 7px;
|
||||
padding: 0 8px 5px;
|
||||
color: rgba(232, 221, 196, 0.82);
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.map-selection-status > span:not([aria-hidden='true']) {
|
||||
display: inline-flex;
|
||||
gap: 4px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.status-key {
|
||||
border-radius: 2px;
|
||||
padding: 0 4px;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.current-city-status .status-key {
|
||||
border: 1px solid #82cfff;
|
||||
background: rgba(5, 27, 43, 0.92);
|
||||
color: #d9f3ff;
|
||||
}
|
||||
|
||||
.selected-target-status .status-key {
|
||||
border: 1px solid rgba(255, 235, 150, 0.9);
|
||||
background: rgba(201, 164, 90, 0.18);
|
||||
color: #ffe996;
|
||||
}
|
||||
|
||||
.command-guidance {
|
||||
display: grid;
|
||||
gap: 3px;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { formatServerDateTime } from '@sammo-ts/common';
|
||||
import { computed } from 'vue';
|
||||
import { resolveTournamentStageName } from '../../utils/tournamentStatus';
|
||||
|
||||
@@ -19,11 +20,17 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const tournamentStatus = computed(() => resolveTournamentStageName(props.tournamentStage));
|
||||
const lastExecutedStatus = computed(() =>
|
||||
formatServerDateTime(props.status?.lastExecuted, { format: 'monthDayTime', fallback: '기록 없음' })
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="front-status" aria-label="접속 현황과 국가 방침">
|
||||
<div class="activity-status" aria-label="설문과 토너먼트 진행 현황">
|
||||
<div class="activity-status" aria-label="동작 시각, 토너먼트와 설문 진행 현황">
|
||||
<div class="status-row execution-status" :class="{ 'execution-status--empty': !status?.lastExecuted }">
|
||||
동작 시각: {{ lastExecutedStatus }}
|
||||
</div>
|
||||
<div class="status-row tournament-status">
|
||||
<RouterLink to="/tournament">
|
||||
<span class="tournament-label">토너먼트: </span>{{ tournamentStatus }}
|
||||
@@ -86,9 +93,8 @@ const tournamentStatus = computed(() => resolveTournamentStageName(props.tournam
|
||||
|
||||
.activity-status {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
width: 66.666667%;
|
||||
margin-left: auto;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.activity-status .status-row {
|
||||
@@ -106,6 +112,14 @@ const tournamentStatus = computed(() => resolveTournamentStageName(props.tournam
|
||||
color: #ffc107;
|
||||
}
|
||||
|
||||
.execution-status {
|
||||
color: cyan;
|
||||
}
|
||||
|
||||
.execution-status--empty {
|
||||
color: magenta;
|
||||
}
|
||||
|
||||
.vote-label {
|
||||
color: cyan;
|
||||
}
|
||||
@@ -113,10 +127,4 @@ const tournamentStatus = computed(() => resolveTournamentStageName(props.tournam
|
||||
.vote-empty {
|
||||
color: magenta;
|
||||
}
|
||||
|
||||
@media (max-width: 991px) {
|
||||
.activity-status {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -71,6 +71,7 @@ const props = withDefaults(
|
||||
selectedCityId?: number | null;
|
||||
detailMode?: boolean;
|
||||
fitContainer?: boolean;
|
||||
showCurrentCityMarker?: boolean;
|
||||
}>(),
|
||||
{
|
||||
// Vue casts an absent Boolean prop to false unless undefined is an explicit default.
|
||||
@@ -214,6 +215,20 @@ const cityViews = computed<CityView[]>(() => {
|
||||
});
|
||||
});
|
||||
|
||||
const currentCityMarker = computed(() =>
|
||||
props.showCurrentCityMarker ? (cityViews.value.find((city) => city.isMyCity) ?? null) : null
|
||||
);
|
||||
|
||||
const currentCityMarkerStyle = computed(() => {
|
||||
const city = currentCityMarker.value;
|
||||
if (!city) return undefined;
|
||||
const verticalOffset = (effectiveDetailMode.value ? 22 : 14) * mapScale.value;
|
||||
return {
|
||||
left: `${city.x}px`,
|
||||
top: `${city.y - verticalOffset}px`,
|
||||
};
|
||||
});
|
||||
|
||||
const mapSeason = computed(() => {
|
||||
if (!props.mapData) {
|
||||
return 'spring';
|
||||
@@ -433,6 +448,16 @@ const selectCity = (cityId: number) => {
|
||||
@leave="setHoveredCity(null)"
|
||||
@select="selectCity"
|
||||
/>
|
||||
<div
|
||||
v-if="currentCityMarker"
|
||||
class="current-city-marker"
|
||||
:style="currentCityMarkerStyle"
|
||||
data-testid="current-city-marker"
|
||||
role="note"
|
||||
:aria-label="`현재 도시 ${currentCityMarker.name}`"
|
||||
>
|
||||
현재
|
||||
</div>
|
||||
<div v-if="hoveredCity" class="map-tooltip" :style="tooltipPosition">
|
||||
<div class="tooltip-title">{{ hoveredCityTitle }}</div>
|
||||
<div class="tooltip-body">{{ hoveredCity.nationId > 0 ? hoveredCity.nationName : '' }}</div>
|
||||
@@ -583,6 +608,38 @@ const selectCity = (cityId: number) => {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.current-city-marker {
|
||||
position: absolute;
|
||||
z-index: 12;
|
||||
box-sizing: border-box;
|
||||
min-width: 30px;
|
||||
border: 1px solid #82cfff;
|
||||
border-radius: 2px;
|
||||
padding: 1px 4px;
|
||||
background: rgba(5, 27, 43, 0.92);
|
||||
color: #d9f3ff;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
line-height: 14px;
|
||||
pointer-events: none;
|
||||
text-align: center;
|
||||
text-shadow: 0 1px #000;
|
||||
transform: translate(-50%, -100%);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.current-city-marker::after {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border: 4px solid transparent;
|
||||
border-top-color: #82cfff;
|
||||
content: '';
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.tooltip-title {
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user