fix: remove heading subtitle from Technogen and align swipe direction

This commit is contained in:
alireza 2026-08-25 16:19:37 +03:30
parent d9865c5bfe
commit b9e6462dd4
1 changed files with 25 additions and 39 deletions

View File

@ -89,13 +89,13 @@ export default function TechnogenSection() {
setIsPaused(false) setIsPaused(false)
if (touchStartX.current === null) return if (touchStartX.current === null) return
const diff = touchStartX.current - e.changedTouches[0].clientX const diff = touchStartX.current - e.changedTouches[0].clientX
if (Math.abs(diff) > 40) { if (Math.abs(diff) > 30) {
if (isFa) { if (diff > 0) {
if (diff > 0) goNext() // Dragging finger left moves to next report
else goPrev() goNext()
} else { } else {
if (diff > 0) goPrev() // Dragging finger right moves to previous report
else goNext() goPrev()
} }
} }
touchStartX.current = null touchStartX.current = null
@ -175,50 +175,35 @@ export default function TechnogenSection() {
/> />
<div className="max-w-7xl mx-auto px-12 max-md:px-4" style={{ position: 'relative', zIndex: 1 }}> <div className="max-w-7xl mx-auto px-12 max-md:px-4" style={{ position: 'relative', zIndex: 1 }}>
{/* ── Section Header with Gold Accent Line & Slider Controls ── */} {/* ── Section Header with Gold Accent Line ── */}
<div <div
style={{ style={{
display: 'flex', display: 'flex',
alignItems: 'flex-end', alignItems: 'center',
justifyContent: 'space-between', justifyContent: 'space-between',
marginBottom: 24, marginBottom: 24,
flexWrap: 'wrap', flexWrap: 'wrap',
gap: 16, gap: 16,
}} }}
> >
<div> <div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}> <div style={{ width: 4, height: 28, background: GOLD, borderRadius: 2, flexShrink: 0 }} />
<div style={{ width: 4, height: 28, background: GOLD, borderRadius: 2, flexShrink: 0 }} /> <h2
<h2
style={{
fontSize: 'clamp(20px, 2.2vw, 28px)',
fontWeight: 900,
color: '#FFFFFF',
margin: 0,
letterSpacing: isFa ? '-0.5px' : '-0.2px',
lineHeight: 1.3,
}}
>
{isFa ? 'تکنوژن؛ برنامه توسعه‌گر ملی فناوری' : 'Technogen: National Technology Developer Program'}
</h2>
</div>
<p
style={{ style={{
fontSize: 13, fontSize: 'clamp(20px, 2.2vw, 28px)',
color: 'rgba(255,255,255,0.7)', fontWeight: 900,
margin: '6px 0 0', color: '#FFFFFF',
paddingInlineStart: 16, margin: 0,
lineHeight: 1.6, letterSpacing: isFa ? '-0.5px' : '-0.2px',
lineHeight: 1.3,
}} }}
> >
{isFa {isFa ? 'تکنوژن؛ برنامه توسعه‌گر ملی فناوری' : 'Technogen: National Technology Developer Program'}
? 'گزارش‌های تحلیلی و مطالعات تطبیقی یادگیری صنعتی، انتقال دانش و ساخت قابلیت فناورانه در زنجیره فولاد' </h2>
: 'Analytical notes and comparative studies on industrial learning, knowledge absorption, and technological capability building in steel.'}
</p>
</div> </div>
{/* Slider controls (visible on desktop if >5 or always on mobile if >1) */} {/* Slider controls (visible on desktop only if > 5 reports) */}
{totalPages > 1 && ( {!isMobile && totalPages > 1 && (
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}> <div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
<span style={{ fontSize: 12, color: 'rgba(255,255,255,0.6)', fontWeight: 600 }}> <span style={{ fontSize: 12, color: 'rgba(255,255,255,0.6)', fontWeight: 600 }}>
{isFa ? `${faNum(page + 1)} از ${faNum(totalPages)}` : `${page + 1} of ${totalPages}`} {isFa ? `${faNum(page + 1)} از ${faNum(totalPages)}` : `${page + 1} of ${totalPages}`}
@ -277,9 +262,9 @@ export default function TechnogenSection() {
<AnimatePresence mode="wait" custom={direction}> <AnimatePresence mode="wait" custom={direction}>
<motion.div <motion.div
key={page} key={page}
initial={{ opacity: 0, x: isFa ? direction * -30 : direction * 30 }} initial={{ opacity: 0, x: direction * 40 }}
animate={{ opacity: 1, x: 0 }} animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: isFa ? direction * 30 : direction * -30 }} exit={{ opacity: 0, x: -direction * 40 }}
transition={{ duration: 0.35, ease: EASE }} transition={{ duration: 0.35, ease: EASE }}
style={{ style={{
display: 'grid', display: 'grid',
@ -446,6 +431,7 @@ export default function TechnogenSection() {
{/* Mobile Dot Indicators */} {/* Mobile Dot Indicators */}
{isMobile && reports.length > 1 && ( {isMobile && reports.length > 1 && (
<div <div
dir={isFa ? 'rtl' : 'ltr'}
style={{ style={{
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
@ -462,7 +448,7 @@ export default function TechnogenSection() {
setPage(idx) setPage(idx)
}} }}
style={{ style={{
width: page === idx ? 20 : 6, width: page === idx ? 22 : 6,
height: 6, height: 6,
borderRadius: 3, borderRadius: 3,
background: page === idx ? GOLD : 'rgba(255,255,255,0.25)', background: page === idx ? GOLD : 'rgba(255,255,255,0.25)',