Compare commits
2
Commits
f1046a6598
...
07da45467b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07da45467b | ||
|
|
4b9cc13163 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
+13
-8
@@ -1,5 +1,4 @@
|
||||
/* @import url() FONT IMPORTS MUST ALWAYS BE AT THE VERY TOP OF THIS FILE, ABOVE THE TAILWIND IMPORTS — DO NOT DELETE THIS COMMENT */
|
||||
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100..900&display=swap');
|
||||
|
||||
/* CRITICAL: THE FOLLOWING TAILWIND IMPORTS MUST NEVER BE DELETED OR REORDERED — DO NOT DELETE THIS COMMENT */
|
||||
@import 'tailwindcss/base';
|
||||
@@ -8,17 +7,23 @@
|
||||
|
||||
/* END TAILWIND IMPORTS — ALL OTHER CSS MUST GO BELOW THIS LINE */
|
||||
|
||||
/* فونت Vazirmatn سلفهاست شده (public/fonts) — قبلاً از fontcdn.ir (از کار افتاده) و
|
||||
گوگلفونت (مسدود در ایران) دانلود میشد که هر دو عملاً در دسترس نبودند */
|
||||
@font-face {
|
||||
font-family: 'Pinar';
|
||||
src: url('https://cdn.fontcdn.ir/Font/Persian/Pinar/Pinar.woff2') format('woff2'),
|
||||
url('https://cdn.fontcdn.ir/Font/Persian/Pinar/Pinar.woff') format('woff');
|
||||
font-family: 'Vazirmatn';
|
||||
src: url('/fonts/Vazirmatn-Light.woff2') format('woff2');
|
||||
font-weight: 300;
|
||||
font-display: swap;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Vazirmatn';
|
||||
src: url('/fonts/Vazirmatn-Regular.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Pinar';
|
||||
src: url('https://cdn.fontcdn.ir/Font/Persian/Pinar/Pinar-Bold.woff2') format('woff2'),
|
||||
url('https://cdn.fontcdn.ir/Font/Persian/Pinar/Pinar-Bold.woff') format('woff');
|
||||
font-family: 'Vazirmatn';
|
||||
src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2');
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
}
|
||||
@@ -28,7 +33,7 @@ html {
|
||||
body {
|
||||
background-color: #27221c;
|
||||
color: #f5f3ef;
|
||||
font-family: 'Pinar', 'Vazirmatn', Tahoma, sans-serif;
|
||||
font-family: 'Vazirmatn', Tahoma, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
::selection {
|
||||
|
||||
+16
-18
@@ -7,6 +7,7 @@ import { ArticleCard } from '../components/ArticleCard'
|
||||
import { Newsletter } from '../components/home/Newsletter'
|
||||
import { useSite } from '../api'
|
||||
import { EditableItem } from '../admin/Editable'
|
||||
import { useAdmin } from '../admin/AdminContext'
|
||||
import { PlusIcon } from 'lucide-react'
|
||||
|
||||
function DraftBadge({ className = '' }: { className?: string }) {
|
||||
@@ -21,6 +22,19 @@ function DraftBadge({ className = '' }: { className?: string }) {
|
||||
|
||||
export function Blog() {
|
||||
const { articles } = useSite()
|
||||
const { isEditMode } = useAdmin()
|
||||
|
||||
// دکمه «نوشتن مقاله جدید» فقط در حالت ویرایش ادمین دیده میشود
|
||||
const writeButton = isEditMode ? (
|
||||
<Link
|
||||
to="/admin/write"
|
||||
data-admin-link
|
||||
className="inline-flex items-center gap-2 bg-copper px-6 py-3 text-sm font-bold text-char transition-transform duration-200 hover:scale-105"
|
||||
>
|
||||
<PlusIcon className="h-4 w-4" />
|
||||
نوشتن مقاله جدید
|
||||
</Link>
|
||||
) : null
|
||||
|
||||
// حالت خالی — وبلاگ بدون مقاله نباید کرش کند
|
||||
if (articles.length === 0) {
|
||||
@@ -33,14 +47,7 @@ export function Blog() {
|
||||
<p className="mt-4 text-sm font-light text-ivory/60">
|
||||
بهزودی نخستین نوشتههای ما اینجا منتشر میشود.
|
||||
</p>
|
||||
<Link
|
||||
to="/admin/write"
|
||||
data-admin-link
|
||||
className="mt-8 inline-flex items-center gap-2 bg-copper px-6 py-3 text-sm font-bold text-char transition-transform duration-200 hover:scale-105"
|
||||
>
|
||||
<PlusIcon className="h-4 w-4" />
|
||||
نوشتن مقاله جدید
|
||||
</Link>
|
||||
<div className="mt-8 flex justify-center">{writeButton}</div>
|
||||
</div>
|
||||
</section>
|
||||
<Newsletter />
|
||||
@@ -56,16 +63,7 @@ export function Blog() {
|
||||
|
||||
<section className="bg-ink py-24 lg:py-32" aria-label="مقالات">
|
||||
<div className="mx-auto max-w-site px-6 lg:px-10">
|
||||
<div className="mb-10 flex justify-start">
|
||||
<Link
|
||||
to="/admin/write"
|
||||
data-admin-link
|
||||
className="flex items-center gap-2 bg-copper px-6 py-3 text-sm font-bold text-char transition-transform duration-200 hover:scale-105"
|
||||
>
|
||||
<PlusIcon className="h-4 w-4" />
|
||||
نوشتن مقاله جدید
|
||||
</Link>
|
||||
</div>
|
||||
<div className="mb-10 flex justify-start">{writeButton}</div>
|
||||
<Reveal>
|
||||
<EditableItem resource="articles" item={featured} editHref={`/admin/write/${featured.id}`}>
|
||||
<Link
|
||||
|
||||
@@ -9,7 +9,9 @@ export default {
|
||||
ivory: '#F5F3EF',
|
||||
},
|
||||
fontFamily: {
|
||||
pinar: ['Pinar', 'Vazirmatn', 'Tahoma', 'sans-serif'],
|
||||
// نام کلاس «pinar» برای سازگاری با همه کامپوننتها نگه داشته شده؛
|
||||
// فونت واقعی سلفهاست Vazirmatn است (public/fonts — ببینید src/index.css)
|
||||
pinar: ['Vazirmatn', 'Tahoma', 'sans-serif'],
|
||||
},
|
||||
transitionTimingFunction: {
|
||||
lux: 'cubic-bezier(0.23, 1, 0.32, 1)',
|
||||
|
||||
Reference in New Issue
Block a user