feat(ui,ux): enhance blog mobile dark theme, add mobile theme toggle, and polish site copy
Deploy Frontend / deploy (push) Successful in 1m20s
Deploy Frontend / deploy (push) Successful in 1m20s
This commit is contained in:
1 parent
ecad3849a2
commit
ed65617433
16 files changed
+483
-392
No files matched your search
@@ -81,7 +81,7 @@ export default function Header() {
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="flex items-center gap-2 sm:gap-3">
|
||||
<a
|
||||
href="/Parsa Aghayi CV Resume.pdf"
|
||||
download
|
||||
@@ -90,6 +90,9 @@ export default function Header() {
|
||||
>
|
||||
{dict?.website.header.Button}
|
||||
</a>
|
||||
<div className="flex items-center lg:hidden">
|
||||
<ThemeToggle />
|
||||
</div>
|
||||
{dict && <BurgerButton dict={dict} />}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
setSelectedLocale,
|
||||
useSelectedLocale,
|
||||
} from "@/app/lib/hooks/use-selected-locale";
|
||||
import { ThemeToggle } from "../theme-toggle/theme-toggle";
|
||||
|
||||
type propsType = {
|
||||
clicked: boolean;
|
||||
@@ -90,6 +91,10 @@ export default function MobileMenu({ clicked, setClicked, dict }: propsType) {
|
||||
>
|
||||
{selectedLocale === "fa" ? "English" : "فارسی"}
|
||||
</Link>
|
||||
<div className="flex items-center justify-between w-full px-4 py-3 border-t border-white/20 mt-2 text-white">
|
||||
<span className="text-sm font-medium">{selectedLocale === "fa" ? "تغییر تم (تیره / روشن)" : "Switch Theme"}</span>
|
||||
<ThemeToggle />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
import Image from "next/image";
|
||||
|
||||
import React, { useState } from "react";
|
||||
import { Menu } from "lucide-react";
|
||||
import MobileMenu from "../mobile-menu/mobileMenu";
|
||||
|
||||
export default function BurgerButton() {
|
||||
@@ -8,19 +9,12 @@ export default function BurgerButton() {
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
className="flex select-none items-center justify-center whitespace-nowrap rounded-md bg-blog-purple px-2 py-1 text-[16px] font-[600] text-[#fff] sm:px-2 sm:py-2 md:hidden"
|
||||
className="flex h-9 w-9 select-none items-center justify-center rounded-xl border border-border bg-muted/60 text-foreground transition-all hover:bg-muted hover:text-primary md:hidden"
|
||||
onClick={() => setClicked(!clicked)}
|
||||
aria-label="Toggle navigation menu"
|
||||
aria-expanded={clicked}
|
||||
>
|
||||
<Image
|
||||
src={"/images/icons/burger-menu.svg"}
|
||||
width={25}
|
||||
height={25}
|
||||
alt=""
|
||||
className="burger-menu"
|
||||
aria-hidden
|
||||
/>
|
||||
<Menu className="h-5 w-5" />
|
||||
</button>
|
||||
<MobileMenu clicked={clicked} setClicked={setClicked} />
|
||||
</>
|
||||
|
||||
@@ -1,37 +1,33 @@
|
||||
import { getDictionary } from "@/app/lib/functions/dictionaries";
|
||||
import { getDefaultLocale } from "@/app/lib/functions/utils";
|
||||
import Link from "next/dist/client/link";
|
||||
import Link from "next/link";
|
||||
import Image from "next/image";
|
||||
import React from "react";
|
||||
|
||||
export default async function Footer() {
|
||||
const dict = await getDictionary(await getDefaultLocale());
|
||||
return (
|
||||
<div className="absolute bottom-0 flex w-full flex-wrap items-center justify-around gap-5 bg-white px-1 py-5">
|
||||
<Image
|
||||
src={"/images/blog/logo/logo-no-background.png"}
|
||||
width={180}
|
||||
height={50}
|
||||
alt="parsaaghayi's blog logo"
|
||||
priority
|
||||
/>
|
||||
<Image
|
||||
src={"/images/blog/icons/socials.svg"}
|
||||
width={140}
|
||||
height={50}
|
||||
alt="parsaaghayi's blog logo"
|
||||
/>
|
||||
<div className="flex items-center gap-2 whitespace-nowrap">
|
||||
<p className="py-2 text-[14px] font-[400] capitalize text-blog-text-passive">
|
||||
{dict.website.footer.Year}
|
||||
</p>
|
||||
<p className="py-2 text-[14px] font-[400] capitalize text-blog-text-passive">
|
||||
{dict.website.footer.CopyRight}
|
||||
</p>
|
||||
<Link href={"/"} className="font-bold hover:underline">
|
||||
{dict.website.footer.Name}
|
||||
</Link>
|
||||
<footer className="w-full border-t border-border bg-card dark:bg-zinc-950 px-4 py-8 text-foreground transition-colors">
|
||||
<div className="mx-auto flex max-w-[1280px] flex-col sm:flex-row items-center justify-between gap-6 px-4">
|
||||
<div className="relative h-[34px] w-[160px] dark:brightness-0 dark:invert transition-all">
|
||||
<Image
|
||||
src={"/images/blog/logo/logo-no-background.png"}
|
||||
fill
|
||||
alt="parsaaghayi blog logo"
|
||||
className="object-contain"
|
||||
priority
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2 text-xs sm:text-sm text-muted-foreground">
|
||||
<span>{dict.website.footer.Year}</span>
|
||||
<span>{dict.website.footer.CopyRight}</span>
|
||||
<span>•</span>
|
||||
<Link href={"/"} className="font-semibold text-foreground hover:text-primary transition-colors">
|
||||
{dict.website.footer.Name}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import Link from "next/link";
|
||||
import BurgerButton from "../burger-button/burgerButton";
|
||||
import SelectLanguage from "../selectLanguage/selectLanguage";
|
||||
import SubscribeModal from "../subscribe/subscribeModal";
|
||||
import { ThemeToggle } from "@/app/(routes)/(website)/components/theme-toggle/theme-toggle";
|
||||
import { cookies } from "next/headers";
|
||||
import { getDictionary } from "@/app/lib/functions/dictionaries";
|
||||
import { getDefaultLocale } from "@/app/lib/functions/utils";
|
||||
@@ -38,14 +39,8 @@ export default async function Header() {
|
||||
defaultLocale={(await cookies()).get("defaultLocale")}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex items-center justify-center gap-1 sm:gap-5">
|
||||
<Image
|
||||
src={"/images/blog/icons/search.svg"}
|
||||
width={24}
|
||||
height={24}
|
||||
alt="search icon"
|
||||
className="hidden hover:cursor-pointer sm:block"
|
||||
/>
|
||||
<div className="flex items-center justify-center gap-2 sm:gap-4">
|
||||
<ThemeToggle />
|
||||
<SubscribeModal labels={subscribeLabels} variant="header" />
|
||||
<BurgerButton />
|
||||
</div>
|
||||
|
||||
@@ -3,57 +3,59 @@ import { getDefaultLocale } from "@/app/lib/functions/utils";
|
||||
import { CategoryType } from "@/app/types/types";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { ArrowLeft, ArrowRight } from "lucide-react";
|
||||
|
||||
interface CategoriesProps {
|
||||
data: CategoryType[];
|
||||
}
|
||||
|
||||
export default async function Categories({ data }: CategoriesProps) {
|
||||
const dict = await getDictionary(await getDefaultLocale());
|
||||
const locale = await getDefaultLocale();
|
||||
const dict = await getDictionary(locale);
|
||||
const isRTL = locale === "fa";
|
||||
|
||||
if (!data || data.length === 0) return null;
|
||||
|
||||
return (
|
||||
<div className="mb-5 flex w-full max-w-[95%] flex-wrap gap-10">
|
||||
<div className="flex w-full items-center justify-between">
|
||||
<h2 className="text-[36px] font-[700] text-blog-text-default">
|
||||
<div className="mb-5 flex w-full max-w-[95%] flex-col gap-6">
|
||||
<div className="flex w-full items-center justify-between border-b border-border/40 pb-4">
|
||||
<h2 className="text-2xl sm:text-3xl font-bold tracking-tight text-foreground">
|
||||
{dict.blog.homePage.categories}
|
||||
</h2>
|
||||
<Link
|
||||
href={"/blog/categories"}
|
||||
className="text-[16px] font-[400] text-blog-text-passive hover:underline"
|
||||
href="/blog/categories"
|
||||
className="group inline-flex items-center gap-1.5 text-sm font-semibold text-primary transition-colors hover:text-primary/80"
|
||||
>
|
||||
{dict.blog.homePage.viewAll}
|
||||
<span>{dict.blog.homePage.viewAll}</span>
|
||||
{isRTL ? (
|
||||
<ArrowLeft className="h-4 w-4 transition-transform group-hover:-translate-x-0.5" />
|
||||
) : (
|
||||
<ArrowRight className="h-4 w-4 transition-transform group-hover:translate-x-0.5" />
|
||||
)}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div className="flex w-full flex-wrap items-center justify-center gap-5">
|
||||
<div className="flex w-full flex-wrap items-stretch justify-start gap-3 sm:gap-4">
|
||||
{data.map((category) => (
|
||||
<Link
|
||||
key={category.id}
|
||||
href={`/blog/categories/${category.slug}`}
|
||||
className="flex w-[45%] flex-col items-center gap-5 overflow-hidden rounded-md pb-5 shadow-md transition-all hover:scale-105 hover:shadow-lg sm:w-[30%] lg:w-[18%]"
|
||||
className="group flex w-[calc(50%-6px)] sm:w-[calc(33.333%-11px)] md:w-[calc(25%-12px)] lg:w-[calc(20%-13px)] flex-col items-center rounded-2xl border border-border bg-card p-3 shadow-sm transition-all duration-300 hover:border-primary/50 hover:shadow-md hover:-translate-y-1"
|
||||
>
|
||||
<div className="h-[200px] w-[200px] overflow-hidden">
|
||||
<div className="relative w-full aspect-square overflow-hidden rounded-xl bg-muted">
|
||||
<Image
|
||||
src={category.image || `/images/categories/${category.slug.replace(/-fa$/, "")}.webp`}
|
||||
width={300}
|
||||
height={200}
|
||||
alt={`${category.name} category image`}
|
||||
className="mt-2 rounded object-cover"
|
||||
alt={`${category.name} category`}
|
||||
fill
|
||||
className="object-cover transition-transform duration-500 group-hover:scale-105"
|
||||
sizes="(max-width: 640px) 50vw, (max-width: 1024px) 25vw, 20vw"
|
||||
/>
|
||||
</div>
|
||||
<h3 className="text-[24px] font-[600] text-blog-text-default">
|
||||
<h3 className="mt-3 text-xs sm:text-sm font-bold text-foreground text-center transition-colors group-hover:text-primary line-clamp-1">
|
||||
{category.name}
|
||||
</h3>
|
||||
</Link>
|
||||
))}
|
||||
|
||||
{/* <div className="center-center hidden h-full w-[80px] rounded-md bg-white lg:flex">
|
||||
<Image
|
||||
src={"/images/blog/icons/right-arrow.svg"}
|
||||
height={32}
|
||||
width={32}
|
||||
alt="right-arrow icon"
|
||||
/>
|
||||
</div> */}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -3,94 +3,118 @@ import { getDefaultLocale } from "@/app/lib/functions/utils";
|
||||
import { PostType } from "@/app/types/types";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { ArrowLeft, ArrowRight } from "lucide-react";
|
||||
|
||||
interface FilteredPostsProps {
|
||||
data: PostType[];
|
||||
}
|
||||
|
||||
export default async function FilteredPosts({ data }: FilteredPostsProps) {
|
||||
const dict = await getDictionary(await getDefaultLocale());
|
||||
const locale = await getDefaultLocale();
|
||||
const dict = await getDictionary(locale);
|
||||
const isRTL = locale === "fa";
|
||||
|
||||
if (!data || data.length === 0) return null;
|
||||
|
||||
const featured = data[0];
|
||||
const sidePosts = data.slice(1);
|
||||
|
||||
return (
|
||||
<div className="mb-5 flex max-w-[95%] flex-wrap gap-10">
|
||||
<div className="flex w-full items-center justify-between">
|
||||
<h2 className="text-[36px] font-[700] text-blog-text-default">
|
||||
<div className="mb-5 flex w-full max-w-[95%] flex-col gap-8">
|
||||
{/* Section Header */}
|
||||
<div className="flex w-full items-center justify-between border-b border-border/40 pb-4">
|
||||
<h2 className="text-2xl sm:text-3xl font-bold tracking-tight text-foreground">
|
||||
{dict.blog.homePage.popular}
|
||||
</h2>
|
||||
<Link
|
||||
href={"/blog/filtered-posts/popular"}
|
||||
className="text-[16px] font-[400] text-blog-text-passive hover:underline"
|
||||
href="/blog/filtered-posts/popular"
|
||||
className="group inline-flex items-center gap-1.5 text-sm font-semibold text-primary transition-colors hover:text-primary/80"
|
||||
>
|
||||
{dict.blog.homePage.viewAll}
|
||||
<span>{dict.blog.homePage.viewAll}</span>
|
||||
{isRTL ? (
|
||||
<ArrowLeft className="h-4 w-4 transition-transform group-hover:-translate-x-0.5" />
|
||||
) : (
|
||||
<ArrowRight className="h-4 w-4 transition-transform group-hover:translate-x-0.5" />
|
||||
)}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div className="flex w-full flex-wrap items-center justify-center gap-5">
|
||||
<div className="flex w-full flex-wrap justify-center gap-5 md:w-[50%]">
|
||||
{data.slice(1).map((post) => (
|
||||
<div className="flex w-full flex-col lg:flex-row items-stretch justify-center gap-6">
|
||||
{/* Side Posts Grid (Mobile: 1 col, Tablet+: 2 cols) */}
|
||||
<div className="flex w-full flex-col sm:flex-row sm:flex-wrap gap-4 lg:w-1/2">
|
||||
{sidePosts.map((post) => (
|
||||
<div
|
||||
key={post.id}
|
||||
className="flex min-h-[200px] w-[45%] flex-col justify-center gap-5 rounded-[8px] bg-white p-5 px-5 shadow-md transition-all hover:scale-105 hover:shadow-lg"
|
||||
className="group flex min-h-[170px] w-full sm:w-[calc(50%-8px)] flex-col justify-between rounded-2xl border border-border bg-card p-5 shadow-sm transition-all duration-300 hover:border-primary/50 hover:shadow-md hover:-translate-y-0.5"
|
||||
>
|
||||
<Link
|
||||
href={`/blog/categories/${post.category.slug}`}
|
||||
className="text-[14px] font-[400] text-blog-text-passive hover:underline sm:text-[16px]"
|
||||
>
|
||||
{post.category.name}
|
||||
</Link>
|
||||
<Link
|
||||
className="text-[15px] font-[600] text-blog-text-default hover:underline sm:text-[18px]"
|
||||
href={`/blog/posts/${post.slug}`}
|
||||
>
|
||||
{post.title}
|
||||
</Link>
|
||||
<div>
|
||||
<Link
|
||||
href={`/blog/categories/${post.category.slug}`}
|
||||
className="text-xs font-mono font-semibold uppercase tracking-wider text-primary transition-colors hover:underline"
|
||||
>
|
||||
{post.category.name}
|
||||
</Link>
|
||||
<Link
|
||||
className="mt-2 block text-base sm:text-lg font-bold leading-snug text-foreground transition-colors group-hover:text-primary line-clamp-3"
|
||||
href={`/blog/posts/${post.slug}`}
|
||||
>
|
||||
{post.title}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div className="mt-4 flex items-center justify-between pt-3 border-t border-border/40 text-xs text-muted-foreground">
|
||||
<span>{post.author?.name}</span>
|
||||
<span className="font-medium text-primary group-hover:underline">
|
||||
{isRTL ? "مطالعه مقاله ←" : "Read →"}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="relative flex h-[300px] w-full flex-col justify-center overflow-hidden rounded-md border sm:h-[400px] md:w-[45%]">
|
||||
{/* Large Featured Post */}
|
||||
<div className="relative flex min-h-[360px] w-full flex-col justify-end overflow-hidden rounded-2xl border border-border lg:w-1/2 group">
|
||||
<Image
|
||||
src={data[0].featured_image}
|
||||
alt={`${data[0].title} post featured_image`}
|
||||
fill={true}
|
||||
src={featured.featured_image}
|
||||
alt={`${featured.title} post featured image`}
|
||||
fill
|
||||
className="object-cover transition-transform duration-500 group-hover:scale-105"
|
||||
sizes="(max-width: 1024px) 100vw, 50vw"
|
||||
/>
|
||||
<div className="absolute z-[1] h-full w-full bg-blog-purple opacity-80"></div>
|
||||
<div className="absolute inset-0 z-[1] bg-gradient-to-t from-black/95 via-black/75 to-black/30" />
|
||||
|
||||
<div className="absolute flex flex-wrap gap-5 p-10">
|
||||
<div className="z-10 flex w-full flex-wrap items-center justify-start gap-2">
|
||||
<div className="flex">
|
||||
<p className="me-2 text-[15px] font-[400] text-white md:text-[16px]">
|
||||
{dict.blog.homePage.by}
|
||||
</p>
|
||||
<Link
|
||||
href={"/"}
|
||||
className="text-[15px] font-[400] capitalize text-white underline md:text-[16px]"
|
||||
>
|
||||
{data[0].author.name}
|
||||
</Link>
|
||||
</div>
|
||||
<div className="flex">
|
||||
<p className="me-2 text-[15px] font-[400] text-white sm:text-[16px]">
|
||||
{dict.blog.homePage.in}
|
||||
</p>
|
||||
<Link
|
||||
href={`/blog/categories/${data[0].category.slug}`}
|
||||
className="text-[15px] font-[400] text-white underline sm:text-[16px]"
|
||||
>
|
||||
{data[0].category.name}
|
||||
</Link>
|
||||
</div>
|
||||
<div className="relative z-10 flex flex-col gap-3 p-6 sm:p-8">
|
||||
<div className="flex flex-wrap items-center gap-2 text-xs">
|
||||
<span className="rounded-full bg-primary px-3 py-1 font-semibold text-primary-foreground">
|
||||
{featured.category.name}
|
||||
</span>
|
||||
<span className="text-zinc-300 font-medium">
|
||||
{dict.blog.homePage.by} {featured.author?.name}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<Link
|
||||
href={`/blog/posts/${data[0].slug}`}
|
||||
className="z-10 w-full text-[18px] font-[600] text-white hover:underline sm:text-[28px]"
|
||||
href={`/blog/posts/${featured.slug}`}
|
||||
className="text-xl sm:text-2xl font-bold leading-snug text-white transition-colors hover:text-primary line-clamp-2"
|
||||
>
|
||||
{data[0].title}
|
||||
{featured.title}
|
||||
</Link>
|
||||
|
||||
<p className="z-10 w-full text-[14px] font-[400] text-white sm:text-[16px]">
|
||||
{data[0].excerpt}
|
||||
</p>
|
||||
{featured.excerpt && (
|
||||
<p className="text-xs sm:text-sm text-zinc-300 line-clamp-2 leading-relaxed">
|
||||
{featured.excerpt}
|
||||
</p>
|
||||
)}
|
||||
|
||||
<div className="pt-2">
|
||||
<Link
|
||||
href={`/blog/posts/${featured.slug}`}
|
||||
className="inline-flex items-center gap-2 rounded-full bg-primary px-5 py-2 text-xs sm:text-sm font-semibold text-primary-foreground shadow-md transition-all hover:bg-primary/90 hover:scale-105"
|
||||
>
|
||||
<span>{dict.blog.homePage.readArticle}</span>
|
||||
{isRTL ? <ArrowLeft className="h-4 w-4" /> : <ArrowRight className="h-4 w-4" />}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { formatDate } from "@/app/lib/functions/formatDate";
|
||||
import { PostType } from "@/app/types/types";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { ArrowLeft, ArrowRight } from "lucide-react";
|
||||
import { estimateReadingTime } from "../../../posts/[postSlug]/readingTime";
|
||||
|
||||
interface NewProps {
|
||||
@@ -13,114 +14,115 @@ interface NewProps {
|
||||
export default async function New({ data }: NewProps) {
|
||||
const locale = await getDefaultLocale();
|
||||
const dict = await getDictionary(locale);
|
||||
const isRTL = locale === "fa";
|
||||
|
||||
if (!data || data.length === 0) return null;
|
||||
|
||||
const featured = data[0];
|
||||
const readingTime = estimateReadingTime(featured.body, locale);
|
||||
const featuredTags = Array.isArray(featured.tags) ? featured.tags.slice(0, 2) : [];
|
||||
const sidePosts = data.slice(1);
|
||||
|
||||
return (
|
||||
<div className="flex w-full max-w-[95%] flex-wrap justify-between gap-5">
|
||||
<div className="relative flex h-[340px] w-full flex-col justify-center overflow-hidden rounded-md border sm:h-[420px] md:h-auto md:w-[60%]">
|
||||
<div className="flex w-full max-w-[95%] flex-col lg:flex-row items-stretch justify-between gap-8">
|
||||
{/* Featured Big Banner */}
|
||||
<div className="group relative flex min-h-[380px] w-full flex-col justify-end overflow-hidden rounded-2xl border border-border lg:w-[62%]">
|
||||
<Image
|
||||
src={featured.featured_image}
|
||||
alt={`${featured.title} featured image`}
|
||||
fill={true}
|
||||
fill
|
||||
className="object-cover transition-transform duration-500 group-hover:scale-105"
|
||||
priority
|
||||
sizes="(max-width: 1024px) 100vw, 62vw"
|
||||
/>
|
||||
<div className="absolute z-[1] h-full w-full bg-blog-purple opacity-80"></div>
|
||||
<div className="absolute inset-0 z-[1] bg-gradient-to-t from-black/95 via-black/75 to-black/35" />
|
||||
|
||||
<div className="absolute flex flex-wrap gap-5 p-10">
|
||||
<div className="z-10 flex w-full flex-wrap items-center justify-start gap-2">
|
||||
<div className="flex">
|
||||
<p className="me-2 text-[15px] font-[400] text-white md:text-[16px]">
|
||||
{dict.blog.homePage.by}
|
||||
</p>
|
||||
<Link
|
||||
href={"/"}
|
||||
className="text-[15px] font-[400] capitalize text-white underline md:text-[16px]"
|
||||
>
|
||||
{featured.author.name}
|
||||
</Link>
|
||||
</div>
|
||||
<div className="flex">
|
||||
<p className="me-2 text-[15px] font-[400] text-white sm:text-[16px]">
|
||||
{dict.blog.homePage.in}
|
||||
</p>
|
||||
<Link
|
||||
href={`/blog/categories/${featured.category.slug}`}
|
||||
className="text-[15px] font-[400] text-white underline sm:text-[16px]"
|
||||
>
|
||||
{featured.category.name}
|
||||
</Link>
|
||||
</div>
|
||||
<div className="relative z-10 flex flex-col gap-3 p-6 sm:p-8">
|
||||
<div className="flex flex-wrap items-center gap-2 text-xs">
|
||||
<Link
|
||||
href={`/blog/categories/${featured.category.slug}`}
|
||||
className="rounded-full bg-primary px-3 py-1 font-semibold text-primary-foreground hover:bg-primary/90 transition-colors"
|
||||
>
|
||||
{featured.category.name}
|
||||
</Link>
|
||||
<span className="text-zinc-300 font-medium">
|
||||
{dict.blog.homePage.by} {featured.author?.name}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<Link
|
||||
href={`/blog/posts/${featured.slug}`}
|
||||
className="z-10 w-full text-[18px] font-[600] text-white hover:underline sm:text-[28px]"
|
||||
className="text-xl sm:text-3xl font-bold leading-tight text-white transition-colors hover:text-primary line-clamp-2"
|
||||
>
|
||||
{featured.title}
|
||||
</Link>
|
||||
|
||||
<p className="z-10 w-full text-[14px] font-[400] text-white sm:text-[16px]">
|
||||
{featured.excerpt}
|
||||
</p>
|
||||
|
||||
<div className="z-10 flex w-full flex-wrap items-center justify-start gap-3">
|
||||
{featuredTags.length > 0 ? (
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{featuredTags.map((tag) => (
|
||||
<Link
|
||||
key={tag.id}
|
||||
href={`/blog/tags/${tag.slug}`}
|
||||
className="rounded-full bg-white/20 px-3 py-1 text-[13px] font-[600] text-white hover:bg-white/30"
|
||||
>
|
||||
#{tag.name}
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
) : null}
|
||||
<p className="text-[13px] font-[400] text-white/90">
|
||||
{readingTime} {dict.blog.homePage.readTime}
|
||||
{featured.excerpt && (
|
||||
<p className="text-xs sm:text-sm text-zinc-300 line-clamp-2 leading-relaxed">
|
||||
{featured.excerpt}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Link
|
||||
href={`/blog/posts/${featured.slug}`}
|
||||
className="z-10 rounded-full bg-white px-6 py-2 text-[15px] font-[700] capitalize text-blog-purple transition-transform hover:scale-105"
|
||||
>
|
||||
{dict.blog.homePage.readArticle}
|
||||
</Link>
|
||||
<div className="flex flex-wrap items-center justify-between gap-3 pt-2">
|
||||
<div className="flex items-center gap-2">
|
||||
{featuredTags.map((tag) => (
|
||||
<Link
|
||||
key={tag.id}
|
||||
href={`/blog/tags/${tag.slug}`}
|
||||
className="rounded-full bg-white/10 px-2.5 py-0.5 text-xs font-mono font-medium text-white hover:bg-white/20 transition-colors"
|
||||
>
|
||||
#{tag.name}
|
||||
</Link>
|
||||
))}
|
||||
<span className="text-xs text-zinc-400">
|
||||
{readingTime} {dict.blog.homePage.readTime}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<Link
|
||||
href={`/blog/posts/${featured.slug}`}
|
||||
className="inline-flex items-center gap-2 rounded-full bg-primary px-5 py-2 text-xs sm:text-sm font-semibold text-primary-foreground shadow-md transition-all hover:bg-primary/90 hover:scale-105"
|
||||
>
|
||||
<span>{dict.blog.homePage.readArticle}</span>
|
||||
{isRTL ? <ArrowLeft className="h-4 w-4" /> : <ArrowRight className="h-4 w-4" />}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex w-full flex-col md:w-[35%] md:gap-2 lg:gap-2 xl:gap-5">
|
||||
<div className="flex w-full items-center justify-between border-b-2 pb-2 md:pb-5 lg:gap-8 lg:pb-6 xl:pb-10">
|
||||
<h2 className="text-[24px] font-[700] text-blog-text-default">
|
||||
{/* Side Latest Articles Column */}
|
||||
<div className="flex w-full flex-col justify-between rounded-2xl border border-border bg-card p-5 sm:p-6 lg:w-[35%]">
|
||||
<div className="flex w-full items-center justify-between border-b border-border/40 pb-4">
|
||||
<h2 className="text-xl sm:text-2xl font-bold tracking-tight text-foreground">
|
||||
{dict.blog.homePage.new}
|
||||
</h2>
|
||||
<Link
|
||||
href={"/blog/filtered-posts/new"}
|
||||
className="text-[16px] font-[400] text-blog-text-passive hover:underline"
|
||||
href="/blog/filtered-posts/new"
|
||||
className="group inline-flex items-center gap-1 text-xs sm:text-sm font-semibold text-primary hover:text-primary/80 transition-colors"
|
||||
>
|
||||
{dict.blog.homePage.viewAll}
|
||||
<span>{dict.blog.homePage.viewAll}</span>
|
||||
{isRTL ? <ArrowLeft className="h-3.5 w-3.5" /> : <ArrowRight className="h-3.5 w-3.5" />}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
{data.slice(1).map((post) => (
|
||||
<div
|
||||
key={post.id}
|
||||
className="flex w-full flex-col rounded-md p-2 transition-all hover:scale-105 hover:shadow-md"
|
||||
>
|
||||
<p className="text-[16px] font-[400] text-blog-text-passive">
|
||||
{formatDate(post.created_at, locale)}
|
||||
</p>
|
||||
<Link
|
||||
className="text-[16px] font-[600] text-blog-text-default hover:underline"
|
||||
href={`/blog/posts/${post.slug}`}
|
||||
<div className="flex flex-col divide-y divide-border/40">
|
||||
{sidePosts.slice(0, 4).map((post) => (
|
||||
<div
|
||||
key={post.id}
|
||||
className="group py-3.5 first:pt-4 last:pb-1 transition-all"
|
||||
>
|
||||
{post.title}
|
||||
</Link>
|
||||
</div>
|
||||
))}
|
||||
<span className="text-xs font-mono text-muted-foreground">
|
||||
{formatDate(post.created_at, locale)}
|
||||
</span>
|
||||
<Link
|
||||
className="mt-1 block text-sm sm:text-base font-semibold leading-snug text-foreground transition-colors group-hover:text-primary line-clamp-2"
|
||||
href={`/blog/posts/${post.slug}`}
|
||||
>
|
||||
{post.title}
|
||||
</Link>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -13,15 +13,20 @@ export default async function NewsletterCta() {
|
||||
return (
|
||||
<section
|
||||
id="newsletter"
|
||||
className="flex w-full max-w-[95%] flex-col items-center gap-5 rounded-md bg-blog-purple px-6 py-10 text-center sm:py-14"
|
||||
className="relative flex w-full max-w-[95%] flex-col items-center gap-4 overflow-hidden rounded-3xl border border-primary/20 bg-gradient-to-br from-primary/10 via-card to-background px-6 py-10 text-center sm:py-14 shadow-lg shadow-primary/5"
|
||||
>
|
||||
<h2 className="text-[26px] font-[700] text-white sm:text-[34px]">
|
||||
<div className="absolute -top-24 -end-24 h-48 w-48 rounded-full bg-primary/10 blur-3xl pointer-events-none" />
|
||||
<div className="absolute -bottom-24 -start-24 h-48 w-48 rounded-full bg-primary/10 blur-3xl pointer-events-none" />
|
||||
|
||||
<h2 className="relative z-10 text-2xl sm:text-3xl font-bold tracking-tight text-foreground">
|
||||
{dict.blog.homePage.newsletterTitle}
|
||||
</h2>
|
||||
<p className="max-w-[560px] text-[16px] font-[400] text-white/90">
|
||||
<p className="relative z-10 max-w-[560px] text-sm sm:text-base text-muted-foreground leading-relaxed">
|
||||
{dict.blog.homePage.newsletterText}
|
||||
</p>
|
||||
<SubscribeModal labels={subscribeLabels} variant="cta" />
|
||||
<div className="relative z-10 pt-2">
|
||||
<SubscribeModal labels={subscribeLabels} variant="cta" />
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -9,61 +9,68 @@ interface RandomProps {
|
||||
}
|
||||
|
||||
export default async function Random({ data }: RandomProps) {
|
||||
const dict = await getDictionary(await getDefaultLocale());
|
||||
const locale = await getDefaultLocale();
|
||||
const dict = await getDictionary(locale);
|
||||
|
||||
if (!data || data.length === 0) return null;
|
||||
|
||||
return (
|
||||
<div className="mb-10 flex w-full max-w-[90%] flex-wrap gap-10">
|
||||
<div className="flex w-full items-center justify-between">
|
||||
<h2 className="text-[36px] font-[700] text-blog-text-default">
|
||||
<div className="mb-10 flex w-full max-w-[95%] flex-col gap-6">
|
||||
<div className="flex w-full items-center justify-between border-b border-border/40 pb-4">
|
||||
<h2 className="text-2xl sm:text-3xl font-bold tracking-tight text-foreground">
|
||||
{dict.blog.homePage.random}
|
||||
</h2>
|
||||
</div>
|
||||
<div className="flex w-full flex-wrap justify-center gap-10">
|
||||
|
||||
<div className="flex w-full flex-col sm:flex-row sm:flex-wrap items-stretch justify-start gap-5">
|
||||
{data.map((randomPost) => (
|
||||
<div
|
||||
key={randomPost.id}
|
||||
className="flex w-full flex-col gap-5 rounded-lg p-8 shadow-md transition-all hover:scale-105 hover:shadow-lg sm:max-w-[45%]"
|
||||
className="group flex w-full sm:w-[calc(50%-10px)] flex-col justify-between rounded-2xl border border-border bg-card p-5 sm:p-6 shadow-sm transition-all duration-300 hover:border-primary/50 hover:shadow-md hover:-translate-y-0.5"
|
||||
>
|
||||
<Image
|
||||
src={randomPost.featured_image}
|
||||
width={580}
|
||||
height={50}
|
||||
alt={`${randomPost.title} post featured image`}
|
||||
className="w-full rounded-lg"
|
||||
/>
|
||||
<div className="z-10 flex w-full flex-wrap items-center justify-start gap-2">
|
||||
<div className="flex">
|
||||
<p className="me-2 text-[14px] font-[600] text-blog-text-passive md:text-[16px]">
|
||||
{dict.blog.homePage.by}
|
||||
</p>
|
||||
<Link
|
||||
href={"/"}
|
||||
className="text-[14px] font-[400] capitalize text-blog-text-default hover:underline md:text-[16px]"
|
||||
>
|
||||
{randomPost.author.name}
|
||||
</Link>
|
||||
<div>
|
||||
<div className="relative w-full aspect-[16/9] overflow-hidden rounded-xl bg-muted">
|
||||
<Image
|
||||
src={randomPost.featured_image}
|
||||
alt={`${randomPost.title} post featured image`}
|
||||
fill
|
||||
className="object-cover transition-transform duration-500 group-hover:scale-105"
|
||||
sizes="(max-width: 640px) 100vw, 50vw"
|
||||
/>
|
||||
</div>
|
||||
<div className="flex">
|
||||
<p className="me-2 text-[16px] font-[600] text-blog-text-passive">
|
||||
{dict.blog.homePage.in}
|
||||
</p>
|
||||
|
||||
<div className="mt-4 flex flex-wrap items-center gap-2 text-xs">
|
||||
<Link
|
||||
href={`/blog/categories/${randomPost.category.slug}`}
|
||||
className="text-[16px] font-[400] text-blog-text-default hover:underline"
|
||||
className="font-mono font-semibold uppercase tracking-wider text-primary hover:underline"
|
||||
>
|
||||
{randomPost.category.name}
|
||||
</Link>
|
||||
<span className="text-muted-foreground">•</span>
|
||||
<span className="text-muted-foreground">
|
||||
{dict.blog.homePage.by} {randomPost.author.name}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<Link
|
||||
className="text-[18px] font-[600] text-blog-text-default hover:underline lg:text-[28px]"
|
||||
href={`/blog/posts/${randomPost.slug}`}
|
||||
>
|
||||
{randomPost.title}
|
||||
</Link>
|
||||
|
||||
<p className="text-[16px] font-[400] text-blog-text-passive">
|
||||
{randomPost.excerpt}
|
||||
</p>
|
||||
<Link
|
||||
className="mt-2 block text-base sm:text-lg font-bold leading-snug text-foreground transition-colors group-hover:text-primary line-clamp-2"
|
||||
href={`/blog/posts/${randomPost.slug}`}
|
||||
>
|
||||
{randomPost.title}
|
||||
</Link>
|
||||
|
||||
{randomPost.excerpt && (
|
||||
<p className="mt-2 text-xs sm:text-sm text-muted-foreground line-clamp-2 leading-relaxed">
|
||||
{randomPost.excerpt}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="mt-4 pt-3 border-t border-border/40 text-xs font-medium text-primary">
|
||||
<Link href={`/blog/posts/${randomPost.slug}`} className="hover:underline">
|
||||
{locale === "fa" ? "مطالعه بیشتر ←" : "Read more →"}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -1,107 +1,165 @@
|
||||
"use client";
|
||||
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { usePathname, useRouter } from "next/navigation";
|
||||
import { X, Globe, ArrowLeft, ArrowRight, Home, Flame, Clock, Grid, BookOpen } from "lucide-react";
|
||||
|
||||
import {
|
||||
setSelectedLocale,
|
||||
useSelectedLocale,
|
||||
} from "@/app/lib/hooks/use-selected-locale";
|
||||
import { ThemeToggle } from "@/app/(routes)/(website)/components/theme-toggle/theme-toggle";
|
||||
|
||||
type propsType = {
|
||||
type PropsType = {
|
||||
clicked: boolean;
|
||||
setClicked: React.Dispatch<React.SetStateAction<boolean>>;
|
||||
};
|
||||
export default function MobileMenu({ clicked, setClicked }: propsType) {
|
||||
|
||||
export default function MobileMenu({ clicked, setClicked }: PropsType) {
|
||||
const pathname = usePathname();
|
||||
const router = useRouter();
|
||||
const selectedLocale = useSelectedLocale();
|
||||
const isRTL = selectedLocale === "fa";
|
||||
|
||||
const handleLocaleChange = (locale: "fa" | "en") => {
|
||||
try {
|
||||
const url = new URL(window.location.href);
|
||||
url.searchParams.set("lang", locale);
|
||||
window.history.pushState({}, "", url.toString());
|
||||
} catch {}
|
||||
setSelectedLocale(locale);
|
||||
router.refresh();
|
||||
setClicked(false);
|
||||
};
|
||||
|
||||
const closeMenu = () => setClicked(false);
|
||||
|
||||
const links = [
|
||||
{
|
||||
href: "/blog",
|
||||
label: isRTL ? "صفحه اصلی وبلاگ" : "Blog Home",
|
||||
icon: Home,
|
||||
exact: true,
|
||||
},
|
||||
{
|
||||
href: "/blog/filtered-posts/popular",
|
||||
label: isRTL ? "محبوبترینها" : "Popular",
|
||||
icon: Flame,
|
||||
},
|
||||
{
|
||||
href: "/blog/filtered-posts/new",
|
||||
label: isRTL ? "تازهترین مقالات" : "Latest Articles",
|
||||
icon: Clock,
|
||||
},
|
||||
{
|
||||
href: "/blog/posts",
|
||||
label: isRTL ? "همه مقالات" : "All Posts",
|
||||
icon: BookOpen,
|
||||
},
|
||||
{
|
||||
href: "/blog/categories",
|
||||
label: isRTL ? "دستهبندیها" : "Categories",
|
||||
icon: Grid,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="flex">
|
||||
<>
|
||||
{/* Backdrop */}
|
||||
<div
|
||||
className={`${clicked ? "fixed end-0" : "end-[-1000px] hidden"} top-0 z-[60] flex h-full w-full lg:hidden`}
|
||||
style={{ backgroundColor: "rgba(2, 6, 23, 0.85)", backdropFilter: "blur(4px)", zIndex: 60 }}
|
||||
onClick={() => setClicked(false)}
|
||||
></div>
|
||||
className={`fixed inset-0 z-[60] bg-black/70 backdrop-blur-sm transition-opacity duration-300 lg:hidden ${
|
||||
clicked ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"
|
||||
}`}
|
||||
onClick={closeMenu}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
|
||||
{/* Drawer */}
|
||||
<div
|
||||
className={`fixed start-0 top-0 z-[70] flex h-full w-[250px] select-none flex-col items-start gap-10 ${clicked ? "start-0" : "start-[-260px]"} mobile-menu lg:start-[-260px]`}
|
||||
style={{ backgroundColor: "rgb(146, 131, 224)", zIndex: 70 }}
|
||||
className={`fixed top-0 start-0 z-[70] flex h-full w-[290px] max-w-[85vw] flex-col justify-between border-e border-border bg-card dark:bg-zinc-950 text-card-foreground shadow-2xl transition-transform duration-300 ease-out lg:hidden ${
|
||||
clicked
|
||||
? "translate-x-0"
|
||||
: isRTL
|
||||
? "translate-x-full"
|
||||
: "-translate-x-full"
|
||||
}`}
|
||||
>
|
||||
<div className="z-50 flex w-full flex-wrap items-center justify-start bg-blog-purple px-3 py-10">
|
||||
<div className="relative h-[30px] w-[150px] lg:h-[45px] lg:w-[225px]">
|
||||
<Image
|
||||
src={"/images/blog/logo/logo-no-background.png"}
|
||||
fill
|
||||
alt="parsaaghayi's blog logo"
|
||||
/>
|
||||
{/* Header */}
|
||||
<div>
|
||||
<div className="flex items-center justify-between border-b border-border/60 px-5 py-4">
|
||||
<Link href="/blog" onClick={closeMenu} className="flex items-center">
|
||||
<div className="relative h-[32px] w-[140px] dark:brightness-0 dark:invert transition-all">
|
||||
<Image
|
||||
src="/images/blog/logo/logo-no-background.png"
|
||||
fill
|
||||
alt="parsaaghayi blog"
|
||||
className="object-contain"
|
||||
priority
|
||||
/>
|
||||
</div>
|
||||
</Link>
|
||||
<button
|
||||
onClick={closeMenu}
|
||||
aria-label="Close menu"
|
||||
className="flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"
|
||||
>
|
||||
<X className="h-5 w-5" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col">
|
||||
<nav className="flex w-full flex-col">
|
||||
<Link
|
||||
href="/blog"
|
||||
className={`block w-full whitespace-nowrap px-[14px] py-[10px] text-[21px] font-[400] hover:cursor-pointer ${pathname === "/blog" ? "text-blog-text-hover" : "text-white"}`}
|
||||
onClick={() => {
|
||||
setClicked(false);
|
||||
}}
|
||||
>
|
||||
Home
|
||||
</Link>
|
||||
<Link
|
||||
href="/blog/filtered-posts/new"
|
||||
className={`block w-full whitespace-nowrap px-[14px] py-[10px] text-[21px] font-[400] hover:cursor-pointer ${pathname === "/blog/filtered-posts/new" ? "text-blog-text-hover" : "text-white"}`}
|
||||
onClick={() => {
|
||||
setClicked(false);
|
||||
}}
|
||||
>
|
||||
New
|
||||
</Link>
|
||||
<Link
|
||||
href="/blog/filtered-posts/popular"
|
||||
className={`block w-full whitespace-nowrap px-[14px] py-[10px] text-[21px] font-[400] hover:cursor-pointer ${pathname === "/blog/filtered-posts/popular" ? "text-blog-text-hover" : "text-white"}`}
|
||||
onClick={() => {
|
||||
setClicked(false);
|
||||
}}
|
||||
>
|
||||
Popular
|
||||
</Link>
|
||||
<Link
|
||||
href="/blog/posts"
|
||||
className={`block w-full whitespace-nowrap px-[14px] py-[10px] text-[21px] font-[400] hover:cursor-pointer ${pathname === "/blog/posts" ? "text-blog-text-hover" : "text-white"}`}
|
||||
onClick={() => {
|
||||
setClicked(false);
|
||||
}}
|
||||
>
|
||||
All posts
|
||||
</Link>
|
||||
<Link
|
||||
href="/blog/categories"
|
||||
className={`block w-full whitespace-nowrap px-[14px] py-[10px] text-[21px] font-[400] hover:cursor-pointer ${pathname === "/blog/categories" ? "text-blog-text-hover" : "text-white"}`}
|
||||
onClick={() => {
|
||||
setClicked(false);
|
||||
}}
|
||||
>
|
||||
Categories
|
||||
</Link>
|
||||
|
||||
{/* Navigation Links */}
|
||||
<nav className="flex flex-col gap-1 p-3">
|
||||
{links.map((link) => {
|
||||
const Icon = link.icon;
|
||||
const isActive = link.exact
|
||||
? pathname === link.href
|
||||
: pathname === link.href || pathname.startsWith(`${link.href}/`);
|
||||
|
||||
return (
|
||||
<Link
|
||||
key={link.href}
|
||||
href={link.href}
|
||||
onClick={closeMenu}
|
||||
className={`flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-medium transition-all ${
|
||||
isActive
|
||||
? "bg-primary/10 text-primary font-semibold"
|
||||
: "text-muted-foreground hover:bg-muted/60 hover:text-foreground"
|
||||
}`}
|
||||
>
|
||||
<Icon className={`h-4 w-4 ${isActive ? "text-primary" : "text-muted-foreground"}`} />
|
||||
<span>{link.label}</span>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
{/* Footer Area with Language Switcher and Portfolio Link */}
|
||||
<div className="border-t border-border/60 p-4 space-y-3">
|
||||
<Link
|
||||
href="#"
|
||||
className="block w-full whitespace-nowrap px-[14px] py-[10px] text-[21px] font-[400] text-white hover:cursor-pointer"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
handleLocaleChange(selectedLocale === "fa" ? "en" : "fa");
|
||||
}}
|
||||
href="/"
|
||||
onClick={closeMenu}
|
||||
className="flex items-center justify-between w-full rounded-xl bg-muted/50 hover:bg-muted px-4 py-3 text-xs font-semibold text-foreground transition-colors"
|
||||
>
|
||||
{selectedLocale === "fa" ? "English" : "فارسی"}
|
||||
<span>{isRTL ? "بازگشت به سایت اصلی و رزومه" : "Back to Main Portfolio"}</span>
|
||||
{isRTL ? <ArrowLeft className="h-4 w-4" /> : <ArrowRight className="h-4 w-4" />}
|
||||
</Link>
|
||||
|
||||
<div className="flex items-center justify-between w-full rounded-xl border border-border bg-card px-3 py-2 text-xs font-medium text-foreground">
|
||||
<span>{isRTL ? "حالت تم (تیره / روشن)" : "Theme Mode"}</span>
|
||||
<ThemeToggle />
|
||||
</div>
|
||||
|
||||
<button
|
||||
onClick={() => handleLocaleChange(selectedLocale === "fa" ? "en" : "fa")}
|
||||
className="flex items-center justify-center gap-2 w-full rounded-xl border border-border bg-card hover:bg-muted/60 py-2.5 text-xs font-medium text-foreground transition-all"
|
||||
>
|
||||
<Globe className="h-4 w-4 text-primary" />
|
||||
<span>{selectedLocale === "fa" ? "English Version" : "نسخه فارسی"}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -58,8 +58,8 @@ export default function SubscribeModal({
|
||||
|
||||
const triggerClassName =
|
||||
variant === "header"
|
||||
? "flex items-center justify-center rounded-[10px] bg-blog-purple px-[12px] py-[8px] text-[16px] font-[600] text-white shadow-md capitalize transition-all hover:scale-105 sm:px-[20px] sm:py-[12px]"
|
||||
: "rounded-full bg-white px-8 py-3 text-[16px] font-[700] capitalize text-blog-purple transition-transform hover:scale-105";
|
||||
? "flex items-center justify-center rounded-xl bg-primary px-3 py-2 text-xs sm:text-sm font-semibold text-primary-foreground shadow-md transition-all hover:bg-primary/90 hover:scale-105"
|
||||
: "rounded-full bg-primary px-6 py-2.5 text-sm font-semibold text-primary-foreground shadow-md transition-transform hover:scale-105";
|
||||
|
||||
const submit = async (event: FormEvent<HTMLFormElement>) => {
|
||||
event.preventDefault();
|
||||
@@ -136,13 +136,13 @@ export default function SubscribeModal({
|
||||
className="absolute inset-0 bg-slate-950/70 backdrop-blur-sm"
|
||||
onClick={() => setOpen(false)}
|
||||
/>
|
||||
<div className="relative flex w-full max-w-md flex-col gap-4 rounded-2xl bg-white p-6 shadow-2xl">
|
||||
<div className="relative flex w-full max-w-md flex-col gap-4 rounded-2xl bg-card border border-border text-foreground p-6 shadow-2xl">
|
||||
<div className="flex items-start justify-between gap-4">
|
||||
<div className="flex flex-col gap-1">
|
||||
<h2 className="text-[20px] font-[700] text-blog-text-default">
|
||||
<h2 className="text-[20px] font-[700] text-foreground">
|
||||
{labels.title}
|
||||
</h2>
|
||||
<p className="text-[14px] font-[400] text-blog-text-passive">
|
||||
<p className="text-[14px] font-[400] text-muted-foreground">
|
||||
{labels.text}
|
||||
</p>
|
||||
</div>
|
||||
@@ -150,14 +150,14 @@ export default function SubscribeModal({
|
||||
type="button"
|
||||
onClick={() => setOpen(false)}
|
||||
aria-label={labels.close}
|
||||
className="flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-blog-background text-[18px] leading-none text-blog-text-passive transition-colors hover:bg-[#e4e0ee]"
|
||||
className="flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted text-[18px] leading-none text-muted-foreground transition-colors hover:bg-muted-foreground/20 hover:text-foreground"
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{status.kind === "done" ? (
|
||||
<p className="rounded-md bg-blog-purple/10 p-4 text-[15px] font-[500] text-blog-purple">
|
||||
<p className="rounded-md bg-primary/10 p-4 text-[15px] font-[500] text-primary">
|
||||
{status.message}
|
||||
</p>
|
||||
) : (
|
||||
@@ -206,7 +206,7 @@ export default function SubscribeModal({
|
||||
<button
|
||||
type="submit"
|
||||
disabled={status.kind === "sending"}
|
||||
className="w-fit rounded-full bg-blog-purple px-6 py-2 text-[15px] font-[700] capitalize text-white transition-transform hover:scale-105 disabled:cursor-not-allowed disabled:opacity-60"
|
||||
className="w-fit rounded-full bg-primary px-6 py-2 text-[15px] font-[700] capitalize text-primary-foreground transition-transform hover:scale-105 disabled:cursor-not-allowed disabled:opacity-60"
|
||||
>
|
||||
{status.kind === "sending" ? "..." : labels.submit}
|
||||
</button>
|
||||
|
||||
@@ -59,7 +59,7 @@ export default function RootLayout({
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<div className="flex w-full flex-wrap justify-center bg-blog-background dark:bg-background text-foreground transition-colors duration-300">
|
||||
<div className="flex min-h-screen w-full flex-col items-center bg-background text-foreground transition-colors duration-300">
|
||||
<link
|
||||
rel="icon"
|
||||
href="/images/favicons/blog-icon.png"
|
||||
@@ -68,10 +68,10 @@ export default function RootLayout({
|
||||
/>
|
||||
|
||||
<Header />
|
||||
<NextTopLoader color="rgb(146 131 224)" showAtBottom={false} />
|
||||
<div className="main blog relative my-[100px] flex w-full flex-wrap justify-center md:my-[150px]">
|
||||
<NextTopLoader color="#FD6F00" showAtBottom={false} />
|
||||
<main className="relative mt-[80px] mb-[60px] sm:mt-[110px] flex w-full flex-1 flex-col items-center">
|
||||
{children}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<Footer />
|
||||
</div>
|
||||
|
||||
@@ -4,31 +4,31 @@
|
||||
"top": {
|
||||
"greeting": "Hi, I am",
|
||||
"name": "Parsa Aghayi",
|
||||
"profession": "Senior Frontend Engineer & Web Architect",
|
||||
"roll": "Turning complex engineering challenges into clean, maintainable code.",
|
||||
"descriptionAboutMe": "Crafting high-performance web applications, scalable React/Next.js architectures, and seamless backend integrations. Turning complex engineering challenges into clean, maintainable code.",
|
||||
"cta": "Let's Work Together"
|
||||
"profession": "Senior Full-Stack Engineer & Web Architect",
|
||||
"roll": "Architecting scalable web applications, high-concurrency platforms, and resilient software systems.",
|
||||
"descriptionAboutMe": "Crafting high-performance web applications, scalable Next.js & React architectures, and robust backend integrations. Turning complex engineering challenges into clean, maintainable code.",
|
||||
"cta": "Let's Connect & Collaborate"
|
||||
},
|
||||
"nav": {
|
||||
"home": "home",
|
||||
"aboutMe": "about Me",
|
||||
"services": "services",
|
||||
"projects": "projects",
|
||||
"testimonials": "testimonials",
|
||||
"contact": "contact",
|
||||
"blog": "blog"
|
||||
"home": "Home",
|
||||
"aboutMe": "About",
|
||||
"services": "Services",
|
||||
"projects": "Projects",
|
||||
"testimonials": "Testimonials",
|
||||
"contact": "Contact",
|
||||
"blog": "Blog"
|
||||
},
|
||||
"services": {
|
||||
"title": "services",
|
||||
"description": "In today's digital landscape, having a robust online presence is essential for businesses and individuals alike. Our services cater to a wide range of web development needs, ensuring that your project is functional, visually appealing, and user-friendly."
|
||||
"title": "Technical Services & Expertise",
|
||||
"description": "Architecting high-concurrency systems, enterprise frontend platforms, performance optimization, and scalable full-stack web applications built for reliability and speed."
|
||||
},
|
||||
"projects": {
|
||||
"title": "my projects",
|
||||
"description": "Explore a selection of my web development projects that showcase my ability to deliver high-quality solutions and create engaging digital experiences. See how I can help bring your vision to life!"
|
||||
"title": "Featured Projects & Architecture",
|
||||
"description": "A showcase of high-concurrency banking platforms, enterprise automation suites, e-commerce ecosystems, and open-source packages engineered for scale and speed."
|
||||
},
|
||||
"testimonials": {
|
||||
"title": "testimonials",
|
||||
"description": "The Testimonials section features feedback from clients and collaborators, highlighting the quality of my services and commitment to client satisfaction. These authentic reviews reflect my professionalism and the positive impact of my work, giving potential clients confidence in choosing me for their web development needs.",
|
||||
"title": "Testimonials & Engineering Feedback",
|
||||
"description": "Direct feedback from technical leaders, founders, and engineering collaborators on delivering mission-critical web applications under real-world constraints.",
|
||||
"data": [
|
||||
{
|
||||
"name": "Sarah Johnson",
|
||||
@@ -69,8 +69,8 @@
|
||||
]
|
||||
},
|
||||
"contact": {
|
||||
"slogan": "Let's Design Together",
|
||||
"description": "The Contact Me section offers a simple way to reach out for inquiries, project proposals, or collaboration opportunities. Fill out the contact form or use the provided information, and I'll respond promptly to discuss your ideas and how I can help.",
|
||||
"slogan": "Let's Build Something Impactful",
|
||||
"description": "Have a complex architectural challenge, high-scale web project, or technical consulting inquiry? Let's connect and discuss how we can engineer the right solution.",
|
||||
"button": "Contact Me",
|
||||
"placeholder": "Enter your Email address here...",
|
||||
"form": {
|
||||
@@ -91,38 +91,38 @@
|
||||
}
|
||||
},
|
||||
"header": {
|
||||
"Name": "parsa aghayi",
|
||||
"Home": "home",
|
||||
"AboutMe": "about Me",
|
||||
"Services": "services",
|
||||
"Projects": "projects",
|
||||
"Testimonials": "testimonials",
|
||||
"Contact": "contact",
|
||||
"Blog": "blog",
|
||||
"Name": "Parsa Aghayi",
|
||||
"Home": "Home",
|
||||
"AboutMe": "About",
|
||||
"Services": "Services",
|
||||
"Projects": "Projects",
|
||||
"Testimonials": "Testimonials",
|
||||
"Contact": "Contact",
|
||||
"Blog": "Blog",
|
||||
"Button": "Resume"
|
||||
},
|
||||
"footer": {
|
||||
"Name": "parsa aghayi",
|
||||
"Home": "home",
|
||||
"AboutMe": "about Me",
|
||||
"Services": "services",
|
||||
"Projects": "projects",
|
||||
"Testimonials": "testimonials",
|
||||
"Contact": "contact",
|
||||
"Blog": "blog",
|
||||
"Name": "Parsa Aghayi",
|
||||
"Home": "Home",
|
||||
"AboutMe": "About",
|
||||
"Services": "Services",
|
||||
"Projects": "Projects",
|
||||
"Testimonials": "Testimonials",
|
||||
"Contact": "Contact",
|
||||
"Blog": "Blog",
|
||||
"Year": "© 2026",
|
||||
"CopyRight": "All Rights Reserved, Inc."
|
||||
}
|
||||
},
|
||||
"blog": {
|
||||
"homePage": {
|
||||
"viewAll": "viewAll",
|
||||
"new": "new",
|
||||
"categories": "categories",
|
||||
"popular": "popular",
|
||||
"random": "random",
|
||||
"by": "BY",
|
||||
"in": "IN",
|
||||
"viewAll": "View all",
|
||||
"new": "New",
|
||||
"categories": "Categories",
|
||||
"popular": "Popular",
|
||||
"random": "Random",
|
||||
"by": "By",
|
||||
"in": "in",
|
||||
"readArticle": "Read article",
|
||||
"newsletterTitle": "Get fresh articles in your inbox",
|
||||
"newsletterText": "One useful engineering post per week. No spam, unsubscribe anytime.",
|
||||
@@ -130,8 +130,8 @@
|
||||
"readTime": "min read"
|
||||
},
|
||||
"filteredPostsPage": {
|
||||
"newTitle": "new",
|
||||
"popularTitle": "popular",
|
||||
"newTitle": "New Articles",
|
||||
"popularTitle": "Popular Articles",
|
||||
"newDescription": "Explore the latest posts on our blog. Stay updated with fresh content, insightful articles, and the most recent discussions in your areas of interest.",
|
||||
"popularDescription": "Discover the most popular posts with the highest views. These articles have resonated with our audience and are trending across various topics."
|
||||
},
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
"top": {
|
||||
"greeting": "سلام، من",
|
||||
"name": "پارسا آقایی",
|
||||
"profession": "ارشد توسعه فرانتاند و معمار راهکارهای وب",
|
||||
"roll": "تمرکز من بر خلق رابطهای کاربری بسیار بهینه و توسعه کامپوننتهای مقیاسپذیر است.",
|
||||
"descriptionAboutMe": "با بیش از ۱۰ سال تجربه در دنیای توسعه وب، مسیر کاری من ترکیبی از مهندسی دقیق فرانتاند و درک عمیق از معماری بکاند است. تخصص اصلی من در بازطراحی و Refactor کدهای پیچیده، بهینهسازی Performance پروژههای بزرگ Next.js و پیادهسازی زیرساختهای پایدار وب است.",
|
||||
"cta": "بیایید با هم کار کنیم"
|
||||
"profession": "مهندس ارشد فولاستک و معمار سیستمهای وب",
|
||||
"roll": "طراحی و توسعه سامانههای مقیاسپذیر، پلتفرمهای پرترافیک و معماری مدرن نرمافزار.",
|
||||
"descriptionAboutMe": "با بیش از ۱۰ سال تجربه تخصصی در اکوسیستم وب، تمرکز من بر توسعه فولاستک، حل چالشهای پیچیده پرفورمنس در لایههای Next.js و فرانتاند، طراحی معماری بکاند و میکروسرویسها، و استقرار پایپلاینهای خودکار CI/CD در سیستمهای پرترافیک سازمانی است.",
|
||||
"cta": "شروع گفتگو و همکاری"
|
||||
},
|
||||
"nav": {
|
||||
"home": "خانه",
|
||||
@@ -19,16 +19,16 @@
|
||||
"blog": "وبلاگ"
|
||||
},
|
||||
"services": {
|
||||
"title": "خدمات",
|
||||
"description": "در چشمانداز دیجیتال امروز، داشتن یک حضور آنلاین قدرتمند برای کسبوکارها و افراد ضروری است. خدمات ما طیف گستردهای از نیازهای توسعه وب را پوشش میدهد تا اطمینان حاصل شود که پروژه شما کاربردی، از نظر بصری جذاب و کاربرپسند است."
|
||||
"title": "حوزههای تخصصی و خدمات مهندسی",
|
||||
"description": "تمرکز بر معماری سیستمهای مقیاسپذیر، مهندسی عملکرد در ترافیک بالا، توسعه مدرن فولاستک و راهکارهای نرمافزاری پایدار برای محصولات دیجیتال و سامانههای سازمانی."
|
||||
},
|
||||
"projects": {
|
||||
"title": "پروژههای من",
|
||||
"description": "مجموعهای از پروژههای توسعه وب من را بررسی کنید که توانایی من در ارائه راهکارهای با کیفیت بالا و ایجاد تجربههای دیجیتال جذاب را نشان میدهد. ببینید چگونه میتوانم به شما در تحقق چشماندازتان کمک کنم!"
|
||||
"title": "پروژهها و نمونهکارها",
|
||||
"description": "مروری بر پروژههای کلان بانکی، سامانههای پرترافیک، پلتفرمهای تجارت الکترونیک و ابزارهای متنباز که با رویکرد پرفورمنس، پایداری و استانداردهای تمیز مهندسی نرمافزار پیادهسازی شدهاند."
|
||||
},
|
||||
"testimonials": {
|
||||
"title": "نظرات",
|
||||
"description": "بخش نظرات شامل بازخوردهای مشتریان و همکاران است که کیفیت خدمات و تعهد من به رضایت مشتری را برجسته میکند. این بررسیهای واقعی، حرفهایگری و تأثیر مثبت کارهای من را نشان میدهد و به مشتریان احتمالی اطمینان میدهد.",
|
||||
"title": "دیدگاه همکاران و کارفرمایان",
|
||||
"description": "روایت تجربه همکاری مدیران فنی، همبنیانگذاران و همکاران در تحویل موفق پروژههای پرترافیک، چالشهای پیچیده نرمافزاری و توسعه سیستمهای پایدار.",
|
||||
"data": [
|
||||
{
|
||||
"name": "سارا جانسون",
|
||||
@@ -69,8 +69,8 @@
|
||||
]
|
||||
},
|
||||
"contact": {
|
||||
"slogan": "بیایید با هم طراحی کنیم",
|
||||
"description": "بخش تماس با من راهی ساده برای ارتباط جهت استعلامات، پیشنهادهای پروژه یا فرصتهای همکاری است. فرم تماس را پر کنید یا از اطلاعات ارائه شده استفاده کنید و من سریعاً برای بحث درباره ایدههای شما و نحوه کمک من پاسخ خواهم داد.",
|
||||
"slogan": "همکاری در پروژههای مقیاسپذیر",
|
||||
"description": "برای مشاوره فنی، همکاری در معماری سیستمهای وب، یا بررسی پروژههای نرمافزاری جدید، خوشحال میشوم با هم در ارتباط باشیم.",
|
||||
"button": "تماس با من",
|
||||
"placeholder": "آدرس ایمیل خود را اینجا وارد کنید...",
|
||||
"form": {
|
||||
|
||||
+5
-5
@@ -49,9 +49,9 @@ const config: Config = {
|
||||
foreground: 'hsl(var(--card-foreground))',
|
||||
},
|
||||
blog: {
|
||||
red: '#FF5480',
|
||||
purple: '#9283E0',
|
||||
orange: '#FFA599',
|
||||
red: '#FD6F00',
|
||||
purple: '#FD6F00',
|
||||
orange: '#FF8833',
|
||||
yellow: '#FFD581',
|
||||
violet: '#FE90EC',
|
||||
blue: '#27AEFF',
|
||||
@@ -61,8 +61,8 @@ const config: Config = {
|
||||
text: {
|
||||
default: 'var(--blog-text-default, #000000)',
|
||||
passive: '#9B9B9B',
|
||||
quote: '#9283E0',
|
||||
hover: '#FF5480',
|
||||
quote: '#FD6F00',
|
||||
hover: '#FD6F00',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user