feat(design): بازگرداندن ریتم تناوب پس‌زمینهٔ بخش‌ها — هر صفحه با بخش سیاه شروع و سیاه/خاکستری یکی‌درمیان ادامه می‌یابد (پراپ tone برای بخش‌های مشترک چندصفحه‌ای)

This commit is contained in:
aramesh-site deploy
2026-10-09 15:26:56 +00:00
parent 9bf2a30f8d
commit e2f6853c2c
15 changed files with 32 additions and 30 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ export function BeforeAfter() {
} }
return ( return (
<section className="bg-char py-24 lg:py-32" aria-labelledby="ba-title"> <section className="bg-ink py-24 lg:py-32" aria-labelledby="ba-title">
<div className="mx-auto max-w-site px-6 lg:px-10"> <div className="mx-auto max-w-site px-6 lg:px-10">
<SectionHeading <SectionHeading
+2 -2
View File
@@ -11,13 +11,13 @@ type FaqProps = {
hideHeading?: boolean; hideHeading?: boolean;
} }
export function Faq({ hideHeading = false }: FaqProps) { export function Faq({ hideHeading = false, tone = 'gray' }: FaqProps & { tone?: 'black' | 'gray' }) {
const { faqs } = useSite() const { faqs } = useSite()
const { t } = useLang() const { t } = useLang()
const [open, setOpen] = useState<number | null>(0) const [open, setOpen] = useState<number | null>(0)
return ( return (
<section className="bg-ink py-24 lg:py-32" aria-labelledby="faq-title"> <section className={`${tone === 'black' ? 'bg-char' : 'bg-ink'} py-24 lg:py-32`} aria-labelledby="faq-title">
<div className={hideHeading ? "mx-auto max-w-4xl px-6 lg:px-10" : "mx-auto grid max-w-site gap-14 px-6 lg:grid-cols-12 lg:px-10"}> <div className={hideHeading ? "mx-auto max-w-4xl px-6 lg:px-10" : "mx-auto grid max-w-site gap-14 px-6 lg:grid-cols-12 lg:px-10"}>
@@ -22,7 +22,7 @@ export function FeaturedProjects() {
.sort((a, b) => FEATURED_TITLES.indexOf(a.title) - FEATURED_TITLES.indexOf(b.title)) .sort((a, b) => FEATURED_TITLES.indexOf(a.title) - FEATURED_TITLES.indexOf(b.title))
return ( return (
<section className="bg-ink py-24 lg:py-32" aria-labelledby="projects-title"> <section className="bg-char py-24 lg:py-32" aria-labelledby="projects-title">
<div className="mx-auto max-w-site px-6 lg:px-10"> <div className="mx-auto max-w-site px-6 lg:px-10">
<SectionHeading title={heading.title} lead={heading.lead} headingKey="featured_projects" /> <SectionHeading title={heading.title} lead={heading.lead} headingKey="featured_projects" />
+2 -2
View File
@@ -6,7 +6,7 @@ import { useFieldSaver } from '../../admin/AdminContext'
import { InlineEdit } from '../admin/InlineEdit' import { InlineEdit } from '../admin/InlineEdit'
import { AddItemButton, EditableItem } from '../../admin/Editable' import { AddItemButton, EditableItem } from '../../admin/Editable'
export function Services() { export function Services({ tone = 'black' }: { tone?: 'black' | 'gray' } = {}) {
const { services } = useSite() const { services } = useSite()
const heading = useSectionHeading('services') const heading = useSectionHeading('services')
const save = useFieldSaver() const save = useFieldSaver()
@@ -18,7 +18,7 @@ export function Services() {
}) })
return ( return (
<section className="bg-ink py-24 lg:py-32" aria-labelledby="services-title"> <section className={`${tone === 'black' ? 'bg-char' : 'bg-ink'} py-24 lg:py-32`} aria-labelledby="services-title">
<div className="mx-auto max-w-site px-6 lg:px-10"> <div className="mx-auto max-w-site px-6 lg:px-10">
<Reveal className="max-w-2xl text-start"> <Reveal className="max-w-2xl text-start">
+2 -2
View File
@@ -65,13 +65,13 @@ function Counter({ value }: { value: string | number }) {
return <span ref={ref}>{renderValue}</span>; return <span ref={ref}>{renderValue}</span>;
} }
export function Stats() { export function Stats({ tone = 'black' }: { tone?: 'black' | 'gray' } = {}) {
const { stats } = useSite(); const { stats } = useSite();
const { t } = useLang(); const { t } = useLang();
const save = useFieldSaver(); const save = useFieldSaver();
return ( return (
<section className="bg-char py-16" aria-label={t('statsAria')}> <section className={`${tone === 'black' ? 'bg-char' : 'bg-ink'} py-16`} aria-label={t('statsAria')}>
<div className="mx-auto grid max-w-site grid-cols-2 gap-y-12 px-6 lg:grid-cols-4 lg:px-10"> <div className="mx-auto grid max-w-site grid-cols-2 gap-y-12 px-6 lg:grid-cols-4 lg:px-10">
{stats.map((stat) => {stats.map((stat) =>
<EditableItem key={stat.id} resource="stats" item={stat}> <EditableItem key={stat.id} resource="stats" item={stat}>
+4 -2
View File
@@ -14,9 +14,11 @@ type StoryProps = {
showQuote?: boolean; showQuote?: boolean;
alignTop?: boolean; alignTop?: boolean;
children?: React.ReactNode; children?: React.ReactNode;
/** پس‌زمینه: black = char (تیره) و gray = ink (روشن‌تر) — ریتم تناوب بخش‌ها */
tone?: 'black' | 'gray';
} }
export function Story({ showLink = true, showLabel = true, showQuote = false, alignTop = false, children }: StoryProps) { export function Story({ showLink = true, showLabel = true, showQuote = false, alignTop = false, tone = 'gray', children }: StoryProps) {
const { story } = useSite() const { story } = useSite()
const { href } = useLang() const { href } = useLang()
const save = useFieldSaver() const save = useFieldSaver()
@@ -33,7 +35,7 @@ export function Story({ showLink = true, showLabel = true, showQuote = false, al
} }
return ( return (
<section id="story" className="bg-ink py-24 lg:py-32" aria-labelledby="story-title"> <section id="story" className={`${tone === 'black' ? 'bg-char' : 'bg-ink'} py-24 lg:py-32`} aria-labelledby="story-title">
<div className={`mx-auto grid max-w-site gap-14 px-6 lg:grid-cols-2 lg:px-10 ${alignTop ? 'items-start' : 'items-center'}`}> <div className={`mx-auto grid max-w-site gap-14 px-6 lg:grid-cols-2 lg:px-10 ${alignTop ? 'items-start' : 'items-center'}`}>
<div> <div>
{showLabel && ( {showLabel && (
+2 -2
View File
@@ -5,11 +5,11 @@ import { useSite } from '../../api'
import { useLang } from '../../i18n/lang' import { useLang } from '../../i18n/lang'
import { AddItemButton, EditableItem } from '../../admin/Editable' import { AddItemButton, EditableItem } from '../../admin/Editable'
export function Team() { export function Team({ tone = 'gray' }: { tone?: 'black' | 'gray' } = {}) {
const { team } = useSite() const { team } = useSite()
const { t } = useLang() const { t } = useLang()
return ( return (
<section className="bg-ink py-24 lg:py-32" aria-labelledby="team-title" > <section className={`${tone === 'black' ? 'bg-char' : 'bg-ink'} py-24 lg:py-32`} aria-labelledby="team-title" >
<div className="mx-auto max-w-site px-6 lg:px-10 "> <div className="mx-auto max-w-site px-6 lg:px-10 ">
<SectionHeading <SectionHeading
title={t('fallbackTeamTitle')} title={t('fallbackTeamTitle')}
+2 -2
View File
@@ -52,7 +52,7 @@ function Item({ item, index, featured = false, onLi }: { item: Milestone; index:
) )
} }
export function Timeline() { export function Timeline({ tone = 'gray' }: { tone?: 'black' | 'gray' } = {}) {
const { timeline } = useSite() const { timeline } = useSite()
const { t } = useLang() const { t } = useLang()
const ref = useRef<HTMLOListElement>(null) const ref = useRef<HTMLOListElement>(null)
@@ -85,7 +85,7 @@ export function Timeline() {
}, []) }, [])
return ( return (
<section className="bg-char py-24 md:py-32" aria-labelledby="timeline-title"> <section className={`${tone === 'black' ? 'bg-char' : 'bg-ink'} py-24 md:py-32`} aria-labelledby="timeline-title">
<div className="mx-auto w-full max-w-site px-6 lg:px-10"> <div className="mx-auto w-full max-w-site px-6 lg:px-10">
<div className="mb-16"> <div className="mb-16">
+2 -2
View File
@@ -7,7 +7,7 @@ import { InlineEdit } from '../admin/InlineEdit';
import { useFieldSaver } from '../../admin/AdminContext'; import { useFieldSaver } from '../../admin/AdminContext';
import { useLang, formatNumber } from '../../i18n/lang'; import { useLang, formatNumber } from '../../i18n/lang';
export function WhyUs() { export function WhyUs({ tone = 'black' }: { tone?: 'black' | 'gray' } = {}) {
const { why_us } = useSite(); const { why_us } = useSite();
const { lang } = useLang(); const { lang } = useLang();
const heading = useSectionHeading('why_us'); const heading = useSectionHeading('why_us');
@@ -20,7 +20,7 @@ export function WhyUs() {
}); });
return ( return (
<section className="bg-ink py-24 lg:py-32" aria-labelledby="why-title"> <section className={`${tone === 'black' ? 'bg-char' : 'bg-ink'} py-24 lg:py-32`} aria-labelledby="why-title">
<div className="mx-auto grid max-w-site gap-14 px-6 lg:grid-cols-12 lg:px-10"> <div className="mx-auto grid max-w-site gap-14 px-6 lg:grid-cols-12 lg:px-10">
<div className="lg:col-span-5"> <div className="lg:col-span-5">
<SectionHeading <SectionHeading
+5 -5
View File
@@ -12,12 +12,12 @@ export function About() {
<> <>
<PageHero pageKey="about" /> <PageHero pageKey="about" />
<Story showLink={false} showLabel={false} showQuote={true} alignTop={true} /> <Story showLink={false} showLabel={false} showQuote={true} alignTop={true} tone="black" />
<Stats /> <Stats tone="gray" />
<Timeline /> <Timeline tone="black" />
<WhyUs /> <WhyUs tone="gray" />
<Team /> <Team tone="black" />
<ContactSection /> <ContactSection />
</> </>
) )
+2 -2
View File
@@ -166,7 +166,7 @@ export function ArticleDetail() {
</div> </div>
</section> </section>
<article className="bg-ink py-20 lg:py-28"> <article className="bg-char py-20 lg:py-28">
<div className="mx-auto max-w-site px-6 lg:px-10"> <div className="mx-auto max-w-site px-6 lg:px-10">
<div <div
dir={dir} dir={dir}
@@ -214,7 +214,7 @@ export function ArticleDetail() {
</div> </div>
</article> </article>
<section className="bg-char py-20 lg:py-28" aria-label={t('relatedArticlesAria')}> <section className="bg-ink py-20 lg:py-28" aria-label={t('relatedArticlesAria')}>
<div className="mx-auto max-w-site px-6 lg:px-10"> <div className="mx-auto max-w-site px-6 lg:px-10">
<h2 className="text-section font-bold text-ivory">{t('relatedArticles')}</h2> <h2 className="text-section font-bold text-ivory">{t('relatedArticles')}</h2>
<div className="mt-6 h-px w-24 bg-copper/70" /> <div className="mt-6 h-px w-24 bg-copper/70" />
+2 -2
View File
@@ -46,7 +46,7 @@ export function Blog() {
return ( return (
<> <>
<PageHero pageKey="blog" /> <PageHero pageKey="blog" />
<section className="bg-ink py-24 lg:py-32" aria-label={t('articlesAria')}> <section className="bg-char py-24 lg:py-32" aria-label={t('articlesAria')}>
<div className="mx-auto max-w-site px-6 text-center lg:px-10"> <div className="mx-auto max-w-site px-6 text-center lg:px-10">
<h2 className="text-3xl font-bold text-ivory">{t('blogEmpty')}</h2> <h2 className="text-3xl font-bold text-ivory">{t('blogEmpty')}</h2>
<p className="mt-4 text-sm font-light text-ivory/60"> <p className="mt-4 text-sm font-light text-ivory/60">
@@ -66,7 +66,7 @@ export function Blog() {
<> <>
<PageHero pageKey="blog" /> <PageHero pageKey="blog" />
<section className="bg-ink py-24 lg:py-32" aria-label={t('articlesAria')}> <section className="bg-char py-24 lg:py-32" aria-label={t('articlesAria')}>
<div className="mx-auto max-w-site px-6 lg:px-10"> <div className="mx-auto max-w-site px-6 lg:px-10">
<div className="mb-10 flex justify-start">{writeButton}</div> <div className="mb-10 flex justify-start">{writeButton}</div>
<Reveal> <Reveal>
+1 -1
View File
@@ -8,7 +8,7 @@ export function FaqPage() {
<> <>
<PageHero pageKey="faq" /> <PageHero pageKey="faq" />
<Faq hideHeading={true} /> <Faq hideHeading={true} tone="black" />
<ContactSection /> <ContactSection />
</> </>
+2 -2
View File
@@ -15,7 +15,7 @@ export function Investment() {
<> <>
<PageHero pageKey="investment" /> <PageHero pageKey="investment" />
<section className="bg-ink py-24 lg:py-32" aria-labelledby="models-title"> <section className="bg-char py-24 lg:py-32" aria-labelledby="models-title">
<div className="mx-auto max-w-site px-6 lg:px-10"> <div className="mx-auto max-w-site px-6 lg:px-10">
<SectionHeading title={heading.title} lead={heading.lead} align="center" /> <SectionHeading title={heading.title} lead={heading.lead} align="center" />
<div className="mt-14 grid gap-6 lg:grid-cols-3"> <div className="mt-14 grid gap-6 lg:grid-cols-3">
@@ -51,7 +51,7 @@ export function Investment() {
</div> </div>
</section> </section>
<Stats /> <Stats tone="gray" />
<ContactSection /> <ContactSection />
</> </>
) )
+2 -2
View File
@@ -36,11 +36,11 @@ export function ServicesPage() {
</div> </div>
</section> </section>
<Services /> <Services tone="gray" />
<Faq /> <Faq tone="black" />
<ContactSection /> <ContactSection />
</> </>
) )