style(MobileSlider): adjust dot indicator sizes and spacing
Updated the height and margin of dot indicators for better visibility and alignment.
This commit is contained in:
parent
2610f91bec
commit
d3014b1ac8
1 changed files with 6 additions and 7 deletions
|
|
@ -121,7 +121,7 @@ export default function MobileSlider({
|
|||
|
||||
{/* Dot indicators, mobile only */}
|
||||
{showDots && slideCount > 1 && (
|
||||
<div className="sm:hidden flex justify-center mt-5 h-4 items-center">
|
||||
<div className="sm:hidden flex justify-center mt-6 h-6 items-center">
|
||||
{(() => {
|
||||
const MAX_DOTS = 5;
|
||||
let translateIndex = 0;
|
||||
|
|
@ -139,7 +139,7 @@ export default function MobileSlider({
|
|||
style={{ width: slideCount > MAX_DOTS ? "5.75rem" : "auto" }}
|
||||
>
|
||||
<div
|
||||
className="flex items-center h-5 px-1 gap-2 transition-transform duration-300 ease-out"
|
||||
className="flex items-center h-6 px-1 gap-2 transition-transform duration-300 ease-out"
|
||||
style={{
|
||||
transform: `translateX(-${translateIndex * 1.3}rem)`,
|
||||
}}
|
||||
|
|
@ -154,20 +154,19 @@ export default function MobileSlider({
|
|||
slideCount > MAX_DOTS &&
|
||||
translateIndex < slideCount - MAX_DOTS &&
|
||||
i === translateIndex + MAX_DOTS - 1;
|
||||
let dotClass =
|
||||
"w-3 h-3 bg-primary-foreground/30 hover:bg-primary-foreground/60";
|
||||
let dotClass = "w-3 h-3 bg-primary hover:bg-primary/85";
|
||||
|
||||
if (i === currentIndex) {
|
||||
dotClass = "w-3 h-3 bg-primary-foreground scale-110";
|
||||
dotClass = "w-5 h-5 bg-primary-foreground scale-110";
|
||||
} else if (isLeftEdge || isRightEdge) {
|
||||
dotClass =
|
||||
"w-2 h-2 bg-primary-foreground/30 hover:bg-primary-foreground/60";
|
||||
"w-2.5 h-2.5 bg-primary/70 hover:bg-primary/90";
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
key={`dot-${i}`}
|
||||
className="w-3 h-3 shrink-0 flex items-center justify-center"
|
||||
className="w-5 h-5 shrink-0 flex items-center justify-center"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue