feat(web): adopt vuesax icons and shared skeleton loading
Replace the inline SVG icon set with the vuesax linear pack, add skeleton primitives for loading states, and keep page scroll inside the app shell. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { SearchOutlined, SendOutlined } from '@ant-design/icons-vue';
|
||||
import { SearchOutlined, SendOutlined } from '@/icons/ant-bridge';
|
||||
import {
|
||||
Button as AButton,
|
||||
Input as AInput,
|
||||
@@ -48,26 +48,15 @@ const statusMessage = computed(() => {
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col gap-3">
|
||||
<div class="home-hero relative overflow-hidden rounded-2xl border border-emerald-300/50 shadow-sm">
|
||||
<!-- base gradient -->
|
||||
<div class="home-hero__gradient pointer-events-none absolute inset-0" aria-hidden="true" />
|
||||
<!-- geometric pattern -->
|
||||
<div class="home-hero__pattern pointer-events-none absolute inset-0" aria-hidden="true" />
|
||||
<!-- soft orbs -->
|
||||
<div
|
||||
class="pointer-events-none absolute -left-20 -top-24 h-52 w-52 rounded-full bg-emerald-400/20 blur-3xl"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<div
|
||||
class="pointer-events-none absolute -right-16 -bottom-20 h-48 w-48 rounded-full bg-teal-500/15 blur-3xl"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<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" />
|
||||
|
||||
<div
|
||||
class="relative flex flex-col lg:flex-row items-stretch lg:items-center justify-between gap-4 p-4 sm:p-5"
|
||||
>
|
||||
<div class="flex items-center gap-3.5 min-w-0">
|
||||
<div class="home-hero__identity relative shrink-0" :aria-label="firstName">
|
||||
<div class="home-hero__row">
|
||||
<div class="home-hero__greet">
|
||||
<div class="home-hero__identity" :aria-label="firstName">
|
||||
<div class="home-hero__frame">
|
||||
<img
|
||||
v-if="hasCustomPhoto"
|
||||
@@ -81,29 +70,19 @@ const statusMessage = computed(() => {
|
||||
</div>
|
||||
<span class="home-hero__online" title="آنلاین" aria-hidden="true" />
|
||||
</div>
|
||||
<div class="min-w-0">
|
||||
<p class="m-0 text-[11px] font-semibold tracking-wide text-emerald-700/80">
|
||||
{{ brand.nameFa }}
|
||||
</p>
|
||||
<a-typography-title
|
||||
:level="4"
|
||||
class="!m-0 !mt-0.5 !text-slate-800 !text-lg sm:!text-xl !font-extrabold !leading-7 truncate"
|
||||
>
|
||||
<div class="home-hero__copy">
|
||||
<p class="home-hero__brand">{{ brand.nameFa }}</p>
|
||||
<a-typography-title :level="4" class="home-hero__title">
|
||||
{{ greeting }}، {{ firstName }}
|
||||
</a-typography-title>
|
||||
<a-typography-text class="!text-slate-500 !text-sm !mt-0.5 block">
|
||||
<a-typography-text class="home-hero__subtitle">
|
||||
از دادهها بپرسید یا کار امروز را از همینجا شروع کنید
|
||||
</a-typography-text>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="flex items-center gap-2 w-full lg:max-w-xl bg-white border border-white/80 rounded-2xl px-3 py-2 shadow-md shadow-emerald-900/5 focus-within:border-emerald-300 focus-within:ring-2 focus-within:ring-emerald-200/70 transition"
|
||||
>
|
||||
<span
|
||||
class="w-8 h-8 rounded-xl bg-emerald-50 text-emerald-600 flex items-center justify-center shrink-0"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<div class="home-hero__ask">
|
||||
<span class="home-hero__ask-ico" aria-hidden="true">
|
||||
<SearchOutlined />
|
||||
</span>
|
||||
<a-input
|
||||
@@ -112,15 +91,11 @@ const statusMessage = computed(() => {
|
||||
:placeholder="brand.askPlaceholderFa"
|
||||
:disabled="asking"
|
||||
:bordered="false"
|
||||
class="flex-1 !bg-transparent"
|
||||
class="home-hero__ask-input"
|
||||
@update:value="emit('update:askQuery', $event)"
|
||||
@press-enter="emit('ask')"
|
||||
/>
|
||||
<kbd
|
||||
class="hidden sm:inline-flex items-center text-[11px] font-sans text-slate-400 bg-slate-50 px-2 py-1 rounded-lg border border-slate-200 shrink-0"
|
||||
>
|
||||
{{ shortcutLabel }}
|
||||
</kbd>
|
||||
<kbd class="home-hero__ask-kbd">{{ shortcutLabel }}</kbd>
|
||||
<a-button
|
||||
type="primary"
|
||||
shape="round"
|
||||
@@ -130,7 +105,7 @@ const statusMessage = computed(() => {
|
||||
@click="emit('ask')"
|
||||
>
|
||||
<template #icon><SendOutlined /></template>
|
||||
<span class="hidden sm:inline">بپرس</span>
|
||||
<span class="home-hero__ask-label">بپرس</span>
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -159,6 +134,31 @@ const statusMessage = computed(() => {
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.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;
|
||||
}
|
||||
|
||||
.home-hero__gradient {
|
||||
background:
|
||||
linear-gradient(
|
||||
@@ -188,10 +188,55 @@ const statusMessage = computed(() => {
|
||||
background-size:
|
||||
18px 18px,
|
||||
28px 28px;
|
||||
mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.25));
|
||||
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;
|
||||
}
|
||||
|
||||
.home-hero__identity {
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
width: 3.25rem;
|
||||
height: 3.25rem;
|
||||
}
|
||||
@@ -231,7 +276,7 @@ const statusMessage = computed(() => {
|
||||
|
||||
.home-hero__online {
|
||||
position: absolute;
|
||||
left: -1px;
|
||||
inset-inline-start: -1px;
|
||||
bottom: -1px;
|
||||
width: 0.85rem;
|
||||
height: 0.85rem;
|
||||
@@ -240,4 +285,123 @@ const statusMessage = computed(() => {
|
||||
border: 2px solid #fff;
|
||||
box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25);
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user