feat: migrate landing from Next.js to Nuxt 4 (Vue 3)
Full 1:1 migration preserving all visuals, animations and behavior: - Nuxt 4 + Vue 3 (script setup, TypeScript strict) with SSG output - Tailwind CSS v4 with @tailwindcss/vite - Ant Design Vue 4 (dark theme, RTL, Persian locale) for design system - Pinia for state management (ui + contact stores) - motion-v (framer-motion port) for all animations - lucide-vue-next for icons - SEO improvements: og:image, canonical fix, real 404 page, JSON-LD services - JS bundle reduced from 302KB to 239KB gzip - Docker/nginx deployment preserved (out/ -> nginx) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
1af5b555b8
commit
e31ef5a21f
@@ -0,0 +1,24 @@
|
||||
<script setup lang="ts">
|
||||
import { AnimatePresence } from "motion-v";
|
||||
import Preloader from "./Preloader.vue";
|
||||
import Cursor from "./Cursor.vue";
|
||||
import Header from "./Header.vue";
|
||||
import BackToTop from "./BackToTop.vue";
|
||||
|
||||
const ui = useUiStore();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AnimatePresence>
|
||||
<Preloader v-if="!ui.ready" @complete="ui.setReady" />
|
||||
</AnimatePresence>
|
||||
|
||||
<Cursor />
|
||||
<div class="noise" aria-hidden="true" />
|
||||
|
||||
<Header />
|
||||
|
||||
<slot />
|
||||
|
||||
<BackToTop />
|
||||
</template>
|
||||
@@ -0,0 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { AnimatePresence, motion } from "motion-v";
|
||||
import { ArrowUp } from "lucide-vue-next";
|
||||
|
||||
const show = useScrolledPast(700);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AnimatePresence>
|
||||
<motion.a
|
||||
v-if="show"
|
||||
href="#home"
|
||||
aria-label="بازگشت به بالا"
|
||||
:initial="{ opacity: 0, y: 24 }"
|
||||
:animate="{ opacity: 1, y: 0 }"
|
||||
:exit="{ opacity: 0, y: 24 }"
|
||||
class="fixed bottom-6 left-6 z-[70] flex size-12 items-center justify-center rounded-full border border-line bg-panel/90 text-ink shadow-[0_10px_40px_rgba(0,0,0,0.5)] backdrop-blur transition-colors hover:border-accent hover:text-accent"
|
||||
>
|
||||
<ArrowUp class="size-5" />
|
||||
</motion.a>
|
||||
</AnimatePresence>
|
||||
</template>
|
||||
@@ -0,0 +1,52 @@
|
||||
<script setup lang="ts">
|
||||
import { motion, useMotionValue, useSpring } from "motion-v";
|
||||
|
||||
const x = useMotionValue(-100);
|
||||
const y = useMotionValue(-100);
|
||||
const sx = useSpring(x, { stiffness: 550, damping: 45, mass: 0.4 });
|
||||
const sy = useSpring(y, { stiffness: 550, damping: 45, mass: 0.4 });
|
||||
const hover = ref(false);
|
||||
const visible = ref(false);
|
||||
|
||||
const move = (e: MouseEvent) => {
|
||||
x.set(e.clientX);
|
||||
y.set(e.clientY);
|
||||
visible.value = true;
|
||||
};
|
||||
const over = (e: MouseEvent) => {
|
||||
const t = e.target as HTMLElement | null;
|
||||
hover.value = !!t?.closest?.(
|
||||
"a, button, input, textarea, select, label, [data-hover]",
|
||||
);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener("mousemove", move, { passive: true });
|
||||
window.addEventListener("mouseover", over, { passive: true });
|
||||
});
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener("mousemove", move);
|
||||
window.removeEventListener("mouseover", over);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="pointer-events-none fixed inset-0 z-[120] hidden [@media(pointer:fine)]:block">
|
||||
<motion.div :style="{ x: sx, y: sy }" class="absolute -left-4 -top-4 size-8">
|
||||
<motion.div
|
||||
:animate="{
|
||||
scale: hover ? 1.9 : 1,
|
||||
opacity: visible ? 1 : 0,
|
||||
rotate: hover ? 45 : 0,
|
||||
}"
|
||||
:transition="{ type: 'spring', stiffness: 320, damping: 24 }"
|
||||
class="size-8 rounded-md border-2 border-accent/80"
|
||||
/>
|
||||
<div
|
||||
:class="`absolute inset-0 m-auto size-1 rounded-full bg-accent transition-opacity duration-300 ${
|
||||
visible ? 'opacity-100' : 'opacity-0'
|
||||
}`"
|
||||
/>
|
||||
</motion.div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,118 @@
|
||||
<script setup lang="ts">
|
||||
import { AtSign, Globe, Phone, Send } from "lucide-vue-next";
|
||||
import Logo from "~/components/ui/Logo.vue";
|
||||
|
||||
const QUICK_LINKS = [
|
||||
{ href: "#home", label: "خانه" },
|
||||
{ href: "#products", label: "محصولات" },
|
||||
{ href: "#about", label: "درباره ما" },
|
||||
{ href: "#services", label: "خدمات" },
|
||||
{ href: "#standards", label: "استانداردها" },
|
||||
{ href: "#industries", label: "صنایع" },
|
||||
];
|
||||
|
||||
const PRODUCT_LINKS = [
|
||||
"کلاه ایمنی",
|
||||
"دستکش ضدبرش",
|
||||
"کفش ایمنی",
|
||||
"عینک ایمنی",
|
||||
"هارنس ضدسقوط",
|
||||
"لباس کار بازتابنده",
|
||||
];
|
||||
|
||||
const SOCIALS = [
|
||||
{ icon: Globe, label: "وبسایت" },
|
||||
{ icon: Send, label: "تلگرام" },
|
||||
{ icon: AtSign, label: "ایمیل" },
|
||||
{ icon: Phone, label: "تماس" },
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<footer class="relative overflow-hidden border-t border-line">
|
||||
<div class="hazard h-2.5" />
|
||||
|
||||
<div class="mx-auto max-w-7xl px-5 md:px-8">
|
||||
<div class="grid gap-12 py-16 md:grid-cols-12 md:py-20">
|
||||
<!-- brand -->
|
||||
<div class="md:col-span-5">
|
||||
<Logo />
|
||||
<p class="mt-6 max-w-sm text-sm leading-8 text-muted">
|
||||
تأمینکننده تخصصی تجهیزات حفاظت فردی و راهکارهای ایمنی صنعتی؛
|
||||
همراه سازمانها از سال ۱۳۸۶ در مسیر صفر شدن حوادث کاری.
|
||||
</p>
|
||||
<div class="mt-7 flex gap-3">
|
||||
<a
|
||||
v-for="s in SOCIALS"
|
||||
:key="s.label"
|
||||
href="#contact"
|
||||
:aria-label="s.label"
|
||||
class="flex size-10 items-center justify-center rounded-lg border border-line text-muted transition-all duration-300 hover:border-accent hover:bg-accent hover:text-bg"
|
||||
>
|
||||
<component :is="s.icon" class="size-4" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- quick links -->
|
||||
<div class="md:col-span-2">
|
||||
<div class="font-mono text-xs tracking-[0.25em] text-accent">// دسترسی</div>
|
||||
<ul class="mt-5 space-y-3">
|
||||
<li v-for="l in QUICK_LINKS" :key="l.href">
|
||||
<a :href="l.href" class="text-sm text-muted transition-colors hover:text-ink">
|
||||
{{ l.label }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- products -->
|
||||
<div class="md:col-span-2">
|
||||
<div class="font-mono text-xs tracking-[0.25em] text-accent">// محصولات</div>
|
||||
<ul class="mt-5 space-y-3">
|
||||
<li v-for="p in PRODUCT_LINKS" :key="p">
|
||||
<a href="#products" class="text-sm text-muted transition-colors hover:text-ink">
|
||||
{{ p }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- contact -->
|
||||
<div class="md:col-span-3">
|
||||
<div class="font-mono text-xs tracking-[0.25em] text-accent">// ارتباط</div>
|
||||
<address class="mt-5 space-y-3 text-sm text-muted not-italic">
|
||||
<p class="leading-7">
|
||||
تهران، خیابان کارگر شمالی،
|
||||
<br />
|
||||
خیابان فر، کوچه دوم، پلاک ۱۲
|
||||
</p>
|
||||
<p class="font-mono tracking-wider" dir="ltr">۰۲۱ - ۹۱ ۰۰ ۸۸ ۰۰</p>
|
||||
<p class="font-mono tracking-wider" dir="ltr">info@ariaiman.ir</p>
|
||||
<p class="pt-2 text-xs leading-6">
|
||||
شنبه تا پنجشنبه — ۸:۰۰ تا ۱۷:۰۰
|
||||
<br />
|
||||
پشتیبانی اضطراری: ۲۴/۷
|
||||
</p>
|
||||
</address>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- giant wordmark -->
|
||||
<div aria-hidden="true" class="pointer-events-none select-none pb-6">
|
||||
<div class="text-outline text-center text-[17vw] font-black leading-[0.85] md:text-[11vw]">
|
||||
آریا ایمن
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="flex flex-wrap items-center justify-between gap-4 border-t border-line py-6 text-xs text-muted"
|
||||
>
|
||||
<div>© ۱۴۰۴ آریا ایمن — تمامی حقوق محفوظ است.</div>
|
||||
<div class="font-mono text-[10px] tracking-[0.25em]">
|
||||
ISO 9001:2015 — CE CERTIFIED PPE SUPPLIER
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</template>
|
||||
@@ -0,0 +1,135 @@
|
||||
<script setup lang="ts">
|
||||
import { AnimatePresence, motion } from "motion-v";
|
||||
import { Menu, Phone, X } from "lucide-vue-next";
|
||||
import Logo from "~/components/ui/Logo.vue";
|
||||
|
||||
const LINKS = [
|
||||
{ href: "#home", label: "خانه" },
|
||||
{ href: "#products", label: "محصولات" },
|
||||
{ href: "#about", label: "درباره ما" },
|
||||
{ href: "#services", label: "خدمات" },
|
||||
{ href: "#standards", label: "استانداردها" },
|
||||
{ href: "#industries", label: "صنایع" },
|
||||
{ href: "#contact", label: "تماس" },
|
||||
];
|
||||
|
||||
const ui = useUiStore();
|
||||
const scrolled = useScrolledPast(40);
|
||||
const { time, shift } = useTehranClock();
|
||||
|
||||
watch(
|
||||
() => ui.menuOpen,
|
||||
(open) => {
|
||||
document.body.style.overflow = open ? "hidden" : "";
|
||||
},
|
||||
);
|
||||
onBeforeUnmount(() => {
|
||||
document.body.style.overflow = "";
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<motion.header
|
||||
:initial="{ y: -90, opacity: 0 }"
|
||||
:animate="ui.ready ? { y: 0, opacity: 1 } : {}"
|
||||
:transition="{ duration: 0.9, delay: 0.15, ease: EASE }"
|
||||
:class="`fixed inset-x-0 top-0 z-[80] transition-all duration-500 ${
|
||||
scrolled ? 'border-b border-line bg-bg/85 py-3 backdrop-blur-xl' : 'py-5'
|
||||
}`"
|
||||
>
|
||||
<div class="mx-auto flex max-w-7xl items-center justify-between px-5 md:px-8">
|
||||
<Logo />
|
||||
|
||||
<nav class="hidden items-center gap-7 lg:flex">
|
||||
<a
|
||||
v-for="l in LINKS"
|
||||
:key="l.href"
|
||||
:href="l.href"
|
||||
class="group relative py-2 text-sm text-ink/75 transition-colors hover:text-ink"
|
||||
>
|
||||
{{ l.label }}
|
||||
<span
|
||||
class="absolute bottom-0 start-0 h-0.5 w-full origin-right scale-x-0 bg-accent transition-transform duration-300 group-hover:scale-x-100"
|
||||
/>
|
||||
</a>
|
||||
</nav>
|
||||
|
||||
<div class="flex items-center gap-3">
|
||||
<div
|
||||
class="hidden items-center gap-2.5 rounded-full border border-line px-4 py-2 text-[11px] text-muted xl:flex"
|
||||
>
|
||||
<span class="size-1.5 animate-pulse rounded-full bg-emerald-400" />
|
||||
<span class="font-mono">{{ time }}</span>
|
||||
<span class="text-muted/50">|</span>
|
||||
<span>تهران — شیفت {{ shift }}</span>
|
||||
</div>
|
||||
|
||||
<a
|
||||
href="#contact"
|
||||
class="hidden items-center gap-2 rounded-full bg-accent px-5 py-2.5 text-sm font-bold text-bg transition-all duration-300 hover:bg-accent-soft hover:shadow-[0_0_30px_rgba(255,90,0,0.4)] md:flex"
|
||||
>
|
||||
<Phone class="size-4" />
|
||||
درخواست مشاوره
|
||||
</a>
|
||||
|
||||
<button
|
||||
aria-label="باز کردن منو"
|
||||
class="flex size-11 items-center justify-center rounded-lg border border-line text-ink transition-colors hover:border-accent hover:text-accent lg:hidden"
|
||||
@click="ui.openMenu"
|
||||
>
|
||||
<Menu class="size-5" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</motion.header>
|
||||
|
||||
<AnimatePresence>
|
||||
<motion.div
|
||||
v-if="ui.menuOpen"
|
||||
:initial="{ opacity: 0 }"
|
||||
:animate="{ opacity: 1 }"
|
||||
:exit="{ opacity: 0 }"
|
||||
:transition="{ duration: 0.35 }"
|
||||
class="fixed inset-0 z-[110] flex flex-col bg-bg/95 backdrop-blur-2xl"
|
||||
>
|
||||
<div class="flex items-center justify-between border-b border-line px-5 py-4 md:px-8">
|
||||
<Logo />
|
||||
<button
|
||||
aria-label="بستن منو"
|
||||
class="flex size-11 items-center justify-center rounded-lg border border-line transition-colors hover:border-accent hover:text-accent"
|
||||
@click="ui.closeMenu"
|
||||
>
|
||||
<X class="size-5" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<nav class="flex flex-1 flex-col justify-center gap-1 overflow-y-auto px-8">
|
||||
<motion.a
|
||||
v-for="(l, i) in LINKS"
|
||||
:key="l.href"
|
||||
:href="l.href"
|
||||
:initial="{ opacity: 0, x: 44 }"
|
||||
:animate="{ opacity: 1, x: 0 }"
|
||||
:transition="{ delay: 0.08 + i * 0.055, duration: 0.55, ease: EASE }"
|
||||
class="group flex items-baseline gap-5 border-b border-line/60 py-4"
|
||||
@click="ui.closeMenu"
|
||||
>
|
||||
<span class="font-mono text-xs text-accent">
|
||||
{{ faNum(String(i + 1).padStart(2, "0")) }}
|
||||
</span>
|
||||
<span class="text-3xl font-black transition-colors group-hover:text-accent">
|
||||
{{ l.label }}
|
||||
</span>
|
||||
</motion.a>
|
||||
</nav>
|
||||
|
||||
<div class="flex items-center justify-between border-t border-line p-8 text-sm">
|
||||
<div class="flex items-center gap-3 text-muted">
|
||||
<Phone class="size-4 text-accent" />
|
||||
<span class="font-mono">۰۲۱-۹۱۰۰۸۸۰۰</span>
|
||||
</div>
|
||||
<div class="text-xs text-muted">تهران — شیفت {{ shift }}، {{ time }}</div>
|
||||
</div>
|
||||
</motion.div>
|
||||
</AnimatePresence>
|
||||
</template>
|
||||
@@ -0,0 +1,78 @@
|
||||
<script setup lang="ts">
|
||||
import { motion } from "motion-v";
|
||||
import { ShieldCheck } from "lucide-vue-next";
|
||||
|
||||
const STEPS = [
|
||||
"بررسی سیستمهای ایمنی",
|
||||
"تأیید استانداردهای بینالمللی",
|
||||
"بارگذاری تجهیزات حفاظت فردی",
|
||||
"محیط کاری آماده است",
|
||||
];
|
||||
|
||||
const emit = defineEmits<{ complete: [] }>();
|
||||
|
||||
const progress = ref(0);
|
||||
let done = false;
|
||||
let t: ReturnType<typeof setInterval> | undefined;
|
||||
|
||||
onMounted(() => {
|
||||
let v = 0;
|
||||
t = setInterval(() => {
|
||||
v += Math.floor(Math.random() * 11) + 7;
|
||||
if (v >= 100) {
|
||||
v = 100;
|
||||
clearInterval(t);
|
||||
if (!done) {
|
||||
done = true;
|
||||
setTimeout(() => emit("complete"), 450);
|
||||
}
|
||||
}
|
||||
progress.value = v;
|
||||
}, 140);
|
||||
});
|
||||
onBeforeUnmount(() => clearInterval(t));
|
||||
|
||||
const step = computed(
|
||||
() =>
|
||||
STEPS[
|
||||
Math.min(STEPS.length - 1, Math.floor((progress.value / 100) * STEPS.length))
|
||||
],
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<motion.div
|
||||
:exit="{ y: '-100%' }"
|
||||
:transition="{ duration: 0.85, ease: [0.76, 0, 0.24, 1] }"
|
||||
class="fixed inset-0 z-[200] flex flex-col items-center justify-center bg-bg"
|
||||
>
|
||||
<div class="hazard absolute inset-x-0 top-0 h-3" />
|
||||
<div class="hazard absolute inset-x-0 bottom-0 h-3" />
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
<span class="flex size-12 items-center justify-center rounded-xl bg-accent text-bg">
|
||||
<ShieldCheck class="size-7" />
|
||||
</span>
|
||||
<span class="font-mono text-xs tracking-[0.35em] text-muted">
|
||||
ARIA IMEN CO.
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mt-12 font-mono text-7xl font-semibold tabular-nums md:text-8xl">
|
||||
{{ progress.toLocaleString("fa-IR") }}<span class="text-accent">٪</span>
|
||||
</div>
|
||||
|
||||
<div class="mt-8 h-[3px] w-64 overflow-hidden rounded-full bg-line md:w-80">
|
||||
<div
|
||||
class="h-full bg-accent transition-all duration-200"
|
||||
:style="{ width: `${progress}%` }"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex items-center gap-3 text-xs text-muted">
|
||||
<span class="size-1.5 animate-pulse rounded-full bg-accent" />
|
||||
{{ step }}
|
||||
<span class="animate-blink text-accent">▍</span>
|
||||
</div>
|
||||
</motion.div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user