Files
CV_Site_Nuxt/app/components/home/ChapterRow.vue
T
Noel Sabia 26739731ed feat(ui): build homepage hero, terminal and feature cards
Compose pages/index.vue from the desktop homepage mockup: decorative
backdrop scoped to the hero but not clipped at its bottom edge, hero with
status pill, quote and contact chips with copy buttons, terminal panel fed
by a chapter array with derived counters, and the three feature cards.

Split into app/components/home/ (auto-imported with the Home* prefix) and
keep the chapter data in app/data/chapters.ts so GET /api/chapters can
replace the mockup values later.
2026-10-23 21:22:02 +02:00

45 lines
1.5 KiB
Vue

<script setup lang="ts">
import type { Chapter } from '~/data/chapters'
const props = defineProps<{ chapter: Chapter }>()
const isActive = computed(() => props.chapter.status === 'active')
// Active rows report recoveries; finished rows report what sealed them.
const detail = computed(() => (isActive.value
? { label: 'self_healed', value: `${props.chapter.rebounds ?? 0}x` }
: props.chapter.outcome))
</script>
<template>
<div
class="flex min-w-[580px] items-center justify-between gap-4 rounded px-3 py-1.5 transition-colors hover:bg-surface-container-lowest"
:class="isActive ? 'bg-surface-container-lowest/60' : 'bg-surface-container-lowest/40'"
>
<span
class="font-medium"
:class="isActive ? 'text-primary-fixed-dim' : 'text-outline'"
>chapter=<span :class="isActive ? 'text-on-surface' : 'text-on-surface-variant'">{{ chapter.name }}</span></span>
<span
v-if="isActive"
class="flex items-center gap-1.5 font-semibold text-secondary"
>
<span class="h-1.5 w-1.5 rounded-full bg-secondary" />
status=active
</span>
<span v-else class="font-medium text-outline">status=finished</span>
<span
class="font-status-badge text-status-badge"
:class="isActive ? 'text-on-surface-variant' : 'text-on-surface-variant/70'"
>uptime={{ chapter.uptime }}</span>
<span
v-if="detail"
class="font-label-mono text-label-mono"
:class="isActive ? 'text-tertiary' : 'text-primary-fixed-dim'"
>{{ detail.label }}={{ detail.value }}</span>
</div>
</template>