fix some bug in some blocks
This commit is contained in:
+27
-23
@@ -90,7 +90,7 @@ const FeatureCard = ({ feature, isActive, onClick }: FeatureCardProps) => {
|
||||
style={{
|
||||
borderRadius: "24px",
|
||||
}}
|
||||
className="flex cursor-pointer items-start gap-4 overflow-hidden bg-background text-start md:w-fit md:max-w-sm"
|
||||
className="flex min-w-0 max-w-full cursor-pointer items-start gap-4 overflow-hidden bg-background text-start md:w-fit md:max-w-sm"
|
||||
onClick={onClick}
|
||||
>
|
||||
{isActive ? (
|
||||
@@ -106,7 +106,7 @@ const FeatureCard = ({ feature, isActive, onClick }: FeatureCardProps) => {
|
||||
delay: 0.3,
|
||||
ease: "easeOut",
|
||||
}}
|
||||
className="p-6 text-sm md:p-8 md:text-base"
|
||||
className="min-w-0 p-6 text-sm md:p-8 md:text-base"
|
||||
>
|
||||
<p className="text-pretty">
|
||||
<span className="font-semibold">{feature.title}.</span>{" "}
|
||||
@@ -136,7 +136,7 @@ const FeatureCard = ({ feature, isActive, onClick }: FeatureCardProps) => {
|
||||
}}
|
||||
>
|
||||
<PlusCircle strokeWidth={1.5} className="shrink-0" />
|
||||
<p className="shrink-0 font-semibold">{feature.title}</p>
|
||||
<p className="min-w-0 font-semibold">{feature.title}</p>
|
||||
</motion.div>
|
||||
)}
|
||||
</motion.div>
|
||||
@@ -164,14 +164,14 @@ const FeaturesDesktop = ({
|
||||
isNextDisabled,
|
||||
}: FeaturesDesktopProps) => {
|
||||
return (
|
||||
<div className="relative z-10 hidden items-center gap-8 md:flex">
|
||||
<div className="relative z-10 hidden min-w-0 items-center gap-8 md:flex">
|
||||
<Controls
|
||||
handleNext={handleNext}
|
||||
handlePrevious={handlePrevious}
|
||||
isPrevioIRRisabled={isPrevioIRRisabled}
|
||||
isNextDisabled={isNextDisabled}
|
||||
/>
|
||||
<div className="flex flex-col gap-4">
|
||||
<div className="flex min-w-0 flex-col gap-4">
|
||||
{features.map((feature, index) => {
|
||||
return (
|
||||
<FeatureCard
|
||||
@@ -209,8 +209,8 @@ const FeaturesMobile = ({
|
||||
const variants = {
|
||||
initial: (dir: 1 | -1) => ({
|
||||
opacity: 0,
|
||||
scale: 0.6,
|
||||
x: `${dir * -50}%`,
|
||||
scale: 0.9,
|
||||
x: `${dir * -20}%`,
|
||||
}),
|
||||
animate: {
|
||||
opacity: 1,
|
||||
@@ -219,17 +219,17 @@ const FeaturesMobile = ({
|
||||
},
|
||||
exit: (dir: 1 | -1) => ({
|
||||
opacity: 0,
|
||||
scale: 0.6,
|
||||
x: `${dir * 50}%`,
|
||||
scale: 0.9,
|
||||
x: `${dir * 20}%`,
|
||||
}),
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="absolute bottom-6 start-0 z-10 flex w-full items-end justify-between gap-6 px-6 md:hidden">
|
||||
<div className="absolute inset-x-0 bottom-6 z-10 flex w-full min-w-0 items-end justify-between gap-3 px-4 sm:gap-6 sm:px-6 md:hidden">
|
||||
<Button
|
||||
variant="outline"
|
||||
size="icon"
|
||||
className="rounded-full !bg-background/100 [&_svg:not([class*='size-'])]:size-6"
|
||||
className="shrink-0 rounded-full !bg-background/100 [&_svg:not([class*='size-'])]:size-6"
|
||||
onClick={handlePrevious}
|
||||
disabled={isPrevioIRRisabled}
|
||||
>
|
||||
@@ -247,7 +247,7 @@ const FeaturesMobile = ({
|
||||
duration: 0.2,
|
||||
ease: "easeOut",
|
||||
}}
|
||||
className="h-full w-full object-cover"
|
||||
className="h-full min-w-0 flex-1 object-cover"
|
||||
>
|
||||
<FeatureCard
|
||||
feature={features[activeIndex]}
|
||||
@@ -260,7 +260,7 @@ const FeaturesMobile = ({
|
||||
<Button
|
||||
variant="outline"
|
||||
size="icon"
|
||||
className="rounded-full !bg-background/100 [&_svg:not([class*='size-'])]:size-6"
|
||||
className="shrink-0 rounded-full !bg-background/100 [&_svg:not([class*='size-'])]:size-6"
|
||||
onClick={handleNext}
|
||||
disabled={isNextDisabled}
|
||||
>
|
||||
@@ -356,9 +356,9 @@ const Feature323 = ({
|
||||
setActiveIndex(index);
|
||||
};
|
||||
|
||||
const xOffset = !isMobile ? 50 : 15;
|
||||
const yOffset = !isMobile ? 15 : 5;
|
||||
const scale = !isMobile ? 0.6 : 0.8;
|
||||
const xOffset = !isMobile ? 20 : 10;
|
||||
const yOffset = !isMobile ? 10 : 5;
|
||||
const scale = !isMobile ? 0.85 : 0.9;
|
||||
|
||||
const variants = {
|
||||
initial: (dir: 1 | -1) => ({
|
||||
@@ -385,14 +385,18 @@ const Feature323 = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<section dir="rtl" lang="fa" className={cn("py-32", className)}>
|
||||
<div className="container space-y-20">
|
||||
<div className="relative start-1/2 max-w-5xl -translate-x-1/2">
|
||||
<h2 className="text-xl font-semibold text-balance sm:text-2xll">
|
||||
<section
|
||||
dir="rtl"
|
||||
lang="fa"
|
||||
className={cn("relative w-full min-w-0 overflow-hidden py-32", className)}
|
||||
>
|
||||
<div className="container min-w-0 space-y-20">
|
||||
<div className="mx-auto w-full min-w-0 max-w-5xl">
|
||||
<h2 className="text-xl font-semibold text-balance break-words sm:text-2xll">
|
||||
{heading}
|
||||
</h2>
|
||||
</div>
|
||||
<div className="relative h-full min-h-[60vh] w-full overflow-hidden rounded-4xl bg-muted px-8 py-8 md:min-h-full md:py-20">
|
||||
<div className="relative h-full min-h-[60vh] w-full min-w-0 max-w-full overflow-hidden rounded-4xl bg-muted px-4 py-8 sm:px-8 md:min-h-full md:py-20">
|
||||
<FeaturesDesktop
|
||||
features={features}
|
||||
handleNext={handleNext}
|
||||
@@ -412,7 +416,7 @@ const Feature323 = ({
|
||||
isNextDisabled={activeIndex === features.length - 1}
|
||||
/>
|
||||
|
||||
<div className="absolute top-0 end-0 z-0 flex h-full w-full items-center justify-center lg:w-2/3 lg:mask-[linear-gradient(to_left,_transparent,_black_30%,_black)]">
|
||||
<div className="absolute inset-0 z-0 flex h-full w-full min-w-0 items-center justify-center overflow-hidden lg:inset-y-0 lg:end-0 lg:start-auto lg:w-2/3 lg:mask-[linear-gradient(to_left,_transparent,_black_30%,_black)]">
|
||||
<AnimatePresence mode="popLayout" custom={direction}>
|
||||
<motion.img
|
||||
key={`feature-image-${features[activeIndex]?.id}`}
|
||||
@@ -427,7 +431,7 @@ const Feature323 = ({
|
||||
}}
|
||||
src={features[activeIndex].image}
|
||||
alt={features[activeIndex].title}
|
||||
className="h-full w-full object-cover"
|
||||
className="h-full w-full max-w-full object-cover"
|
||||
/>
|
||||
</AnimatePresence>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user