Polish dashboard UI to match Mento mockup with IRANSans and brand assets.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-02 16:06:17 +03:30
co-authored by Cursor
parent 2b0c985d19
commit 574feedfa5
46 changed files with 960 additions and 422 deletions
+234 -100
View File
@@ -1,10 +1,11 @@
<script setup lang="ts">
import { computed } from 'vue';
import { RouterLink } from 'vue-router';
import UiIcon from '@/components/UiIcon.vue';
import MentoAiAvatar from '@/components/brand/MentoAiAvatar.vue';
import type { HomeDashboardAlertDto } from '@mento/shared';
defineProps<{
const props = defineProps<{
greeting: string;
firstName: string;
userInitial: string;
@@ -17,6 +18,56 @@ const emit = defineEmits<{
ask: [];
}>();
type HeroChip = {
key: string;
tone: HomeDashboardAlertDto['tone'];
title: string;
subtitle?: string;
link: string;
};
const defaultChips: HeroChip[] = [
{
key: 'demo-urgent',
tone: 'urgent',
title: 'شرکت آماده تصمیم‌گیریه',
subtitle: 'امروز تماس بگیر',
link: '/pipeline',
},
{
key: 'demo-warning',
tone: 'warning',
title: '۳ معامله بیشتر از ۵ روزه',
subtitle: 'پیگیری نشدن',
link: '/pipeline',
},
{
key: 'demo-success',
tone: 'success',
title: 'این ماه از تارگت جلوتری',
link: '/sales/forecast',
},
];
const chips = computed<HeroChip[]>(() => {
const fromApi = props.alerts.slice(0, 3).map((a) => {
const parts = a.text.split(/\s*[—\-–]\s*|\n/);
const title = parts[0]?.trim() || a.text;
const subtitle = parts.slice(1).join(' ').trim() || undefined;
return {
key: a.key,
tone: a.tone,
title,
subtitle,
link: a.link || '/',
};
});
if (fromApi.length >= 3) return fromApi;
const usedTones = new Set(fromApi.map((c) => c.tone));
const fillers = defaultChips.filter((c) => !usedTones.has(c.tone));
return [...fromApi, ...fillers].slice(0, 3);
});
function alertIcon(tone: string) {
if (tone === 'urgent') return 'fire' as const;
if (tone === 'warning') return 'warning' as const;
@@ -27,43 +78,41 @@ function alertIcon(tone: string) {
<template>
<header class="hero">
<div class="hero-pattern" aria-hidden="true" />
<div class="hero-glow a" />
<div class="hero-glow b" />
<div class="hero-surface" aria-hidden="true">
<div class="hero-glow" />
<div class="hero-mist" />
</div>
<div class="hero-body">
<div class="hero-top">
<div class="hero-greet">
<span class="hero-avatar">
{{ userInitial }}
<i class="online" />
</span>
<div>
<h1>{{ greeting }} {{ firstName }}</h1>
<p>منتو اینها رو برات پیدا کرده</p>
</div>
</div>
<div class="hero-chips">
<RouterLink
v-for="alert in alerts.slice(0, 3)"
:key="alert.key"
class="chip"
:class="`chip-${alert.tone}`"
:to="alert.link || '/'"
>
<span class="chip-ico"><UiIcon :name="alertIcon(alert.tone)" :size="14" /></span>
<span>{{ alert.text }}</span>
</RouterLink>
<span v-if="!alerts.length" class="chip chip-success">
<span class="chip-ico"><UiIcon name="trend" :size="14" /></span>
امروز آماده‌اید برای فروش بیشتر
</span>
<div class="hero-greet">
<span class="hero-avatar">
<img src="/brand/user-avatar.png" :alt="firstName" width="72" height="72" />
<i class="online" />
</span>
<div class="greet-text">
<h1>{{ greeting }} {{ firstName }} 👋</h1>
<p>منتو اینا رو برات پیدا کرده</p>
</div>
</div>
<div class="hero-chips">
<RouterLink
v-for="chip in chips"
:key="chip.key"
class="chip"
:class="`chip-${chip.tone}`"
:to="chip.link"
>
<span class="chip-ico"><UiIcon :name="alertIcon(chip.tone)" :size="13" /></span>
<span class="chip-text">
<strong>{{ chip.title }}</strong>
<small v-if="chip.subtitle">{{ chip.subtitle }}</small>
</span>
</RouterLink>
</div>
<form class="hero-ask" @submit.prevent="emit('ask')">
<UiIcon name="sparkle" :size="16" />
<UiIcon name="sparkle" :size="18" class="ask-ico" />
<input
:value="askQuery"
type="search"
@@ -74,7 +123,7 @@ function alertIcon(tone: string) {
</form>
</div>
<MentoAiAvatar class="hero-bot" :size="168" />
<MentoAiAvatar class="hero-bot" :size="156" />
</header>
</template>
@@ -82,130 +131,184 @@ function alertIcon(tone: string) {
.hero {
position: relative;
display: grid;
grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.7fr);
gap: 0.5rem 1rem;
align-items: center;
min-height: 210px;
padding: 1.4rem 1.5rem 1.35rem;
/* RTL: body سمت راست، ربات سمت چپ — فضای اضافه برای پاپ‌آپ */
grid-template-columns: minmax(0, 1fr) 210px;
gap: 0.7rem 1rem;
align-items: start;
min-height: 0;
padding: 0.8rem 1.5rem 0.9rem;
border-radius: 28px;
overflow: hidden;
overflow: visible;
color: #fff;
background: linear-gradient(105deg, #4fd1c5 0%, #14b8a6 24%, #0f766e 52%, #123a5c 100%);
box-shadow: 0 18px 40px rgba(15, 118, 110, 0.22);
background: transparent;
isolation: isolate;
}
.hero-pattern {
.hero-surface {
position: absolute;
inset: 0;
opacity: 0.12;
z-index: 0;
border-radius: 28px;
overflow: hidden;
background-color: #134e4a;
background-image:
radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.35) 0 2px, transparent 3px),
radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.25) 0 1.5px, transparent 2.5px);
background-size: 28px 28px, 18px 18px;
pointer-events: none;
radial-gradient(ellipse 55% 90% at 8% 55%, rgba(103, 232, 249, 0.55) 0%, rgba(45, 212, 191, 0.22) 35%, transparent 68%),
radial-gradient(ellipse 50% 80% at 92% 40%, rgba(153, 246, 228, 0.28) 0%, transparent 55%),
radial-gradient(ellipse 70% 60% at 45% 30%, rgba(45, 212, 191, 0.18) 0%, transparent 60%),
radial-gradient(ellipse 60% 50% at 60% 85%, rgba(15, 23, 42, 0.28) 0%, transparent 55%),
linear-gradient(
105deg,
#0b3d3a 0%,
#115e59 22%,
#0f766e 48%,
#134e4a 72%,
#0f3f3c 100%
);
box-shadow:
0 16px 36px rgba(15, 118, 110, 0.22),
inset 0 1px 0 rgba(255, 255, 255, 0.18),
inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.hero-glow {
position: absolute;
width: 320px;
height: 320px;
border-radius: 999px;
background: rgba(255, 255, 255, 0.1);
inset-inline-end: -70px;
top: 40%;
transform: translateY(-50%);
background:
radial-gradient(circle, rgba(165, 243, 252, 0.65) 0%, rgba(34, 211, 238, 0.28) 32%, transparent 68%);
filter: blur(8px);
pointer-events: none;
}
.hero-glow.a {
width: 220px;
height: 220px;
top: -90px;
inset-inline-end: 160px;
.hero-mist {
position: absolute;
inset: 0;
background:
radial-gradient(ellipse 40% 35% at 25% 20%, rgba(255, 255, 255, 0.14) 0%, transparent 70%),
radial-gradient(ellipse 35% 40% at 70% 75%, rgba(204, 251, 241, 0.12) 0%, transparent 70%),
radial-gradient(ellipse 50% 45% at 50% 50%, rgba(15, 118, 110, 0.35) 0%, transparent 75%);
pointer-events: none;
}
.hero-glow.b {
width: 140px;
height: 140px;
bottom: -55px;
inset-inline-start: 30px;
.hero-body,
.hero-bot {
position: relative;
z-index: 1;
}
.hero-body {
position: relative;
z-index: 1;
display: grid;
gap: 1rem;
}
.hero-top {
display: grid;
gap: 0.85rem;
gap: 0.75rem;
min-width: 0;
padding-top: 0;
}
.hero-greet {
display: flex;
align-items: center;
gap: 0.85rem;
gap: 0.9rem;
}
.hero-avatar {
position: relative;
width: 52px;
height: 52px;
width: 72px;
height: 72px;
border-radius: 999px;
background: rgba(255, 255, 255, 0.22);
border: 2px solid rgba(255, 255, 255, 0.45);
display: grid;
place-items: center;
font-weight: 800;
font-size: 1.2rem;
flex-shrink: 0;
box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}
.hero-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
border-radius: 999px;
border: 3px solid rgba(255, 255, 255, 0.65);
background: rgba(255, 255, 255, 0.22);
box-sizing: border-box;
}
.online {
position: absolute;
bottom: 2px;
inset-inline-start: 2px;
width: 10px;
height: 10px;
bottom: 3px;
inset-inline-start: 3px;
width: 14px;
height: 14px;
border-radius: 999px;
background: #22c55e;
border: 2px solid #fff;
z-index: 1;
}
h1 {
.greet-text h1 {
margin: 0;
font-size: clamp(1.4rem, 2.2vw, 1.8rem);
font-size: clamp(1.35rem, 2vw, 1.75rem);
font-weight: 800;
letter-spacing: -0.01em;
color: #fff;
}
p {
margin: 0.2rem 0 0;
opacity: 0.9;
font-size: 0.92rem;
.greet-text p {
margin: 0.25rem 0 0;
color: rgba(255, 255, 255, 0.88);
font-size: 0.9rem;
font-weight: 500;
}
.hero-chips {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 0.4rem;
max-width: 580px;
}
.chip {
display: inline-flex;
display: flex;
align-items: center;
gap: 0.4rem;
max-width: 100%;
padding: 0.48rem 0.75rem;
border-radius: 999px;
min-width: 0;
padding: 0.4rem 0.5rem;
border-radius: 12px;
background: #fff;
color: #0f172a;
font-size: 0.78rem;
font-weight: 600;
text-decoration: none;
box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
box-shadow: 0 6px 14px rgba(15, 23, 42, 0.07);
}
.chip-text {
display: grid;
gap: 0.04rem;
min-width: 0;
}
.chip-text strong {
font-size: 0.68rem;
font-weight: 700;
line-height: 1.3;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.chip-text small {
font-size: 0.6rem;
color: #64748b;
font-weight: 500;
line-height: 1.25;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.chip-ico {
width: 22px;
height: 22px;
border-radius: 999px;
border-radius: 8px;
display: grid;
place-items: center;
flex-shrink: 0;
@@ -231,38 +334,69 @@ p {
display: flex;
align-items: center;
gap: 0.55rem;
max-width: 440px;
background: rgba(255, 255, 255, 0.96);
max-width: 520px;
width: 100%;
background: #fff;
color: #0f172a;
border-radius: 999px;
padding: 0.58rem 0.9rem;
padding: 0.55rem 0.9rem;
box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}
.ask-ico {
color: #14b8a6;
flex-shrink: 0;
}
.hero-ask input {
border: 0;
background: transparent;
flex: 1;
outline: none;
font-size: 0.9rem;
min-width: 0;
}
.hero-ask input::placeholder {
color: #94a3b8;
}
.hero-ask kbd {
font-size: 0.68rem;
color: #94a3b8;
background: #f1f5f9;
border: 1px solid #e2e8f0;
border-radius: 7px;
padding: 0.12rem 0.35rem;
padding: 0.14rem 0.38rem;
flex-shrink: 0;
}
.hero-bot {
position: relative;
z-index: 1;
/* در RTL ستون ربات سمت چپ است؛ end = لبه بیرونی چپ */
justify-self: end;
align-self: center;
margin-inline-start: 0;
margin-inline-end: 0.35rem;
overflow: visible;
}
@media (max-width: 900px) {
.hero {
grid-template-columns: minmax(0, 1fr) 160px;
}
.hero-chips {
grid-template-columns: 1fr;
max-width: 420px;
}
}
@media (max-width: 700px) {
.hero {
grid-template-columns: 1fr;
min-height: auto;
}
.hero-bot {