Applies to both user-app and user-app-v2. Logic and structure are shared; each app keeps its own look. Appearance settings - New "تنظیمات ظاهری" page (/settings/appearance), opened from the dashboard and available without login. It offers a light/dark/system theme and a "fast & light" motion switch. - appearanceStore saves the choice to localStorage. A small inline boot script in index.html applies it before first paint so there is no white flash. The "system" option follows OS changes live. - New ToggleSwitch component. Dark mode - Theme LESS tokens now compile to CSS custom properties. Light/dark values come from a generated virtual:palette.css (themeConfig/ appearance.ts, with colors.json + new colors.dark.json). - New LESS alpha() plugin replaces fade() on theme tokens. - New semantic tokens: page, onInk, heroSurface, hairlineStrong, photoMat, photoStage. - The dark palette is layered (page < card < panel < border) so surfaces separate without shadows. - Hard-coded colors were replaced by tokens according to their role. - antd inputs/text get dark overrides; vant uses its own .van-theme-dark. - Light mode looks the same as before. Reduced motion - With html.motion-reduced, transitions are capped at 120ms, keyframe loops stop, and backdrop blurs and permanent will-change are dropped. - Spinners and the toast progress bar (which closes the toast) are exempt via .keep-motion. - Carousel autoplay, the v1 Lottie and the product morph honor the setting. Product detail - Opening a product is now a container-transform morph from the tapped card (ProductMorph). It replaces the bottom Drawer and uses composited transform/opacity only. - The detail view is seeded with the card's data, so it no longer opens blank and jumps. Filters and sheets - Filters are now a full-width bottom sheet. Selections stay a draft until applied, so the result list no longer re-renders while dragging the slider. - DropDown collapse animates grid-template-rows instead of a capped max-height. - v2 IslandSheet is restyled to the v2 design language (API unchanged). Fixes - filtersStore.reset() shallow-copied shared arrays, so clearing the filters never cleared the selected brands.
121 lines
2.6 KiB
Vue
121 lines
2.6 KiB
Vue
<!--
|
|
Sticky translucent page bar in the redesigned design language, extracted from
|
|
the home screen's own `.home__bar` so every other screen gets the identical
|
|
chrome instead of the old dark AppHeader.
|
|
|
|
Layout mirrors the home bar exactly: a leading action (usually back), a
|
|
centred title, and an optional trailing action via the `trailing` slot — so
|
|
the bar's height, blur, hairline and icon buttons stay consistent app-wide.
|
|
-->
|
|
<template>
|
|
<header class="bar">
|
|
<div class="bar__inner">
|
|
<button v-if="back" type="button" class="bar__btn" aria-label="بازگشت" @click="onBack">
|
|
<Icon icon="vuesax-linear:arrow-right-1" size="20" />
|
|
</button>
|
|
<span v-else class="bar__spacer" aria-hidden="true" />
|
|
|
|
<h1 class="bar__title">{{ title }}</h1>
|
|
|
|
<div class="bar__trailing">
|
|
<slot name="trailing">
|
|
<span class="bar__spacer" aria-hidden="true" />
|
|
</slot>
|
|
</div>
|
|
</div>
|
|
<slot name="below" />
|
|
</header>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { useRouter } from 'vue-router'
|
|
import Icon from '../icon/Icon.vue'
|
|
|
|
const props = withDefaults(
|
|
defineProps<{
|
|
title: string
|
|
/** Show the back button. */
|
|
back?: boolean
|
|
/** Route name to go to instead of history.back(). */
|
|
backTo?: string
|
|
/** Custom back handler; wins over backTo and history (e.g. a multi-step form stepping back). */
|
|
backAction?: () => void
|
|
}>(),
|
|
{ back: true },
|
|
)
|
|
|
|
const router = useRouter()
|
|
|
|
function onBack() {
|
|
if (props.backAction) props.backAction()
|
|
else if (props.backTo) router.push({ name: props.backTo })
|
|
else router.back()
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
.bar {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
z-index: 20;
|
|
background: alpha(@canvas, 88%);
|
|
backdrop-filter: blur(14px);
|
|
border-bottom: 1px solid @hairline;
|
|
}
|
|
|
|
.bar__inner {
|
|
max-width: 768px;
|
|
margin: 0 auto;
|
|
padding: 11px 16px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 12px;
|
|
}
|
|
|
|
.bar__title {
|
|
margin: 0;
|
|
font-size: 14.5px;
|
|
font-weight: 800;
|
|
color: @ink;
|
|
letter-spacing: -0.1px;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.bar__btn {
|
|
position: relative;
|
|
flex: 0 0 auto;
|
|
width: 38px;
|
|
height: 38px;
|
|
border: 0;
|
|
cursor: pointer;
|
|
border-radius: 12px;
|
|
display: grid;
|
|
place-items: center;
|
|
color: @ink;
|
|
background: @hairlineSoft;
|
|
transition: background 0.18s ease;
|
|
}
|
|
|
|
.bar__btn:active {
|
|
transform: scale(0.94);
|
|
}
|
|
|
|
.bar__trailing {
|
|
flex: 0 0 auto;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.bar__spacer {
|
|
display: block;
|
|
width: 38px;
|
|
height: 38px;
|
|
}
|
|
</style>
|