2026-09-01 16:05:29 +03:30
|
|
|
|
<script setup lang="ts">
|
2026-09-02 16:06:17 +03:30
|
|
|
|
import { computed } from 'vue';
|
2026-11-05 14:46:35 +03:30
|
|
|
|
import { SearchOutlined, SendOutlined } from '@/icons/ant-bridge';
|
2026-11-03 16:51:51 +03:30
|
|
|
|
import {
|
|
|
|
|
|
Button as AButton,
|
|
|
|
|
|
Input as AInput,
|
|
|
|
|
|
Typography,
|
|
|
|
|
|
} from 'ant-design-vue';
|
|
|
|
|
|
import { brand } from '@mento/shared';
|
2026-09-15 14:10:52 +03:30
|
|
|
|
import { useAuthStore } from '@/stores/auth';
|
2026-09-01 16:05:29 +03:30
|
|
|
|
|
2026-09-02 16:06:17 +03:30
|
|
|
|
const props = defineProps<{
|
2026-09-01 16:05:29 +03:30
|
|
|
|
greeting: string;
|
|
|
|
|
|
firstName: string;
|
|
|
|
|
|
userInitial: string;
|
|
|
|
|
|
askQuery: string;
|
2026-09-21 16:58:49 +03:30
|
|
|
|
asking?: boolean;
|
|
|
|
|
|
askAnswer?: string;
|
|
|
|
|
|
askError?: string;
|
2026-10-13 14:45:29 +03:30
|
|
|
|
statusText?: string;
|
2026-09-01 16:05:29 +03:30
|
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
|
|
|
'update:askQuery': [value: string];
|
|
|
|
|
|
ask: [];
|
|
|
|
|
|
}>();
|
|
|
|
|
|
|
2026-09-15 14:10:52 +03:30
|
|
|
|
const auth = useAuthStore();
|
2026-11-03 16:51:51 +03:30
|
|
|
|
const { Title: ATypographyTitle, Text: ATypographyText, Paragraph: ATypographyParagraph } =
|
|
|
|
|
|
Typography;
|
2026-09-15 14:10:52 +03:30
|
|
|
|
|
2026-11-03 16:51:51 +03:30
|
|
|
|
/** فقط عکس واقعی کاربر؛ پیشفرض عمومی را نشان نده */
|
|
|
|
|
|
const hasCustomPhoto = computed(() => Boolean(auth.user?.hasAvatar));
|
2026-09-21 16:58:49 +03:30
|
|
|
|
|
|
|
|
|
|
const shortcutLabel = computed(() =>
|
|
|
|
|
|
typeof navigator !== 'undefined' && /Mac|iPhone|iPad/i.test(navigator.platform)
|
|
|
|
|
|
? '⌘K'
|
|
|
|
|
|
: 'Ctrl+K',
|
|
|
|
|
|
);
|
2026-11-03 16:51:51 +03:30
|
|
|
|
|
|
|
|
|
|
const statusMessage = computed(() => {
|
|
|
|
|
|
if (props.asking) return props.statusText || 'در حال پاسخ…';
|
|
|
|
|
|
if (props.askError) return props.askError;
|
|
|
|
|
|
if (props.askAnswer) return props.askAnswer;
|
|
|
|
|
|
return '';
|
|
|
|
|
|
});
|
2026-09-01 16:05:29 +03:30
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
2026-11-03 16:51:51 +03:30
|
|
|
|
<div class="flex flex-col gap-3">
|
2026-11-05 14:46:35 +03:30
|
|
|
|
<div class="home-hero">
|
|
|
|
|
|
<div class="home-hero__gradient" aria-hidden="true" />
|
|
|
|
|
|
<div class="home-hero__pattern" aria-hidden="true" />
|
|
|
|
|
|
<div class="home-hero__orb home-hero__orb--start" aria-hidden="true" />
|
|
|
|
|
|
<div class="home-hero__orb home-hero__orb--end" aria-hidden="true" />
|
2026-09-01 16:05:29 +03:30
|
|
|
|
|
2026-11-05 14:46:35 +03:30
|
|
|
|
<div class="home-hero__row">
|
|
|
|
|
|
<div class="home-hero__greet">
|
|
|
|
|
|
<div class="home-hero__identity" :aria-label="firstName">
|
2026-11-03 16:51:51 +03:30
|
|
|
|
<div class="home-hero__frame">
|
|
|
|
|
|
<img
|
|
|
|
|
|
v-if="hasCustomPhoto"
|
|
|
|
|
|
:src="auth.avatarSrc"
|
|
|
|
|
|
:alt="firstName"
|
|
|
|
|
|
class="home-hero__photo"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<span v-else class="home-hero__monogram" aria-hidden="true">
|
|
|
|
|
|
{{ userInitial }}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span class="home-hero__online" title="آنلاین" aria-hidden="true" />
|
|
|
|
|
|
</div>
|
2026-11-05 14:46:35 +03:30
|
|
|
|
<div class="home-hero__copy">
|
|
|
|
|
|
<p class="home-hero__brand">{{ brand.nameFa }}</p>
|
|
|
|
|
|
<a-typography-title :level="4" class="home-hero__title">
|
2026-11-03 16:51:51 +03:30
|
|
|
|
{{ greeting }}، {{ firstName }}
|
|
|
|
|
|
</a-typography-title>
|
2026-11-05 14:46:35 +03:30
|
|
|
|
<a-typography-text class="home-hero__subtitle">
|
2026-11-03 16:51:51 +03:30
|
|
|
|
از دادهها بپرسید یا کار امروز را از همینجا شروع کنید
|
|
|
|
|
|
</a-typography-text>
|
|
|
|
|
|
</div>
|
2026-09-01 16:05:29 +03:30
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-11-05 14:46:35 +03:30
|
|
|
|
<div class="home-hero__ask">
|
|
|
|
|
|
<span class="home-hero__ask-ico" aria-hidden="true">
|
2026-11-03 16:51:51 +03:30
|
|
|
|
<SearchOutlined />
|
2026-09-02 16:06:17 +03:30
|
|
|
|
</span>
|
2026-11-03 16:51:51 +03:30
|
|
|
|
<a-input
|
2026-09-21 16:58:49 +03:30
|
|
|
|
id="home-hero-ask"
|
|
|
|
|
|
:value="askQuery"
|
|
|
|
|
|
:placeholder="brand.askPlaceholderFa"
|
|
|
|
|
|
:disabled="asking"
|
2026-11-03 16:51:51 +03:30
|
|
|
|
:bordered="false"
|
2026-11-05 14:46:35 +03:30
|
|
|
|
class="home-hero__ask-input"
|
2026-11-03 16:51:51 +03:30
|
|
|
|
@update:value="emit('update:askQuery', $event)"
|
|
|
|
|
|
@press-enter="emit('ask')"
|
2026-09-21 16:58:49 +03:30
|
|
|
|
/>
|
2026-11-05 14:46:35 +03:30
|
|
|
|
<kbd class="home-hero__ask-kbd">{{ shortcutLabel }}</kbd>
|
2026-11-03 16:51:51 +03:30
|
|
|
|
<a-button
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
shape="round"
|
|
|
|
|
|
:disabled="asking"
|
|
|
|
|
|
:loading="asking"
|
|
|
|
|
|
aria-label="ارسال"
|
|
|
|
|
|
@click="emit('ask')"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template #icon><SendOutlined /></template>
|
2026-11-05 14:46:35 +03:30
|
|
|
|
<span class="home-hero__ask-label">بپرس</span>
|
2026-11-03 16:51:51 +03:30
|
|
|
|
</a-button>
|
|
|
|
|
|
</div>
|
2026-09-21 16:58:49 +03:30
|
|
|
|
</div>
|
2026-09-01 16:05:29 +03:30
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-11-03 16:51:51 +03:30
|
|
|
|
<div
|
|
|
|
|
|
v-if="statusMessage"
|
|
|
|
|
|
class="rounded-xl border px-3.5 py-2.5"
|
|
|
|
|
|
:class="
|
|
|
|
|
|
askError
|
|
|
|
|
|
? 'border-rose-200 bg-rose-50/70'
|
|
|
|
|
|
: asking
|
|
|
|
|
|
? 'border-emerald-200/70 bg-emerald-50/50'
|
|
|
|
|
|
: 'border-slate-200 bg-slate-50/80'
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
<a-typography-paragraph
|
|
|
|
|
|
:type="askError ? 'danger' : 'secondary'"
|
|
|
|
|
|
:ellipsis="{ rows: 3 }"
|
|
|
|
|
|
class="!mb-0 !text-sm"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ statusMessage }}
|
|
|
|
|
|
</a-typography-paragraph>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-09-01 16:05:29 +03:30
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
2026-11-05 14:46:35 +03:30
|
|
|
|
.home-hero {
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
border-radius: 1rem;
|
|
|
|
|
|
border: 1px solid rgb(110 231 183 / 0.5);
|
|
|
|
|
|
box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__gradient,
|
|
|
|
|
|
.home-hero__pattern,
|
|
|
|
|
|
.home-hero__orb {
|
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__gradient,
|
|
|
|
|
|
.home-hero__pattern {
|
|
|
|
|
|
inset: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-03 16:51:51 +03:30
|
|
|
|
.home-hero__gradient {
|
|
|
|
|
|
background:
|
2026-09-02 16:06:17 +03:30
|
|
|
|
linear-gradient(
|
2026-11-03 16:51:51 +03:30
|
|
|
|
115deg,
|
|
|
|
|
|
#ecfdf5 0%,
|
|
|
|
|
|
#d1fae5 28%,
|
|
|
|
|
|
#ccfbf1 55%,
|
|
|
|
|
|
#f0fdfa 78%,
|
|
|
|
|
|
#ffffff 100%
|
2026-09-02 16:06:17 +03:30
|
|
|
|
);
|
2026-09-01 16:05:29 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-03 16:51:51 +03:30
|
|
|
|
.home-hero__pattern {
|
|
|
|
|
|
opacity: 0.45;
|
|
|
|
|
|
background-image:
|
|
|
|
|
|
radial-gradient(circle at 1px 1px, rgba(16, 185, 129, 0.28) 1px, transparent 0),
|
|
|
|
|
|
linear-gradient(
|
|
|
|
|
|
135deg,
|
|
|
|
|
|
rgba(20, 184, 166, 0.08) 25%,
|
|
|
|
|
|
transparent 25%,
|
|
|
|
|
|
transparent 50%,
|
|
|
|
|
|
rgba(20, 184, 166, 0.08) 50%,
|
|
|
|
|
|
rgba(20, 184, 166, 0.08) 75%,
|
|
|
|
|
|
transparent 75%,
|
|
|
|
|
|
transparent
|
|
|
|
|
|
);
|
|
|
|
|
|
background-size:
|
|
|
|
|
|
18px 18px,
|
|
|
|
|
|
28px 28px;
|
2026-11-05 14:46:35 +03:30
|
|
|
|
mask-image: linear-gradient(to left, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.25));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__orb {
|
|
|
|
|
|
border-radius: 999px;
|
|
|
|
|
|
filter: blur(48px);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__orb--start {
|
|
|
|
|
|
inset-inline-end: -5rem;
|
|
|
|
|
|
top: -6rem;
|
|
|
|
|
|
width: 13rem;
|
|
|
|
|
|
height: 13rem;
|
|
|
|
|
|
background: rgb(52 211 153 / 0.2);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__orb--end {
|
|
|
|
|
|
inset-inline-start: -4rem;
|
|
|
|
|
|
bottom: -5rem;
|
|
|
|
|
|
width: 12rem;
|
|
|
|
|
|
height: 12rem;
|
|
|
|
|
|
background: rgb(20 184 166 / 0.15);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__row {
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
z-index: 1;
|
|
|
|
|
|
display: grid;
|
|
|
|
|
|
grid-template-columns: auto minmax(0, 1fr);
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 1rem;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
padding: 1rem 1.25rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__greet {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 0.875rem;
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
max-width: 22rem;
|
2026-09-01 16:05:29 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-03 16:51:51 +03:30
|
|
|
|
.home-hero__identity {
|
2026-11-05 14:46:35 +03:30
|
|
|
|
position: relative;
|
|
|
|
|
|
flex-shrink: 0;
|
2026-11-03 16:51:51 +03:30
|
|
|
|
width: 3.25rem;
|
|
|
|
|
|
height: 3.25rem;
|
2026-09-01 16:05:29 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-03 16:51:51 +03:30
|
|
|
|
.home-hero__frame {
|
2026-09-02 16:06:17 +03:30
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
2026-11-03 16:51:51 +03:30
|
|
|
|
border-radius: 1rem;
|
|
|
|
|
|
padding: 2px;
|
|
|
|
|
|
background: linear-gradient(145deg, #34d399 0%, #0d9488 48%, #059669 100%);
|
|
|
|
|
|
box-shadow:
|
|
|
|
|
|
0 0 0 3px rgba(255, 255, 255, 0.85),
|
|
|
|
|
|
0 8px 18px -10px rgba(4, 120, 87, 0.55);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__photo,
|
|
|
|
|
|
.home-hero__monogram {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
border-radius: calc(1rem - 2px);
|
2026-09-02 16:06:17 +03:30
|
|
|
|
object-fit: cover;
|
2026-09-01 16:05:29 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-03 16:51:51 +03:30
|
|
|
|
.home-hero__monogram {
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
font-size: 1.15rem;
|
|
|
|
|
|
font-weight: 800;
|
|
|
|
|
|
color: #ecfdf5;
|
|
|
|
|
|
background:
|
|
|
|
|
|
radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.22), transparent 45%),
|
|
|
|
|
|
linear-gradient(160deg, #10b981 0%, #0f766e 100%);
|
|
|
|
|
|
letter-spacing: -0.02em;
|
|
|
|
|
|
user-select: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__online {
|
2026-09-01 16:05:29 +03:30
|
|
|
|
position: absolute;
|
2026-11-05 14:46:35 +03:30
|
|
|
|
inset-inline-start: -1px;
|
2026-11-03 16:51:51 +03:30
|
|
|
|
bottom: -1px;
|
|
|
|
|
|
width: 0.85rem;
|
|
|
|
|
|
height: 0.85rem;
|
2026-09-01 16:05:29 +03:30
|
|
|
|
border-radius: 999px;
|
2026-11-03 16:51:51 +03:30
|
|
|
|
background: #10b981;
|
2026-09-01 16:05:29 +03:30
|
|
|
|
border: 2px solid #fff;
|
2026-11-03 16:51:51 +03:30
|
|
|
|
box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25);
|
2026-09-01 16:05:29 +03:30
|
|
|
|
}
|
2026-11-05 14:46:35 +03:30
|
|
|
|
|
|
|
|
|
|
.home-hero__copy {
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__brand {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
font-size: 11px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
letter-spacing: 0.02em;
|
|
|
|
|
|
color: rgb(4 120 87 / 0.8);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__title {
|
|
|
|
|
|
margin: 0.125rem 0 0 !important;
|
|
|
|
|
|
color: #1e293b !important;
|
|
|
|
|
|
font-size: 1.125rem !important;
|
|
|
|
|
|
font-weight: 800 !important;
|
|
|
|
|
|
line-height: 1.75rem !important;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__subtitle {
|
|
|
|
|
|
display: block !important;
|
|
|
|
|
|
margin-top: 0.125rem !important;
|
|
|
|
|
|
color: #64748b !important;
|
|
|
|
|
|
font-size: 0.875rem !important;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__ask {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
padding-block: 0.375rem;
|
|
|
|
|
|
padding-inline: 0.75rem 0.5rem;
|
|
|
|
|
|
background: #fff;
|
|
|
|
|
|
border: 1px solid rgb(255 255 255 / 0.8);
|
|
|
|
|
|
border-radius: 1rem;
|
|
|
|
|
|
box-shadow:
|
|
|
|
|
|
0 4px 12px rgb(6 78 59 / 0.05),
|
|
|
|
|
|
0 1px 2px rgb(15 23 42 / 0.04);
|
|
|
|
|
|
transition:
|
|
|
|
|
|
border-color 0.15s ease,
|
|
|
|
|
|
box-shadow 0.15s ease;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__ask:focus-within {
|
|
|
|
|
|
border-color: #6ee7b7;
|
|
|
|
|
|
box-shadow:
|
|
|
|
|
|
0 0 0 2px rgb(167 243 208 / 0.7),
|
|
|
|
|
|
0 4px 12px rgb(6 78 59 / 0.05);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__ask-ico {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
width: 2rem;
|
|
|
|
|
|
height: 2rem;
|
|
|
|
|
|
border-radius: 0.75rem;
|
|
|
|
|
|
background: #ecfdf5;
|
|
|
|
|
|
color: #059669;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__ask-input {
|
|
|
|
|
|
flex: 1 1 auto;
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
background: transparent !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__ask-kbd {
|
|
|
|
|
|
display: none;
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
padding: 0.25rem 0.5rem;
|
|
|
|
|
|
border-radius: 0.5rem;
|
|
|
|
|
|
border: 1px solid #e2e8f0;
|
|
|
|
|
|
background: #f8fafc;
|
|
|
|
|
|
color: #94a3b8;
|
|
|
|
|
|
font-size: 11px;
|
|
|
|
|
|
font-family: ui-sans-serif, system-ui, sans-serif;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__ask-label {
|
|
|
|
|
|
display: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@media (min-width: 640px) {
|
|
|
|
|
|
.home-hero__ask-kbd {
|
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__ask-label {
|
|
|
|
|
|
display: inline;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__title {
|
|
|
|
|
|
font-size: 1.25rem !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@media (max-width: 1023px) {
|
|
|
|
|
|
.home-hero__row {
|
|
|
|
|
|
grid-template-columns: minmax(0, 1fr);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-hero__greet {
|
|
|
|
|
|
max-width: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-09-01 16:05:29 +03:30
|
|
|
|
</style>
|