43 lines
1.1 KiB
Vue
43 lines
1.1 KiB
Vue
<script setup lang="ts">
|
|||
|
|
import Reveal from "./Reveal.vue";
|
||
|
|
|
||
|
|
withDefaults(
|
||
|
|
defineProps<{
|
||
|
|
tag: string;
|
||
|
|
/** plain-text title; use the #title slot for rich markup (line breaks, spans) */
|
||
|
|
title?: string;
|
||
|
|
desc?: string;
|
||
|
|
center?: boolean;
|
||
|
|
headingId?: string;
|
||
|
|
}>(),
|
||
|
|
{ center: false },
|
||
|
|
);
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<template>
|
||
|
|
<div :class="center ? 'text-center' : ''">
|
||
|
|
<Reveal>
|
||
|
|
<div :class="`flex items-center gap-3 ${center ? 'justify-center' : ''}`">
|
||
|
|
<span class="font-mono text-sm text-accent">//</span>
|
||
|
|
<span class="font-mono text-xs tracking-[0.25em] text-muted">
|
||
|
|
{{ tag }}
|
||
|
|
</span>
|
||
|
|
<span class="h-px w-14 bg-line" />
|
||
|
|
</div>
|
||
|
|
</Reveal>
|
||
|
|
<Reveal :delay="0.08">
|
||
|
|
<h2
|
||
|
|
:id="headingId"
|
||
|
|
class="mt-5 text-3xl font-black leading-[1.25] md:text-5xl md:leading-[1.2]"
|
||
|
|
>
|
||
|
|
<slot name="title">{{ title }}</slot>
|
||
|
|
</h2>
|
||
|
|
</Reveal>
|
||
|
|
<Reveal v-if="desc" :delay="0.16">
|
||
|
|
<p :class="`mt-5 max-w-xl leading-8 text-muted ${center ? 'mx-auto' : ''}`">
|
||
|
|
{{ desc }}
|
||
|
|
</p>
|
||
|
|
</Reveal>
|
||
|
|
</div>
|
||
|
|
</template>
|