fix: wire up EndingGallery click to open ChapterRecap via chapterId
This commit is contained in:
@@ -8,6 +8,7 @@ defineProps<{
|
||||
|
||||
const emit = defineEmits<{
|
||||
close: []
|
||||
selectChapter: [chapterId: string]
|
||||
}>()
|
||||
|
||||
function isUnlocked(ending: EndingDef, visitedIds: Set<string>): boolean {
|
||||
@@ -25,7 +26,8 @@ function isUnlocked(ending: EndingDef, visitedIds: Set<string>): boolean {
|
||||
v-for="end in endings"
|
||||
:key="end.id"
|
||||
class="ending-card"
|
||||
:class="{ locked: !isUnlocked(end, visitedIds) }"
|
||||
:class="{ locked: !isUnlocked(end, visitedIds), clickable: isUnlocked(end, visitedIds) && !!end.chapterId }"
|
||||
@click="isUnlocked(end, visitedIds) && end.chapterId && emit('selectChapter', end.chapterId)"
|
||||
>
|
||||
<div class="ending-thumb">
|
||||
<img v-if="end.thumbnail" :src="end.thumbnail" class="thumb-img" />
|
||||
@@ -89,6 +91,16 @@ function isUnlocked(ending: EndingDef, visitedIds: Set<string>): boolean {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.ending-card.clickable {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ending-card.clickable:hover {
|
||||
opacity: 0.85;
|
||||
transform: scale(1.05);
|
||||
transition: transform 0.15s ease;
|
||||
}
|
||||
|
||||
.ending-thumb {
|
||||
width: 120px;
|
||||
height: 68px;
|
||||
|
||||
Reference in New Issue
Block a user