diff --git a/blocks/hero108.tsx b/blocks/hero108.tsx index e8b7979..e5985af 100644 --- a/blocks/hero108.tsx +++ b/blocks/hero108.tsx @@ -12,8 +12,8 @@ const Hero108 = ({ className }: Hero108Props) => {
-
-
+
+

درآمد غیرفعال{" "} diff --git a/blocks/hero187.tsx b/blocks/hero187.tsx index 967fca3..3716523 100644 --- a/blocks/hero187.tsx +++ b/blocks/hero187.tsx @@ -97,7 +97,7 @@ const Hero187 = ({
{/* Left side - Content */} -
+

{heading} @@ -152,19 +152,22 @@ const Hero187 = ({ />

- {/* Right side - Carousel */} -
+ {/* Outer-edge carousel: bleed with -me so RTL/LTR both extend away from copy */} +
{activeImages.map((image, index) => ( - + {image.alt} {
-

+

کمتر زمان صرف کنید، بیشتر بسازید -

+

صدها بلاک و کامپوننت آماده مبتنی بر رابط کاربری، استایل‌دهی مدرن و ری یو آی که مستقیماً در پروژه‌های شما قابل استفاده هستند. -

+

@@ -145,30 +145,32 @@ const Hero211 = ({ className }: Hero211Props) => {
+ + {/* RTL: sit to the left of the button so handwriting doesn't cover it */} -

+

همین امروز نسخه رایگان را امتحان کنید -

+

diff --git a/blocks/hero212.tsx b/blocks/hero212.tsx index f5313b4..55e52a6 100644 --- a/blocks/hero212.tsx +++ b/blocks/hero212.tsx @@ -67,10 +67,10 @@ const Hero212 = ({ className }: Hero212Props) => {

صدها بلاک و کامپوننت آماده مبتنی بر رابط کاربری، استایل‌دهی مدرن و ری یو آی -

-

+

+

تجربه‌ای متفاوت خلق کنید -

+
@@ -97,30 +97,32 @@ const Hero212 = ({ className }: Hero212Props) => {
+ + {/* RTL: sit to the left of the button so handwriting doesn't cover it */} -

+

همین امروز نسخه رایگان را امتحان کنید -

+

diff --git a/blocks/hero213.tsx b/blocks/hero213.tsx index 09c220a..d240c1f 100644 --- a/blocks/hero213.tsx +++ b/blocks/hero213.tsx @@ -12,81 +12,99 @@ interface Hero213Props { className?: string; } -const Hero213 = ({ className }: Hero213Props) => { - const images = [ - { - src: "/block-media/shadcnblocks/block/lummi/bw12.jpeg", - alt: "تصویر نمونه", - name: "Joanna Doe", - }, - { - src: "/block-media/shadcnblocks/block/lummi/bw13.jpeg", - alt: "تصویر نمونه", - name: "مریم چناری", - }, - { - src: "/block-media/shadcnblocks/block/lummi/bw14.jpeg", - alt: "تصویر نمونه", - name: "Joanna Doe", - }, - ]; +const IMAGES = [ + { + src: "/block-media/shadcnblocks/block/lummi/bw12.jpeg", + alt: "تصویر نمونه", + name: "Joanna Doe", + }, + { + src: "/block-media/shadcnblocks/block/lummi/bw13.jpeg", + alt: "تصویر نمونه", + name: "مریم چناری", + }, + { + src: "/block-media/shadcnblocks/block/lummi/bw14.jpeg", + alt: "تصویر نمونه", + name: "Joanna Doe", + }, +] as const; +const Hero213 = ({ className }: Hero213Props) => { const [currentIndex, setCurrentIndex] = useState(0); + const nextIndex = (currentIndex + 1) % IMAGES.length; useEffect(() => { const timer = setTimeout(() => { - setCurrentIndex((prevIndex) => (prevIndex + 1) % images.length); + setCurrentIndex((prev) => (prev + 1) % IMAGES.length); }, 2500); return () => clearTimeout(timer); - }, [currentIndex, images.length]); + }, [currentIndex]); return ( -
+
-

+

مجموعه بلاک‌های آماده
برای رابط کاربری و استایل‌دهی مدرن -

-

- صدها کامپوننت استاندارد و قابل سفارشی‌سازی که مستقیماً در پروژه‌های شما قابل استفاده هستند. -

+ +

+ صدها کامپوننت استاندارد و قابل سفارشی‌سازی که مستقیماً در پروژه‌های + شما قابل استفاده هستند. +

+
- - - - - -
- - - + {/* Shared box = mask bounds, so the tile can sit in the cutout precisely */} +
+ + + + + + + {/* + type-3 cutout ≈ left 0–12.5%, bottom pocket ≈ 29% of height. + Tile sized under that so a white gutter remains vs the concave edge. + left/bottom 0 align with the mask’s outer edges (like the reference). + */} +
@@ -103,7 +121,7 @@ interface SvgPath { } interface MaskedDivProps { - children: React.ReactElement; + children: React.ReactNode; maskType?: MaskType; className?: string; backgroundColor?: string; @@ -121,9 +139,10 @@ const svgPaths: Record = { height: 381, width: 850, }, + // Height matches path bounds (max Y ≈ 765) so the cutout sits on the true bottom edge "type-3": { path: "M0.680664 112.659C0.680664 50.805 50.823 0.662672 112.677 0.662672H413.07C456.315 0.662672 497.495 19.1588 526.221 51.4846V51.4846C554.948 83.8104 596.128 102.307 639.373 102.307H711.793C752.427 102.307 790.787 83.5522 815.744 51.4846V51.4846C840.7 19.417 879.06 0.662644 919.695 0.662597L1225.01 0.66224C1286.86 0.662168 1337.01 50.8046 1337.01 112.658V652.815C1337.01 714.668 1286.86 764.811 1225.01 764.811L670 764.811H335.34H278.376C217.423 764.811 168.01 715.399 168.01 654.446V626.747C168.01 580.208 130.283 542.48 83.7437 542.48V542.48C37.8692 542.48 0.680664 505.292 0.680664 459.417V382.737V112.659Z", - height: 889, + height: 765, width: 1340, }, "type-4": { @@ -133,6 +152,10 @@ const svgPaths: Record = { }, }; +function buildMaskDataUrl(mask: SvgPath): string { + return `data:image/svg+xml,%3Csvg width='${mask.width}' height='${mask.height}' viewBox='0 0 ${mask.width} ${mask.height}' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='${mask.path}' fill='%23D9D9D9'/%3E%3C/svg%3E`; +} + const MaskedDiv: React.FC = ({ children, maskType = "type-1", @@ -141,30 +164,30 @@ const MaskedDiv: React.FC = ({ size = 1, }) => { const selectedMask = svgPaths[maskType]; - - const svgString = `${selectedMask.width}${selectedMask.height}${selectedMask.width} ${selectedMask.height}${selectedMask.path}`; + const maskUrl = buildMaskDataUrl(selectedMask); const containerStyle: React.CSSProperties = { - aspectRatio: `${selectedMask.width}/${selectedMask.height}`, + aspectRatio: `${selectedMask.width} / ${selectedMask.height}`, backgroundColor, - maskImage: `url("${svgString}")`, - WebkitMaskImage: `url("${svgString}")`, + maskImage: `url("${maskUrl}")`, + WebkitMaskImage: `url("${maskUrl}")`, maskRepeat: "no-repeat", WebkitMaskRepeat: "no-repeat", - maskSize: "contain", - WebkitMaskSize: "contain", + maskSize: "100% 100%", + WebkitMaskSize: "100% 100%", + maskPosition: "center", + WebkitMaskPosition: "center", width: `${size * 100}%`, maxWidth: "100%", - margin: "0 auto", + marginInline: "auto", }; return ( -
- {React.cloneElement(children, { - className: `w-full h-full object-cover transition-all duration-300 ${ - children.props.className || "" - }`, - })} -
+
+ {children} +
); };