Files
CV_Site_Nuxt/app/components/home/ContactItem.vue
T
Noel Sabia 47f4e64f24
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / Lint + typecheck (pull_request) Successful in 52s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Successful in 9s
PR Check / Dockerfile lint (droast) (pull_request) Successful in 6s
PR Check / AI code review (opencode) (pull_request) Successful in 47s
feat(ui): simplify terminal and contact bar on mobile
Below lg the chapter rows show only the context badge and the status, so
the terminal no longer needs 760px on a phone; the desktop grid is
unchanged. The contact bar stacks the email full width and puts LinkedIn
and the location side by side.

Contact values truncate instead of forcing the bar wider. Also fixes the
"someone we pull" typo in the third feature card and lets the hero quote
use the wider column.
2026-10-23 22:51:29 +02:00

71 lines
2.4 KiB
Vue

<script setup lang="ts">
const props = defineProps<{
icon: string
value: string
/** Omit for a plain chip (no copy button). */
copyValue?: string
/** Renders the chip as an external link instead of a copy chip. */
href?: string
}>()
const isLink = computed(() => Boolean(props.href))
const copied = ref(false)
let resetTimer: ReturnType<typeof setTimeout> | undefined
async function copy() {
if (!props.copyValue) return
try {
await navigator.clipboard.writeText(props.copyValue)
copied.value = true
clearTimeout(resetTimer)
resetTimer = setTimeout(() => {
copied.value = false
}, 1800)
} catch {
// Clipboard permission denied: leave the label on COPY.
}
}
onBeforeUnmount(() => clearTimeout(resetTimer))
</script>
<template>
<component
:is="isLink ? 'a' : 'div'"
:href="isLink ? href : undefined"
:target="isLink ? '_blank' : undefined"
:rel="isLink ? 'noopener noreferrer' : undefined"
:aria-label="isLink ? `Open ${value} in a new tab` : undefined"
class="flex items-center gap-2 rounded-lg bg-surface-container-low/70 px-3 py-2"
:class="isLink
? 'group justify-between gap-3 transition-colors hover:bg-surface-container-high'
: copyValue
? 'justify-between transition-colors hover:bg-surface-container-high'
: 'justify-center font-body-sm text-body-sm text-on-surface-variant'"
>
<div class="flex min-w-0 items-center gap-2.5">
<span class="material-symbols-outlined text-[1.125rem] text-outline">{{ icon }}</span>
<span
v-if="copyValue || isLink"
class="truncate font-body-sm text-body-sm text-on-surface"
:class="copyValue && !isLink ? 'select-all' : ''"
>{{ value }}</span>
<span v-else class="truncate text-on-surface">{{ value }}</span>
</div>
<button
v-if="copyValue && !isLink"
type="button"
class="flex items-center gap-1 rounded bg-surface-variant px-2 py-1 text-[0.625rem] font-semibold tracking-wider text-on-surface-variant transition-colors hover:text-on-surface active:scale-95"
:aria-label="`Copy ${value}`"
@click="copy"
>
<span>{{ copied ? 'COPIED' : 'COPY' }}</span>
</button>
<span
v-else-if="isLink"
class="material-symbols-outlined text-[0.875rem] text-outline transition-colors group-hover:text-on-surface"
>open_in_new</span>
</component>
</template>