fix some bug in some blocks

This commit is contained in:
mr.sabri
2026-07-23 06:55:21 +03:30
parent 89fbd6d158
commit edb3e10469
65 changed files with 1565 additions and 1476 deletions
+49 -19
View File
@@ -1,6 +1,6 @@
"use client";
import { ChevronRight, Plus } from "lucide-react";
import { ChevronLeft, ChevronRight, Plus } from "lucide-react";
import React from "react";
import { Button } from "@/components/ui/button";
@@ -9,8 +9,6 @@ import {
Carousel,
CarouselContent,
CarouselItem,
CarouselNext,
CarouselPrevious,
} from "@/components/ui/carousel";
import { cn } from "@/lib/utils";
@@ -49,7 +47,11 @@ const TESTIMONIALS = [
},
] as const;
const Feature242 = () => {
interface Feature242Props {
className?: string;
}
const Feature242 = ({ className }: Feature242Props) => {
const [api, setApi] = React.useState<CarouselApi>();
const [current, setCurrent] = React.useState(0);
const [count, setCount] = React.useState(0);
@@ -71,9 +73,13 @@ const Feature242 = () => {
value.toLocaleString("fa-IR", { minimumIntegerDigits: 2 });
return (
<section dir="rtl" lang="fa" className="overflow-hidden py-32">
<div className="relative container flex flex-col items-center md:px-0 lg:pt-8">
<div className="relative z-10 w-full items-center justify-between text-start lg:flex">
<section
dir="rtl"
lang="fa"
className={cn("relative w-full overflow-hidden py-32", className)}
>
<div className="relative container flex min-w-0 flex-col items-center md:px-0 lg:pt-8">
<div className="relative z-10 w-full min-w-0 items-center justify-between text-start lg:flex">
<h1 className="max-w-2xl text-2xll font-semibold tracking-tighter text-balance md:text-2xll">
با هوش مصنوعی سریع‌تر تصمیم بگیرید
</h1>
@@ -89,30 +95,31 @@ const Feature242 = () => {
</span>
</p>
</div>
<DottedDiv className="mt-8 flex w-full items-center justify-center px-2 py-10">
<DottedDiv className="mt-8 flex w-full min-w-0 items-center justify-center px-2 py-10">
<Carousel
opts={{
align: "center",
loop: true,
direction: "rtl",
}}
className="w-full"
className="w-full min-w-0"
setApi={setApi}
>
<CarouselContent className="m-0 flex w-full">
{/* Override -ml-4 — breaks RTL track sizing */}
<CarouselContent className="-ml-0! m-0 flex w-full">
{TESTIMONIALS.map((item) => (
<CarouselItem
key={item.id}
className="px-2 md:basis-1/2 lg:basis-1/3"
className="min-w-0 pl-0! px-2 md:basis-1/2 lg:basis-1/3"
>
<div className="group relative flex h-full max-h-96 w-full flex-col items-start justify-between rounded-3xl bg-muted p-5 text-ellipsis">
<div className="group relative flex h-full max-h-96 w-full min-w-0 flex-col items-start justify-between rounded-3xl bg-muted p-5 text-ellipsis">
<img
className="max-h-72 w-full opacity-100 transition-all ease-in-out group-hover:scale-90 group-hover:opacity-60"
className="max-h-72 w-full max-w-full opacity-100 transition-all ease-in-out group-hover:scale-90 group-hover:opacity-60"
src={item.imgSrc}
alt={item.imageAlt}
/>
<div className="flex w-full items-center justify-between gap-4">
<h5 className="text-xl leading-7 font-medium tracking-tighter text-balance transition-all ease-in-out group-hover:translate-x-4 rtl:group-hover:-translate-x-4">
<div className="flex w-full min-w-0 items-center justify-between gap-4">
<h5 className="min-w-0 text-xl leading-7 font-medium tracking-tighter text-balance transition-all ease-in-out group-hover:translate-x-4 rtl:group-hover:-translate-x-4">
{item.title}
</h5>
<a
@@ -142,9 +149,32 @@ const Feature242 = () => {
</span>
</div>
<div className="relative me-10 flex gap-2">
<CarouselPrevious className="size-10" />
<CarouselNext variant="default" className="size-10" />
{/*
Embla RTL: scrollNext/scrollPrev are index-based, so default
ChevronLeft→prev / ChevronRight→next feels reversed visually.
Match arrow direction to movement by swapping handlers.
*/}
<div className="relative z-10 flex gap-2">
<Button
type="button"
variant="outline"
size="icon"
className="size-10 rounded-full"
onClick={() => api?.scrollNext()}
aria-label="اسلاید بعدی"
>
<ChevronLeft className="size-4" />
</Button>
<Button
type="button"
variant="default"
size="icon"
className="size-10 rounded-full"
onClick={() => api?.scrollPrev()}
aria-label="اسلاید قبلی"
>
<ChevronRight className="size-4" />
</Button>
</div>
</div>
</Carousel>
@@ -163,7 +193,7 @@ const DottedDiv = ({
children: React.ReactNode;
className?: string;
}) => (
<div className={cn("relative", className)}>
<div className={cn("relative min-w-0 overflow-hidden", className)}>
<div className="absolute top-4 -start-[12.5px] h-px w-[110%] bg-muted md:-start-20" />
<div className="absolute bottom-4 -start-[12.5px] h-px w-[110%] bg-muted md:-start-20" />
<div className="absolute -top-4 start-0 h-[110%] w-px bg-muted" />