From 66a66621ff877d3b4759fa44611721b9edbc09c1 Mon Sep 17 00:00:00 2001 From: Cupid Valentine Date: Thu, 28 Nov 2024 23:44:39 +0800 Subject: [PATCH] refactor: replace framer-motion to motion --- components/Cursor.tsx | 2 +- components/Reveal.tsx | 2 +- components/Ring/Ring.tsx | 2 +- package.json | 2 +- pnpm-lock.yaml | 35 +++++++++++++++++++++++++++++------ 5 files changed, 33 insertions(+), 10 deletions(-) diff --git a/components/Cursor.tsx b/components/Cursor.tsx index 8a924ac..56d0267 100644 --- a/components/Cursor.tsx +++ b/components/Cursor.tsx @@ -1,6 +1,6 @@ 'use client' -import { motion } from 'framer-motion' +import { motion } from 'motion/react' import React, { useEffect, useState } from 'react' export default function Cursor() { diff --git a/components/Reveal.tsx b/components/Reveal.tsx index 2df40de..15502d8 100644 --- a/components/Reveal.tsx +++ b/components/Reveal.tsx @@ -1,7 +1,7 @@ 'use client' import type { ReactNode } from 'react' -import { motion, useAnimation, useInView } from 'framer-motion' +import { motion, useAnimation, useInView } from 'motion/react' import React, { useEffect, useRef } from 'react' interface RevealProps { diff --git a/components/Ring/Ring.tsx b/components/Ring/Ring.tsx index b92cb41..88465ba 100644 --- a/components/Ring/Ring.tsx +++ b/components/Ring/Ring.tsx @@ -1,7 +1,7 @@ 'use client' import { Canvas } from '@react-three/offscreen' -import { motion } from 'framer-motion' +import { motion } from 'motion/react' import React, { lazy, useEffect, useState } from 'react' const PointCircle = lazy(() => import('./PointCircle')) diff --git a/package.json b/package.json index 261f34e..b04300a 100644 --- a/package.json +++ b/package.json @@ -26,11 +26,11 @@ "body-scroll-lock": "^4.0.0-beta.0", "contentlayer2": "0.5.3", "esbuild": "0.24.0", - "framer-motion": "^11.11.11", "github-slugger": "^2.0.0", "gray-matter": "^4.0.3", "hast-util-from-html-isomorphic": "^2.0.0", "image-size": "1.1.1", + "motion": "^11.12.0", "next": "14.2.15", "next-contentlayer2": "0.5.3", "next-themes": "^0.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f3b8094..a813d4b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -44,9 +44,6 @@ importers: esbuild: specifier: 0.24.0 version: 0.24.0 - framer-motion: - specifier: ^11.11.11 - version: 11.11.11(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) github-slugger: specifier: ^2.0.0 version: 2.0.0 @@ -59,6 +56,9 @@ importers: image-size: specifier: 1.1.1 version: 1.1.1 + motion: + specifier: ^11.12.0 + version: 11.12.0(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) next: specifier: 14.2.15 version: 14.2.15(@babel/core@7.25.2)(@opentelemetry/api@1.9.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -3284,8 +3284,8 @@ packages: fraction.js@4.3.7: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} - framer-motion@11.11.11: - resolution: {integrity: sha512-tuDH23ptJAKUHGydJQII9PhABNJBpB+z0P1bmgKK9QFIssHGlfPd6kxMq00LSKwE27WFsb2z0ovY0bpUyMvfRw==} + framer-motion@11.12.0: + resolution: {integrity: sha512-gZaZeqFM6pX9kMVti60hYAa75jGpSsGYWAHbBfIkuHN7DkVHVkxSxeNYnrGmHuM0zPkWTzQx10ZT+fDjn7N4SA==} peerDependencies: '@emotion/is-prop-valid': '*' react: ^18.0.0 @@ -4264,6 +4264,20 @@ packages: moo@0.5.2: resolution: {integrity: sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==} + motion@11.12.0: + resolution: {integrity: sha512-BFH9vwCs4dI9t1W1/1HonahOCnTxcKfzBR8D310wHFdx7oIwlP/51OqLNGO74lxOdCpTLf5BLe233k6yRqJo9Q==} + peerDependencies: + '@emotion/is-prop-valid': '*' + react: ^18.0.0 + react-dom: ^18.0.0 + peerDependenciesMeta: + '@emotion/is-prop-valid': + optional: true + react: + optional: true + react-dom: + optional: true + mrmime@2.0.0: resolution: {integrity: sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==} engines: {node: '>=10'} @@ -9534,7 +9548,7 @@ snapshots: fraction.js@4.3.7: {} - framer-motion@11.11.11(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + framer-motion@11.12.0(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: tslib: 2.7.0 optionalDependencies: @@ -10884,6 +10898,15 @@ snapshots: moo@0.5.2: {} + motion@11.12.0(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + dependencies: + framer-motion: 11.12.0(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + tslib: 2.7.0 + optionalDependencies: + '@emotion/is-prop-valid': 1.3.1 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + mrmime@2.0.0: {} ms@2.0.0: {}