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

120 lines
3.0 KiB
Vue

<template>
<section id="projects" ref="projectsRef" class="py-16 sm:py-20 lg:py-24">
<div class="max-w-7xl mx-auto px-5 sm:px-6">
<div data-reveal class="reveal text-center mb-10 sm:mb-14 lg:mb-16">
<span
class="inline-block px-3 py-1.5 sm:px-4 sm:py-2 rounded-full text-xs sm:text-sm font-medium mb-4"
:style="{
backgroundColor: 'var(--surface)',
border: '1px solid var(--border)',
}"
>
{{ t("projects.badge") }}
</span>
<h2 class="text-3xl sm:text-4xl md:text-5xl font-bold mb-4">
{{ t("projects.title") }}
</h2>
<p
class="max-w-2xl mx-auto text-sm sm:text-base"
style="color: var(--text-muted)"
>
{{ t("projects.description") }}
</p>
</div>
<div class="max-w-3xl mx-auto">
<div
data-reveal
class="reveal rounded-2xl sm:rounded-3xl border p-6 sm:p-8 lg:p-10 text-center"
:style="{
backgroundColor: 'var(--surface)',
borderColor: 'var(--border)',
'--delay': '120ms',
}"
>
<div class="flex justify-center mb-5 sm:mb-6">
<div
class="w-16 h-16 sm:w-20 sm:h-20 rounded-2xl flex items-center justify-center"
:style="{
backgroundColor: 'var(--bg)',
}"
>
<FolderKanban :size="32" class="sm:hidden" />
<FolderKanban :size="40" class="hidden sm:block" />
</div>
</div>
<h3 class="text-2xl sm:text-3xl font-bold mb-3 sm:mb-4">
{{ t("projects.maintenance.title") }}
</h3>
<p
class="max-w-xl mx-auto text-sm sm:text-base leading-relaxed"
style="color: var(--text-muted)"
>
{{ t("projects.maintenance.description") }}
</p>
</div>
</div>
</div>
</section>
</template>
<script setup lang="ts">
import { FolderKanban } from "lucide-vue-next";
const { t } = useI18n();
const projectsRef = ref<HTMLElement | null>(null);
let observer: IntersectionObserver | null = null;
onMounted(() => {
observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
entry.target.classList.toggle("is-visible", entry.isIntersecting);
});
},
{
threshold: 0.1,
rootMargin: "0px 0px -50px 0px",
},
);
projectsRef.value?.querySelectorAll("[data-reveal]").forEach((element) => {
observer?.observe(element);
});
});
onBeforeUnmount(() => {
observer?.disconnect();
});
</script>
<style scoped>
.reveal {
opacity: 0;
transform: translate3d(0, 30px, 0);
transition:
opacity 0.7s ease,
transform 0.7s ease;
transition-delay: var(--delay, 0ms);
}
.reveal.is-visible {
opacity: 1;
transform: translate3d(0, 0, 0);
}
@media (prefers-reduced-motion: reduce) {
.reveal {
opacity: 1;
transform: none;
transition: none;
}
}
</style>