fix(home): fix mobile slider vertical scroll chaining, unify view-all headers, and enhance CTA and navigation cards
This commit is contained in:
1 parent
49eb1e5ff3
commit
ba9472c938
15 files changed
+3805
-3761
No files matched your search
@@ -59,22 +59,22 @@ export default function BlogPreviewSection() {
|
||||
<section className="py-8 sm:py-20 bg-white font-vazir" dir="rtl">
|
||||
<div className="max-w-7xl mx-auto px-4">
|
||||
{/* Section Header */}
|
||||
<div className="flex flex-col md:flex-row md:items-end justify-between mb-6 sm:mb-16 gap-4 sm:gap-6">
|
||||
<div className="flex flex-col sm:flex-row sm:items-end justify-between mb-6 sm:mb-12 pb-4 sm:pb-6 border-b border-medical-gray-200 gap-3 sm:gap-6">
|
||||
<div className="max-w-2xl">
|
||||
<div className="inline-flex items-center gap-2 px-3 py-1 bg-canina-blue/10 text-canina-blue rounded-full text-[10px] font-black uppercase tracking-widest mb-3 sm:mb-4">
|
||||
<div className="inline-flex items-center gap-2 px-3 py-1 bg-canina-blue/10 text-canina-blue rounded-full text-[10px] font-black uppercase tracking-widest mb-2 sm:mb-3 font-vazir">
|
||||
<BookOpen className="w-3 h-3" />
|
||||
<span>{getText("blog_preview_badge", "دانشنامه و مقالات علمی")}</span>
|
||||
</div>
|
||||
<h2 className="text-2xl sm:text-4xl md:text-5xl font-black text-medical-gray-900 leading-tight font-lalezar tracking-wide">
|
||||
<h2 className="text-2xl sm:text-3xl md:text-4xl font-black text-medical-gray-900 leading-tight font-lalezar tracking-wide">
|
||||
{getText("blog_preview_title", "تازهترین مقالات")} <span className="text-canina-blue">{getText("blog_preview_title_highlight", "دامپزشکی و سلامت")}</span>
|
||||
</h2>
|
||||
<p className="text-sm sm:text-lg text-medical-gray-500 font-medium mt-2 sm:mt-4">
|
||||
<p className="text-sm sm:text-base text-medical-gray-500 font-medium mt-2 sm:mt-3 leading-relaxed">
|
||||
{getText("blog_preview_desc", "راهنماهای علمی و کاربردی برای نگهداری، تغذیه و پیشگیری از بیماریهای سگ و گربه بر اساس آخرین تحقیقات بینالمللی.")}
|
||||
</p>
|
||||
</div>
|
||||
<Link
|
||||
href="/blog"
|
||||
className="inline-flex items-center gap-1.5 sm:gap-2 text-canina-blue font-bold text-xs sm:text-sm hover:translate-x-1 transition-transform rtl:hover:-translate-x-1"
|
||||
className="inline-flex items-center gap-1.5 sm:gap-2 text-canina-blue font-black text-xs sm:text-sm hover:translate-x-1 transition-all rtl:hover:-translate-x-1 group font-vazir self-start sm:self-auto shrink-0"
|
||||
>
|
||||
<span>{getText("blog_preview_view_all", "مشاهده همه مقالات")}</span>
|
||||
<ArrowLeft className="w-4 h-4" />
|
||||
@@ -83,7 +83,7 @@ export default function BlogPreviewSection() {
|
||||
|
||||
{/* Blog Grid */}
|
||||
{isLoading ? (
|
||||
<div className="flex md:grid md:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-8 overflow-x-auto md:overflow-visible pb-4 md:pb-0 micro-hscroll -mx-4 px-4 md:mx-0 md:px-0 select-none touch-pan-x snap-x snap-mandatory md:snap-none">
|
||||
<div className="flex md:grid md:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-8 overflow-x-auto md:overflow-visible pb-4 md:pb-0 micro-hscroll -mx-4 px-4 md:mx-0 md:px-0 select-none snap-x snap-mandatory md:snap-none overscroll-x-contain">
|
||||
{[1, 2, 3].map((i) => (
|
||||
<div
|
||||
key={i}
|
||||
@@ -96,7 +96,7 @@ export default function BlogPreviewSection() {
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex md:grid md:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-8 overflow-x-auto md:overflow-visible pb-4 md:pb-0 micro-hscroll -mx-4 px-4 md:mx-0 md:px-0 select-none touch-pan-x snap-x snap-mandatory md:snap-none">
|
||||
<div className="flex md:grid md:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-8 overflow-x-auto md:overflow-visible pb-4 md:pb-0 micro-hscroll -mx-4 px-4 md:mx-0 md:px-0 select-none snap-x snap-mandatory md:snap-none overscroll-x-contain">
|
||||
{blogs.map((blog, idx) => {
|
||||
const image = blog.imageUrl?.startsWith("http")
|
||||
? blog.imageUrl
|
||||
|
||||
@@ -191,26 +191,26 @@ export default function FeaturedProducts() {
|
||||
return (
|
||||
<section className="py-8 sm:py-16 bg-medical-gray-50">
|
||||
<div className="max-w-7xl mx-auto px-4">
|
||||
<div className="flex items-center justify-between w-full mb-6 sm:mb-12 pb-4 sm:pb-6 border-b border-medical-gray-200 gap-2">
|
||||
<div>
|
||||
<div className="text-canina-blue text-[10px] sm:text-xs font-bold uppercase tracking-[0.2em] mb-1 sm:mb-2 font-vazir">
|
||||
<div className="flex flex-col sm:flex-row sm:items-end justify-between w-full mb-6 sm:mb-12 pb-4 sm:pb-6 border-b border-medical-gray-200 gap-3 sm:gap-6">
|
||||
<div className="max-w-2xl">
|
||||
<div className="text-canina-blue text-[10px] sm:text-xs font-bold uppercase tracking-[0.2em] mb-1.5 sm:mb-2 font-vazir">
|
||||
{getText("featured_badge", "بیشترین انتخاب توسط دامپزشکان")}
|
||||
</div>
|
||||
<h2 className="text-xl sm:text-2xl md:text-3xl lg:text-4xl font-black text-medical-gray-900 font-lalezar tracking-wide">
|
||||
<h2 className="text-2xl sm:text-3xl md:text-4xl font-black text-medical-gray-900 font-lalezar tracking-wide leading-tight">
|
||||
{getText("featured_title_line1", "محصولات برگزیده و راهکارهای")}{" "}
|
||||
<span className="text-canina-blue">{getText("featured_title_line2", "درمان تخصصی")}</span>
|
||||
</h2>
|
||||
</div>
|
||||
<button
|
||||
onClick={() => router.push("/shop")}
|
||||
className="inline-flex items-center gap-1 sm:gap-2 text-canina-blue font-black text-xs sm:text-sm hover:translate-x-1 transition-all group font-vazir shrink-0"
|
||||
<Link
|
||||
href="/shop"
|
||||
className="inline-flex items-center gap-1.5 sm:gap-2 text-canina-blue font-black text-xs sm:text-sm hover:translate-x-1 transition-all rtl:hover:-translate-x-1 group font-vazir self-start sm:self-auto shrink-0"
|
||||
>
|
||||
<span>{getText("featured_view_all", "مشاهده تمامی محصولات")}</span>
|
||||
<span className="text-sm sm:text-lg group-hover:-translate-x-1 transition-transform">←</span>
|
||||
</button>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div className="flex md:grid md:grid-cols-2 lg:grid-cols-4 gap-4 md:gap-6 overflow-x-auto md:overflow-visible pb-4 md:pb-0 micro-hscroll -mx-4 px-4 md:mx-0 md:px-0 select-none touch-pan-x snap-x snap-mandatory md:snap-none">
|
||||
<div className="flex md:grid md:grid-cols-2 lg:grid-cols-4 gap-4 md:gap-6 overflow-x-auto md:overflow-visible pb-4 md:pb-0 micro-hscroll -mx-4 px-4 md:mx-0 md:px-0 select-none snap-x snap-mandatory md:snap-none overscroll-x-contain">
|
||||
{isLoading ? (
|
||||
Array.from({ length: 4 }).map((_, i) => (
|
||||
<div key={i} className="w-[68vw] sm:w-[50vw] md:w-auto flex-shrink-0 snap-start">
|
||||
|
||||
@@ -98,31 +98,31 @@ export default function VetGallery({ testimonials = [] }: { testimonials?: Testi
|
||||
return (
|
||||
<section className="py-8 sm:py-20 bg-white font-vazir relative overflow-hidden" dir="rtl">
|
||||
<div className="max-w-7xl mx-auto px-4">
|
||||
<div className="flex flex-col md:flex-row md:items-end justify-between mb-6 sm:mb-16 gap-4 sm:gap-6">
|
||||
<div className="flex flex-col sm:flex-row sm:items-end justify-between mb-6 sm:mb-12 pb-4 sm:pb-6 border-b border-medical-gray-200 gap-3 sm:gap-6">
|
||||
<div className="max-w-2xl">
|
||||
<div className="inline-flex items-center gap-2 px-3 py-1 bg-canina-blue/10 text-canina-blue rounded-full text-[10px] font-black uppercase tracking-widest mb-3 sm:mb-4">
|
||||
<div className="inline-flex items-center gap-2 px-3 py-1 bg-canina-blue/10 text-canina-blue rounded-full text-[10px] font-black uppercase tracking-widest mb-2 sm:mb-3 font-vazir">
|
||||
<Star className="w-3 h-3" />
|
||||
{getText('videos_badge', "Vet Insights")}
|
||||
</div>
|
||||
<h2 className="text-2xl sm:text-4xl md:text-5xl font-black text-medical-gray-900 leading-tight font-lalezar tracking-wide" suppressHydrationWarning>
|
||||
<h2 className="text-2xl sm:text-3xl md:text-4xl font-black text-medical-gray-900 leading-tight font-lalezar tracking-wide" suppressHydrationWarning>
|
||||
{getText('videos_title', "مشاوره ویدئویی")} <span className="text-canina-blue underline decoration-4 decoration-canina-blue/20 underline-offset-8">{getText('videos_title_highlight', "دوست دامپزشک پت شما")}</span>
|
||||
</h2>
|
||||
<p className="text-sm sm:text-lg text-medical-gray-500 font-medium mt-2 sm:mt-6" suppressHydrationWarning>
|
||||
<p className="text-sm sm:text-base text-medical-gray-500 font-medium mt-2 sm:mt-3 leading-relaxed" suppressHydrationWarning>
|
||||
{getText('videos_desc', "تیم علمی و فرمولهکنندگان کمپانی کنینا در آلمان مستقیماً با شما صحبت میکنند؛ آشنایی با نحوه مصرف، مزایای بالینی و دانش پزشکی پشت هر محصول.")}
|
||||
</p>
|
||||
</div>
|
||||
<Link
|
||||
href="/videos"
|
||||
className="inline-flex items-center gap-2 text-canina-blue font-bold text-xs sm:text-sm hover:translate-x-1 transition-transform rtl:hover:-translate-x-1"
|
||||
className="inline-flex items-center gap-1.5 sm:gap-2 text-canina-blue font-black text-xs sm:text-sm hover:translate-x-1 transition-all rtl:hover:-translate-x-1 group font-vazir self-start sm:self-auto shrink-0"
|
||||
>
|
||||
{getText('videos_view_all', "مشاهده همه ویدئوها")}
|
||||
<Play className="w-4 h-4" />
|
||||
<span>{getText('videos_view_all', "مشاهده همه ویدئوها")}</span>
|
||||
<Play className="w-3.5 h-3.5" />
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
{/* Video Grid or Skeleton */}
|
||||
{isLoading ? (
|
||||
<div className="flex md:grid md:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-6 overflow-x-auto md:overflow-visible pb-4 md:pb-0 micro-hscroll -mx-4 px-4 md:mx-0 md:px-0 select-none touch-pan-x snap-x snap-mandatory md:snap-none">
|
||||
<div className="flex md:grid md:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-6 overflow-x-auto md:overflow-visible pb-4 md:pb-0 micro-hscroll -mx-4 px-4 md:mx-0 md:px-0 select-none snap-x snap-mandatory md:snap-none overscroll-x-contain">
|
||||
{[1, 2, 3].map((i) => (
|
||||
<div key={i} className="w-[68vw] sm:w-[50vw] md:w-auto flex-shrink-0 snap-start rounded-[2rem] p-2 space-y-3 animate-pulse">
|
||||
<div className="aspect-video bg-medical-gray-100 rounded-[1.5rem] sm:rounded-[2rem]" />
|
||||
@@ -132,7 +132,7 @@ export default function VetGallery({ testimonials = [] }: { testimonials?: Testi
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex md:grid md:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-6 overflow-x-auto md:overflow-visible pb-4 md:pb-0 micro-hscroll -mx-4 px-4 md:mx-0 md:px-0 select-none touch-pan-x snap-x snap-mandatory md:snap-none">
|
||||
<div className="flex md:grid md:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-6 overflow-x-auto md:overflow-visible pb-4 md:pb-0 micro-hscroll -mx-4 px-4 md:mx-0 md:px-0 select-none snap-x snap-mandatory md:snap-none overscroll-x-contain">
|
||||
{apiVideos.map((video, index) => (
|
||||
<div key={video.id} className="w-[68vw] sm:w-[50vw] md:w-auto flex-shrink-0 snap-start flex">
|
||||
<motion.button
|
||||
|
||||
Reference in new issue
Block a user