Skip to content

Commit c22067e

Browse files
committed
Disable nav card scale-in for icon mode
1 parent 9779f0d commit c22067e

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/components/card.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ interface Props {
1414
x: number
1515
y: number
1616
children: React.ReactNode
17+
enterScale?: number
1718
}
1819

19-
export default function Card({ children, order, width, height, x, y, className }: Props) {
20+
export default function Card({ children, order, width, height, x, y, className, enterScale = 0.6 }: Props) {
2021
const { maxSM, init } = useSize()
2122
let [show, setShow] = useState(false)
2223
if (maxSM && init) order = 0
@@ -36,7 +37,7 @@ export default function Card({ children, order, width, height, x, y, className }
3637
return (
3738
<motion.div
3839
className={cn('card squircle', className)}
39-
initial={{ opacity: 0, scale: 0.6, left: x, top: y, width, height }}
40+
initial={{ opacity: 0, scale: enterScale, left: x, top: y, width, height }}
4041
animate={{ opacity: 1, scale: 1, left: x, top: y, width, height }}
4142
whileHover={{ scale: 1.05 }}
4243
whileTap={{ scale: 0.95 }}>

src/components/nav-card.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ export default function NavCard() {
198198
height={size.height}
199199
x={position.x}
200200
y={position.y}
201+
enterScale={form === 'icons' ? 1 : 0.6}
201202
className={clsx(form === 'mini' && 'overflow-hidden p-3', form === 'icons' && 'overflow-visible flex items-center gap-2 px-4 py-2 sm:gap-4', form === 'full' && 'p-6')}>
202203
{form === 'full' && siteContent.enableChristmas && (
203204
<>

0 commit comments

Comments
 (0)