refactor: media cards use proper <a href> links instead of JS navigation

MediaCard, MediaRow, CollageHero, HeroSection, and MediaDetail cast
cards now render as <a> tags with real hrefs. Modified clicks
(ctrl+click, middle-click) navigate natively, enabling open-in-new-tab
and link copying. Plain left-clicks continue through the existing
showDetail flow for side-effects like focus-state saving.
This commit is contained in:
2026-05-25 14:21:13 +00:00
parent 1d3d682b60
commit 76c426546b
9 changed files with 104 additions and 29 deletions
+10 -1
View File
@@ -10,13 +10,14 @@
:item="item"
:nav-row="rowIndex"
:nav-col="index"
:href="getItemHref(item)"
@click="$emit('select', item)"
/>
</div>
</template>
<script setup lang="ts">
import type { MediaItem } from "../types"
import type { MediaItem, EpisodeWithSeries } from "../types"
import MediaCard from "./MediaCard.vue"
defineProps<{
@@ -28,4 +29,12 @@ defineProps<{
defineEmits<{
select: [MediaItem]
}>()
function getItemHref(item: MediaItem): string | undefined {
if (item.type === "episode") {
const epData = item.data as EpisodeWithSeries
return `#/series/${epData.series.id}`
}
return `#/${item.type}/${item.id}`
}
</script>