diff --git a/package.json b/package.json index 716f01e..e18ebc6 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "i18next": "^26.0.4", "ky": "^2.0.0", "lucide-react": "^0.577.0", + "motion": "^12.38.0", "province-city-china": "^8.5.8", "react": "^19.2.4", "react-dom": "^19.2.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 57aeb3b..085140e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,6 +26,9 @@ importers: lucide-react: specifier: ^0.577.0 version: 0.577.0(react@19.2.4) + motion: + specifier: ^12.38.0 + version: 12.38.0(react-dom@19.2.4(react@19.2.4))(react@19.2.4) province-city-china: specifier: ^8.5.8 version: 8.5.8 @@ -911,6 +914,20 @@ packages: flatted@3.4.1: resolution: {integrity: sha512-IxfVbRFVlV8V/yRaGzk0UVIcsKKHMSfYw66T/u4nTwlWteQePsxe//LjudR1AMX4tZW3WFCh3Zqa/sjlqpbURQ==} + framer-motion@12.38.0: + resolution: {integrity: sha512-rFYkY/pigbcswl1XQSb7q424kSTQ8q6eAC+YUsSKooHQYuLdzdHjrt6uxUC+PRAO++q5IS7+TamgIw1AphxR+g==} + peerDependencies: + '@emotion/is-prop-valid': '*' + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + '@emotion/is-prop-valid': + optional: true + react: + optional: true + react-dom: + optional: true + fs-extra@11.3.4: resolution: {integrity: sha512-CTXd6rk/M3/ULNQj8FBqBWHYBVYybQ3VPBw0xGKFe3tuH7ytT6ACnvzpIQ3UZtB8yvUKC2cXn1a+x+5EVQLovA==} engines: {node: '>=14.14'} @@ -1252,6 +1269,26 @@ packages: resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} engines: {node: '>= 18'} + motion-dom@12.38.0: + resolution: {integrity: sha512-pdkHLD8QYRp8VfiNLb8xIBJis1byQ9gPT3Jnh2jqfFtAsWUA3dEepDlsWe/xMpO8McV+VdpKVcp+E+TGJEtOoA==} + + motion-utils@12.36.0: + resolution: {integrity: sha512-eHWisygbiwVvf6PZ1vhaHCLamvkSbPIeAYxWUuL3a2PD/TROgE7FvfHWTIH4vMl798QLfMw15nRqIaRDXTlYRg==} + + motion@12.38.0: + resolution: {integrity: sha512-uYfXzeHlgThchzwz5Te47dlv5JOUC7OB4rjJ/7XTUgtBZD8CchMN8qEJ4ZVsUmTyYA44zjV0fBwsiktRuFnn+w==} + peerDependencies: + '@emotion/is-prop-valid': '*' + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + '@emotion/is-prop-valid': + optional: true + react: + optional: true + react-dom: + optional: true + ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -2502,6 +2539,15 @@ snapshots: flatted@3.4.1: {} + framer-motion@12.38.0(react-dom@19.2.4(react@19.2.4))(react@19.2.4): + dependencies: + motion-dom: 12.38.0 + motion-utils: 12.36.0 + tslib: 2.8.1 + optionalDependencies: + react: 19.2.4 + react-dom: 19.2.4(react@19.2.4) + fs-extra@11.3.4: dependencies: graceful-fs: 4.2.11 @@ -2756,6 +2802,20 @@ snapshots: dependencies: minipass: 7.1.3 + motion-dom@12.38.0: + dependencies: + motion-utils: 12.36.0 + + motion-utils@12.36.0: {} + + motion@12.38.0(react-dom@19.2.4(react@19.2.4))(react@19.2.4): + dependencies: + framer-motion: 12.38.0(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + tslib: 2.8.1 + optionalDependencies: + react: 19.2.4 + react-dom: 19.2.4(react@19.2.4) + ms@2.1.3: {} nanoid@3.3.11: {} diff --git a/public/cash-bg.png b/public/cash-bg.png new file mode 100644 index 0000000..7648391 Binary files /dev/null and b/public/cash-bg.png differ diff --git a/src/components/modal/index.tsx b/src/components/modal/index.tsx index 022b48b..d773e2e 100644 --- a/src/components/modal/index.tsx +++ b/src/components/modal/index.tsx @@ -1,6 +1,7 @@ import {Children} from 'react' import i18n from '@/lib/i18n' +import {MotionButton, tapMotionPropsSoft} from '@/lib/motion' import { cn } from '@/lib' import type { ModalProps } from '@/types' @@ -29,11 +30,12 @@ export function Modal({ return (
- + ) : null}
diff --git a/src/features/goods/GoodsCategoryList.tsx b/src/features/goods/GoodsCategoryList.tsx index d8f634e..f9921a3 100644 --- a/src/features/goods/GoodsCategoryList.tsx +++ b/src/features/goods/GoodsCategoryList.tsx @@ -5,6 +5,7 @@ import {ChevronRight} from 'lucide-react' import Button from '@/components/button' import {HOME_CATEGORY_META_MAP, HOME_GOOD_TYPE_ORDER} from '@/constant' +import {MotionButton, tapMotionPropsSoft} from '@/lib/motion' import type {ProductCategory, ProductItem} from '@/types' type GoodsCategoryListProps = { @@ -132,21 +133,22 @@ export function GoodsCategoryList({
{t(HOME_CATEGORY_META_MAP[category.id].nameKey)}
{showMore && onMoreClick ? ( - + ) : null}
{category.items.map((product) => (
- +
@@ -304,13 +306,14 @@ export function GoodsRedeemModal({ {addressOptions.map((address) => { const isSelected = selectedAddressId === address.id return ( -
- + ) })} -