Import source: src/components/Writing
Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
This commit is contained in:
@@ -0,0 +1,215 @@
|
||||
'use client';
|
||||
|
||||
import { motion } from 'framer-motion';
|
||||
import { useLocale, useTranslations } from 'next-intl';
|
||||
import { BookOpen, Eye, Heart, ArrowUpRight } from 'lucide-react';
|
||||
|
||||
type Article = {
|
||||
id: string;
|
||||
titleKey: string;
|
||||
descKey: string;
|
||||
dateKey: string;
|
||||
viewsKey: string;
|
||||
link: string;
|
||||
};
|
||||
|
||||
export default function Writing() {
|
||||
const t = useTranslations('Writing');
|
||||
const tStats = useTranslations('Stats');
|
||||
const locale = useLocale();
|
||||
|
||||
const articles: Article[] = [
|
||||
{
|
||||
id: 'art1',
|
||||
titleKey: 'articles.art1.title',
|
||||
descKey: 'articles.art1.desc',
|
||||
dateKey: 'articles.art1.date',
|
||||
viewsKey: 'articles.art1.views',
|
||||
link: 'https://teknav.ir/profile/@arsam-sabbagh',
|
||||
},
|
||||
{
|
||||
id: 'art2',
|
||||
titleKey: 'articles.art2.title',
|
||||
descKey: 'articles.art2.desc',
|
||||
dateKey: 'articles.art2.date',
|
||||
viewsKey: 'articles.art2.views',
|
||||
link: 'https://teknav.ir/profile/@arsam-sabbagh',
|
||||
},
|
||||
{
|
||||
id: 'art3',
|
||||
titleKey: 'articles.art3.title',
|
||||
descKey: 'articles.art3.desc',
|
||||
dateKey: 'articles.art3.date',
|
||||
viewsKey: 'articles.art3.views',
|
||||
link: 'https://teknav.ir/profile/@arsam-sabbagh',
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<section id="writing" className="py-24 bg-warm-white dark:bg-near-black border-t border-sand/20 dark:border-charcoal/50 transition-colors duration-300">
|
||||
<div className="max-w-[1200px] mx-auto px-6">
|
||||
|
||||
{/* Header */}
|
||||
<div className="text-center max-w-2xl mx-auto mb-16">
|
||||
<h2 className="text-xs font-semibold tracking-widest text-terracotta uppercase mb-2">
|
||||
{t('title')}
|
||||
</h2>
|
||||
<h3 className="text-3xl font-extrabold tracking-tight text-charcoal dark:text-warm-white">
|
||||
{t('subtitle')}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
{/* Featured Article Hero Card */}
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 30 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, margin: '-50px' }}
|
||||
transition={{ duration: 0.8 }}
|
||||
className="mb-12 rounded-2xl border border-sand dark:border-charcoal bg-warm-white dark:bg-charcoal/10 overflow-hidden p-6 md:p-10 relative group hover:border-teal-brand/30 dark:hover:border-teal-brand/30 transition-colors"
|
||||
>
|
||||
<div className="relative z-10 flex flex-col md:flex-row md:items-center gap-8 justify-between">
|
||||
<div className="space-y-4 max-w-2xl">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="px-2.5 py-0.5 rounded-full text-[10px] font-bold bg-terracotta/10 text-terracotta uppercase tracking-wider">
|
||||
{t('featured')}
|
||||
</span>
|
||||
<span className="text-xs text-charcoal/50 dark:text-warm-white/40 font-semibold">
|
||||
{t('articles.art1.date')}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<h4 className="text-2xl md:text-3xl font-bold text-charcoal dark:text-warm-white leading-tight">
|
||||
{t('articles.art1.title')}
|
||||
</h4>
|
||||
|
||||
<p className="text-sm md:text-base text-charcoal/70 dark:text-warm-white/60 leading-relaxed">
|
||||
{t('articles.art1.desc')}
|
||||
</p>
|
||||
|
||||
<div className="flex items-center gap-4 text-xs font-semibold text-charcoal/60 dark:text-warm-white/50">
|
||||
<span className="flex items-center gap-1">
|
||||
<Eye className="w-3.5 h-3.5" />
|
||||
<span>{t('articles.art1.views')}</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex-shrink-0 pt-4 md:pt-0">
|
||||
<a
|
||||
href="https://teknav.ir/profile/@arsam-sabbagh"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-2 px-5 py-3 rounded-full bg-teal-brand hover:bg-teal-brand/90 text-warm-white text-sm font-semibold transition-all hover:scale-102 hover:shadow-md cursor-pointer"
|
||||
>
|
||||
<span>{t('readMore')}</span>
|
||||
<ArrowUpRight className="w-4 h-4" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="absolute inset-0 bg-gradient-to-r from-teal-brand/5 to-transparent pointer-events-none opacity-50" />
|
||||
</motion.div>
|
||||
|
||||
{/* Profile Card & List Columns */}
|
||||
<div className="grid grid-cols-1 lg:grid-cols-12 gap-8 items-start">
|
||||
|
||||
{/* Teknav Profile Summary Card (Left) */}
|
||||
<motion.div
|
||||
initial={{ opacity: 0, x: -20 }}
|
||||
whileInView={{ opacity: 1, x: 0 }}
|
||||
viewport={{ once: true }}
|
||||
transition={{ duration: 0.6 }}
|
||||
className="lg:col-span-4 p-6 rounded-2xl border border-sand dark:border-charcoal bg-sand/10 dark:bg-charcoal/20 backdrop-blur-sm"
|
||||
>
|
||||
<h4 className="text-lg font-bold text-charcoal dark:text-warm-white mb-6 flex items-center gap-2">
|
||||
<BookOpen className="w-5 h-5 text-teal-brand" />
|
||||
<span>{t('stats')}</span>
|
||||
</h4>
|
||||
|
||||
<div className="space-y-6">
|
||||
<div>
|
||||
<div className="text-3xl font-black text-teal-brand dark:text-teal-brand">
|
||||
{(28).toLocaleString(locale === 'fa' ? 'fa-IR' : 'en-US')}
|
||||
</div>
|
||||
<div className="text-xs font-semibold text-charcoal/60 dark:text-warm-white/50 uppercase tracking-wider mt-1">
|
||||
{tStats('articles')}
|
||||
</div>
|
||||
</div>
|
||||
<hr className="border-sand/30 dark:border-charcoal/30" />
|
||||
|
||||
<div>
|
||||
<div className="text-3xl font-black text-teal-brand dark:text-teal-brand">
|
||||
{(118280).toLocaleString(locale === 'fa' ? 'fa-IR' : 'en-US')}
|
||||
</div>
|
||||
<div className="text-xs font-semibold text-charcoal/60 dark:text-warm-white/50 uppercase tracking-wider mt-1">
|
||||
{tStats('views')}
|
||||
</div>
|
||||
</div>
|
||||
<hr className="border-sand/30 dark:border-charcoal/30" />
|
||||
|
||||
<div>
|
||||
<div className="text-3xl font-black text-teal-brand dark:text-teal-brand">
|
||||
{(4789).toLocaleString(locale === 'fa' ? 'fa-IR' : 'en-US')}
|
||||
</div>
|
||||
<div className="text-xs font-semibold text-charcoal/60 dark:text-warm-white/50 uppercase tracking-wider mt-1">
|
||||
{tStats('reactions')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a
|
||||
href="https://teknav.ir/profile/@arsam-sabbagh"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="mt-8 flex items-center justify-center gap-2 w-full py-3 rounded-xl border border-sand dark:border-charcoal hover:border-teal-brand hover:text-teal-brand text-charcoal dark:text-warm-white text-xs font-bold transition-all cursor-pointer"
|
||||
>
|
||||
<span>{t('viewProfile')}</span>
|
||||
<ArrowUpRight className="w-3.5 h-3.5" />
|
||||
</a>
|
||||
</motion.div>
|
||||
|
||||
{/* Other Articles List (Right) */}
|
||||
<motion.div
|
||||
initial={{ opacity: 0, x: 20 }}
|
||||
whileInView={{ opacity: 1, x: 0 }}
|
||||
viewport={{ once: true }}
|
||||
transition={{ duration: 0.6 }}
|
||||
className="lg:col-span-8 space-y-4"
|
||||
>
|
||||
{articles.map((art) => (
|
||||
<a
|
||||
key={art.id}
|
||||
href={art.link}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="block p-6 rounded-2xl border border-sand dark:border-charcoal bg-warm-white dark:bg-charcoal/10 hover:border-teal-brand/35 dark:hover:border-teal-brand/35 transition-all duration-300 group"
|
||||
>
|
||||
<div className="flex justify-between items-start gap-4">
|
||||
<div className="space-y-2">
|
||||
<span className="text-xs text-charcoal/40 dark:text-warm-white/30 font-semibold">
|
||||
{t(`${art.dateKey}`)}
|
||||
</span>
|
||||
<h5 className="text-lg font-bold text-charcoal dark:text-warm-white group-hover:text-teal-brand dark:group-hover:text-teal-brand transition-colors">
|
||||
{t(`${art.titleKey}`)}
|
||||
</h5>
|
||||
<p className="text-xs md:text-sm text-charcoal/70 dark:text-warm-white/60 leading-relaxed">
|
||||
{t(`${art.descKey}`)}
|
||||
</p>
|
||||
<div className="flex items-center gap-1 text-[11px] font-semibold text-charcoal/50 dark:text-warm-white/40">
|
||||
<Eye className="w-3 h-3" />
|
||||
<span>{t(`${art.viewsKey}`)}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="p-2 rounded-full border border-sand/40 dark:border-charcoal/50 group-hover:border-teal-brand text-charcoal/40 dark:text-warm-white/40 group-hover:text-teal-brand group-hover:bg-teal-brand/5 transition-all">
|
||||
<ArrowUpRight className="w-4 h-4" />
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
))}
|
||||
</motion.div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user