web-difarft/app/components/sections/home/ContactBusinessCard.vue

397 lines
11 KiB
Vue

<script setup lang="ts">
import {
MapPin,
GraduationCap,
Briefcase,
Globe,
Server,
Network,
Wrench,
Github,
Instagram,
} from "lucide-vue-next";
const { t } = useI18n();
const contactRef = ref<HTMLElement | null>(null);
let observer: IntersectionObserver | null = null;
onMounted(async () => {
await nextTick();
const elements = contactRef.value?.querySelectorAll("[data-reveal]");
if (!elements?.length) return;
if (!("IntersectionObserver" in window)) {
elements.forEach((element) => {
element.classList.add("is-visible");
});
return;
}
observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
entry.target.classList.toggle("is-visible", entry.isIntersecting);
});
},
{
threshold: 0.1,
rootMargin: "0px 0px -50px 0px",
},
);
elements.forEach((element) => {
observer?.observe(element);
});
});
onBeforeUnmount(() => {
observer?.disconnect();
});
const whatsappUrl = computed(() => {
return `https://wa.me/6289629626283?text=${encodeURIComponent(
t("contact.whatsappMessage"),
)}`;
});
const scrollToSection = (id: string) => {
const element = document.getElementById(id);
if (!element) return;
element.scrollIntoView({
behavior: "smooth",
block: "start",
});
};
</script>
<template>
<section id="contact" ref="contactRef" class="py-16 sm:py-20 lg:py-24">
<div class="mx-auto max-w-7xl px-5 sm:px-6">
<div class="grid min-w-0 items-center gap-6 lg:grid-cols-2 lg:gap-8">
<!-- Business Card -->
<div
data-reveal
class="reveal rounded-2xl border p-5 sm:rounded-3xl sm:p-8 md:p-10"
:style="{
backgroundColor: 'var(--surface)',
borderColor: 'var(--border)',
'--delay': '0ms',
}"
>
<h2 class="mb-2 text-2xl font-bold sm:text-3xl">Dimas Fata</h2>
<p
class="mb-5 text-sm sm:mb-6 sm:text-base"
style="color: var(--text-muted)"
>
{{ t("contact.role") }}
</p>
<div class="space-y-3 sm:space-y-4">
<!-- Location -->
<div class="flex items-center gap-3 text-sm sm:text-base">
<MapPin :size="18" class="shrink-0" />
<span> Indonesia </span>
</div>
<!-- Education -->
<div class="flex items-center gap-3 text-sm sm:text-base">
<GraduationCap :size="18" class="shrink-0" />
<span>
{{ t("contact.education") }}
</span>
</div>
<!-- Freelance -->
<div class="flex items-center gap-3 text-sm sm:text-base">
<Briefcase :size="18" class="shrink-0" />
<span>
{{ t("contact.freelance") }}
</span>
</div>
</div>
<!-- Divider -->
<div
class="my-6 border-t sm:my-8"
:style="{
borderColor: 'var(--border)',
}"
/>
<!-- Contact Information -->
<div class="space-y-3 sm:space-y-4">
<!-- Email -->
<div>
<p class="text-xs sm:text-sm" style="color: var(--text-muted)">
{{ t("contact.email") }}
</p>
<a
href="mailto:hello@difarft.com"
class="inline-block break-all text-sm transition-opacity duration-200 hover:opacity-70 sm:text-base"
>
hello@difarft.com
</a>
</div>
<!-- WhatsApp -->
<div>
<p class="text-xs sm:text-sm" style="color: var(--text-muted)">
{{ t("contact.whatsapp") }}
</p>
<a
:href="whatsappUrl"
target="_blank"
rel="noopener noreferrer"
class="inline-block text-sm transition-opacity duration-200 hover:opacity-70 sm:text-base"
>
+6289629626283
</a>
</div>
<!-- Telegram -->
<div>
<p class="text-xs sm:text-sm" style="color: var(--text-muted)">
{{ t("contact.telegram") }}
</p>
<a
href="https://t.me/Difarft"
target="_blank"
rel="noopener noreferrer"
class="inline-block text-sm transition-opacity duration-200 hover:opacity-70 sm:text-base"
>
@Difarft
</a>
</div>
</div>
<!-- Social Links -->
<div class="mt-6 flex flex-wrap gap-2.5 sm:mt-8 sm:gap-3">
<!-- GitHub -->
<a
href="https://github.com/Difarft2"
target="_blank"
rel="noopener noreferrer"
class="flex items-center gap-2 rounded-xl border px-3 py-2 text-sm transition-all duration-300 hover:-translate-y-1 sm:px-4"
:style="{
borderColor: 'var(--border)',
}"
>
<Github :size="17" />
GitHub
</a>
<!-- Instagram -->
<a
href="https://www.instagram.com/difarft.02/"
target="_blank"
rel="noopener noreferrer"
class="flex items-center gap-2 rounded-xl border px-3 py-2 text-sm transition-all duration-300 hover:-translate-y-1 sm:px-4"
:style="{
borderColor: 'var(--border)',
}"
>
<Instagram :size="17" />
Instagram
</a>
<!-- LinkedIn -->
<a
href="https://www.linkedin.com/in/dimasft/"
target="_blank"
rel="noopener noreferrer"
class="flex items-center gap-2 rounded-xl border px-3 py-2 text-sm transition-all duration-300 hover:-translate-y-1 sm:px-4"
:style="{
borderColor: 'var(--border)',
}"
>
<Globe :size="17" />
LinkedIn
</a>
</div>
</div>
<!-- CTA -->
<div
data-reveal
class="reveal"
:style="{
'--delay': '120ms',
}"
>
<!-- Badge -->
<span
class="mb-4 inline-flex rounded-full px-3 py-1.5 text-xs font-medium sm:mb-6 sm:px-4 sm:py-2 sm:text-sm"
:style="{
backgroundColor: 'var(--surface)',
border: '1px solid var(--border)',
}"
>
{{ t("contact.badge") }}
</span>
<!-- Title -->
<h2
class="mb-4 wrap-break-word text-3xl font-bold leading-tight sm:mb-6 sm:text-4xl md:text-5xl"
>
{{ t("contact.title") }}
</h2>
<!-- Description -->
<p
class="mb-6 text-sm sm:mb-8 sm:text-base lg:text-lg"
style="color: var(--text-muted)"
>
{{ t("contact.description") }}
</p>
<!-- Services -->
<div class="mb-6 grid gap-3 sm:mb-8 sm:grid-cols-2 sm:gap-4">
<!-- Website -->
<div
data-reveal
class="reveal flex items-center gap-3 rounded-xl border p-3.5 text-sm sm:rounded-2xl sm:p-4 sm:text-base"
:style="{
backgroundColor: 'var(--surface)',
borderColor: 'var(--border)',
'--delay': '180ms',
}"
>
<Globe :size="19" class="shrink-0" />
<span>
{{ t("contact.website") }}
</span>
</div>
<!-- Backend -->
<div
data-reveal
class="reveal flex items-center gap-3 rounded-xl border p-3.5 text-sm sm:rounded-2xl sm:p-4 sm:text-base"
:style="{
backgroundColor: 'var(--surface)',
borderColor: 'var(--border)',
'--delay': '240ms',
}"
>
<Server :size="19" class="shrink-0" />
<span>
{{ t("contact.backend") }}
</span>
</div>
<!-- Network -->
<div
data-reveal
class="reveal flex items-center gap-3 rounded-xl border p-3.5 text-sm sm:rounded-2xl sm:p-4 sm:text-base"
:style="{
backgroundColor: 'var(--surface)',
borderColor: 'var(--border)',
'--delay': '300ms',
}"
>
<Network :size="19" class="shrink-0" />
<span>
{{ t("contact.network") }}
</span>
</div>
<!-- Maintenance -->
<div
data-reveal
class="reveal flex items-center gap-3 rounded-xl border p-3.5 text-sm sm:rounded-2xl sm:p-4 sm:text-base"
:style="{
backgroundColor: 'var(--surface)',
borderColor: 'var(--border)',
'--delay': '360ms',
}"
>
<Wrench :size="19" class="shrink-0" />
<span>
{{ t("contact.maintenance") }}
</span>
</div>
</div>
<!-- Buttons -->
<div
data-reveal
class="reveal flex flex-wrap gap-3"
:style="{
'--delay': '440ms',
}"
>
<!-- WhatsApp -->
<a
:href="whatsappUrl"
target="_blank"
rel="noopener noreferrer"
class="rounded-xl border px-5 py-2.5 text-sm transition-all duration-300 hover:-translate-y-1 sm:px-6 sm:py-3 sm:text-base"
:style="{
borderColor: 'var(--border)',
backgroundColor: 'var(--surface)',
}"
>
{{ t("contact.contactButton") }}
</a>
<!-- Projects -->
<button
type="button"
@click="scrollToSection('projects')"
class="rounded-xl border px-5 py-2.5 text-sm transition-all duration-300 hover:-translate-y-1 sm:px-6 sm:py-3 sm:text-base"
:style="{
borderColor: 'var(--border)',
backgroundColor: 'var(--surface)',
}"
>
{{ t("contact.projectButton") }}
</button>
</div>
</div>
</div>
</div>
</section>
</template>
<style scoped>
.reveal {
opacity: 0;
transform: translate3d(0, 40px, 0);
transition:
opacity 0.8s ease,
transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
transition-delay: var(--delay, 0ms);
will-change: opacity, transform;
}
.reveal.is-visible {
opacity: 1;
transform: translate3d(0, 0, 0);
}
@media (prefers-reduced-motion: reduce) {
.reveal {
opacity: 1;
transform: none;
transition: none;
}
}
</style>